Debian Codegraph @

src/dr/app/pathogen/PathogenApp.java

raw symbols SCIP
1 /*
2 * PathogenApp.java
3 *
4 * Copyright (c) 2002-2015 Alexei Drummond, Andrew Rambaut and Marc Suchard
5 *
6 * This file is part of BEAST.
7 * See the NOTICE file distributed with this work for additional
8 * information regarding copyright ownership and licensing.
9 *
10 * BEAST is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU Lesser General Public License as
12 * published by the Free Software Foundation; either version 2
13 * of the License, or (at your option) any later version.
14 *
15 * BEAST is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License for more details.
19 *
20 * You should have received a copy of the GNU Lesser General Public
21 * License along with BEAST; if not, write to the
22 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
23 * Boston, MA 02110-1301 USA
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 * @author Andrew Rambaut
37 * @author Alexei Drummond
38 * @version $Id$
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 // Main entry point
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 }