Debian Codegraph @

src/dr/app/tempest/TempEstApp.java

raw symbols SCIP
1 /*
2 * TempestApp.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.tempest;
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 * @version $Id$
38 */
39 public class TempEstApp extends MultiDocApplication {
40 private final static Version version = new Version() {
41 private static final String VERSION = "1.5.2";
42
43 public String getVersion() {
44 return VERSION;
45 }
46
47 public String getVersionString() {
48 return "v" + VERSION;
49 }
50
51 public String getDateString() {
52 return "2003-2018";
53 }
54
55 public String getBuildString() {
56 return "GitHub 20160821";
57 }
58
59 public String[] getCredits() {
60 return new String[0];
61 }
62
63 public String getHTMLCredits() {
64 return "<p>by<br>" +
65 "Andrew Rambaut</p>" +
66 "<p>Institute of Evolutionary Biology, University of Edinburgh<br>" +
67 "<a href=\"mailto:[email protected]\">[email protected]</a></p>" +
68 "<p>Citation<br>" +
69 "<a href=\"http://dx.doi.org/10.1093/ve/vew007\">Rambaut, Lam, de Carvalho & Pybus (2016) Exploring the temporal structure of<br>" +
70 "heterochronous sequences using TempEst. <i>Virus Evolution</i> <b>2</b>: vew007</a></p>" +
71 "<p>Part of the BEAST package:<br>" +
72 "<a href=\"http://beast.community\">http://beast.community</a></p>";
73 }
74
75 };
76
77 public TempEstApp(String nameString, String aboutString, Icon icon,
78 String websiteURLString, String helpURLString) {
79 super(new TempestMenuBarFactory(), nameString, aboutString, icon, websiteURLString, helpURLString);
80 }
81
82 // Main entry point
83 static public void main(String[] args) {
84
85
86 if (OSType.isMac()) {
87 System.setProperty("apple.laf.useScreenMenuBar","true");
88 System.setProperty("apple.awt.showGrowBox","true");
89 System.setProperty("apple.awt.graphics.UseQuartz","true");
90 UIManager.put("SystemFont", new Font("Lucida Grande", Font.PLAIN, 13));
91 UIManager.put("SmallSystemFont", new Font("Lucida Grande", Font.PLAIN, 11));
92 }
93
94 try {
95
96 try {
97 SwingUtilities.invokeAndWait(new Runnable() {
98 public void run() {
99 try {
100 UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
101 } catch (Exception e) {
102 e.printStackTrace();
103 }
104 }
105 });
106 } catch (Exception e) {
107 e.printStackTrace();
108 }
109
110 java.net.URL url = TempEstApp.class.getResource("images/tempest.png");
111 Icon icon = null;
112
113 if (url != null) {
114 icon = new ImageIcon(url);
115 }
116
117 final String nameString = "TempEst";
118 final String versionString = version.getVersionString();
119 String aboutString = "<html><center><p>Temporal Signal Estimator Tool<br>" +
120 "Version " + versionString + ", " + version.getDateString() + "</p>" +
121 version.getHTMLCredits() +
122 "</center></html>";
123
124 String websiteURLString = "http://tree.bio.ed.ac.uk/";
125 String helpURLString = "http://tree.bio.ed.ac.uk/software/tempest";
126
127 TempEstApp app = new TempEstApp(nameString, aboutString, icon,
128 websiteURLString, helpURLString);
129 app.setDocumentFrameFactory(new DocumentFrameFactory() {
130 public DocumentFrame createDocumentFrame(Application app, MenuBarFactory menuBarFactory) {
131 return new TempestFrame(nameString);
132 }
133 });
134 app.initialize();
135 app.doOpen();
136 } catch (Exception e) {
137 JOptionPane.showMessageDialog(new JFrame(), "Fatal exception: " + e,
138 "Please report this to the authors",
139 JOptionPane.ERROR_MESSAGE);
140 e.printStackTrace();
141 }
142 }
143
144 }