| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
package dr.app.pathogen; |
| 27 |
|
| 28 |
import dr.app.util.OSType; |
| 29 |
import dr.util.Version; |
| 30 |
import jam.framework.*; |
| 31 |
|
| 32 |
import javax.swing.*; |
| 33 |
import java.awt.*; |
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
@Deprecated |
| 41 |
public class PathogenApp extends MultiDocApplication { |
| 42 |
private final static Version version = new Version() { |
| 43 |
private static final String VERSION = "1.5"; |
| 44 |
|
| 45 |
public String getVersion() { |
| 46 |
return VERSION; |
| 47 |
} |
| 48 |
|
| 49 |
public String getVersionString() { |
| 50 |
return "v" + VERSION; |
| 51 |
} |
| 52 |
|
| 53 |
public String getDateString() { |
| 54 |
return "2003-2015"; |
| 55 |
} |
| 56 |
|
| 57 |
public String getBuildString() { |
| 58 |
return "Build r3656"; |
| 59 |
} |
| 60 |
|
| 61 |
public String[] getCredits() { |
| 62 |
return new String[0]; |
| 63 |
} |
| 64 |
|
| 65 |
public String getHTMLCredits() { |
| 66 |
return "<p>by<br>" + |
| 67 |
"Andrew Rambaut</p>" + |
| 68 |
"<p>Institute of Evolutionary Biology, University of Edinburgh<br>" + |
| 69 |
"<a href=\"mailto:[email protected]\">[email protected]</a></p>" + |
| 70 |
"<p>Part of the BEAST package:<br>" + |
| 71 |
"<a href=\"http://beast.community\">http://beast.community</a></p>"; |
| 72 |
} |
| 73 |
|
| 74 |
}; |
| 75 |
|
| 76 |
public PathogenApp(String nameString, String aboutString, Icon icon, |
| 77 |
String websiteURLString, String helpURLString) { |
| 78 |
super(new PathogenMenuBarFactory(), nameString, aboutString, icon, websiteURLString, helpURLString); |
| 79 |
} |
| 80 |
|
| 81 |
|
| 82 |
static public void main(String[] args) { |
| 83 |
|
| 84 |
|
| 85 |
if (OSType.isMac()) { |
| 86 |
System.setProperty("apple.laf.useScreenMenuBar","true"); |
| 87 |
System.setProperty("apple.awt.showGrowBox","true"); |
| 88 |
System.setProperty("apple.awt.graphics.UseQuartz","true"); |
| 89 |
UIManager.put("SystemFont", new Font("Lucida Grande", Font.PLAIN, 13)); |
| 90 |
UIManager.put("SmallSystemFont", new Font("Lucida Grande", Font.PLAIN, 11)); |
| 91 |
} |
| 92 |
|
| 93 |
try { |
| 94 |
|
| 95 |
try { |
| 96 |
javax.swing.SwingUtilities.invokeAndWait(new Runnable() { |
| 97 |
public void run() { |
| 98 |
try { |
| 99 |
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); |
| 100 |
} catch (Exception e) { |
| 101 |
e.printStackTrace(); |
| 102 |
} |
| 103 |
} |
| 104 |
}); |
| 105 |
} catch (Exception e) { |
| 106 |
e.printStackTrace(); |
| 107 |
} |
| 108 |
|
| 109 |
java.net.URL url = PathogenApp.class.getResource("images/pathogen.png"); |
| 110 |
Icon icon = null; |
| 111 |
|
| 112 |
if (url != null) { |
| 113 |
icon = new ImageIcon(url); |
| 114 |
} |
| 115 |
|
| 116 |
final String nameString = "Path-O-Gen"; |
| 117 |
final String versionString = version.getVersionString(); |
| 118 |
String aboutString = "<html><center><p>Temporal Signal Investigation Tool<br>" + |
| 119 |
"Version " + versionString + ", " + version.getDateString() + "</p>" + |
| 120 |
version.getHTMLCredits() + |
| 121 |
"</center></html>"; |
| 122 |
|
| 123 |
String websiteURLString = "http://tree.bio.ed.ac.uk/"; |
| 124 |
String helpURLString = "http://tree.bio.ed.ac.uk/software/pathogen"; |
| 125 |
|
| 126 |
PathogenApp app = new PathogenApp(nameString, aboutString, icon, |
| 127 |
websiteURLString, helpURLString); |
| 128 |
app.setDocumentFrameFactory(new DocumentFrameFactory() { |
| 129 |
public DocumentFrame createDocumentFrame(Application app, MenuBarFactory menuBarFactory) { |
| 130 |
return new PathogenFrame(nameString); |
| 131 |
} |
| 132 |
}); |
| 133 |
app.initialize(); |
| 134 |
app.doOpen(); |
| 135 |
} catch (Exception e) { |
| 136 |
JOptionPane.showMessageDialog(new JFrame(), "Fatal exception: " + e, |
| 137 |
"Please report this to the authors", |
| 138 |
JOptionPane.ERROR_MESSAGE); |
| 139 |
e.printStackTrace(); |
| 140 |
} |
| 141 |
} |
| 142 |
|
| 143 |
} |