MCPcopy Create free account
hub / github.com/rambaut/figtree / FigTreeApplication

Class FigTreeApplication

src/figtree/application/FigTreeApplication.java:67–447  ·  view source on GitHub ↗

Application class for FigTree including main() method for invoking it. Uses JAM Application classes to create a MultiDoc Application. @author Andrew Rambaut @version $Id$ $HeadURL$ $LastChangedBy$ $LastChangedDate$ $LastChangedRevision$

Source from the content-addressed store, hash-verified

65 * $LastChangedRevision$
66 */
67public class FigTreeApplication extends MultiDocApplication {
68
69 public static final String VERSION = "1.4.4";
70 public static final String DATES = "2006-2018";
71
72 public static FigTreeApplication application;
73
74 public FigTreeApplication(MenuBarFactory menuBarFactory, String nameString, String titleString, String aboutString, Icon icon,
75 String websiteURLString,
76 String helpURLString) {
77 super(menuBarFactory, nameString, titleString, aboutString, icon, websiteURLString, helpURLString);
78
79// addPreferencesSection(new GeneralPreferencesSection());
80 addPreferencesSection(new AppearancePreferencesSection());
81 addPreferencesSection(new FontsPreferencesSection());
82// addPreferencesSection(new AdvancedPreferencesSection());
83 }
84
85 public DocumentFrame doOpenFile(File file) {
86 DocumentFrame documentFrame = getUpperDocumentFrame();
87 if (documentFrame != null && documentFrame.getFile() == null) {
88 documentFrame.openFile(file);
89 return documentFrame;
90 } else {
91 return super.doOpenFile(file);
92 }
93 }
94
95 public void doPaste() {
96
97 }
98
99 static public void createGraphic(String graphicFormat, int width, int height, String treeFileName, String graphicFileName) {
100
101 try {
102 BufferedReader bufferedReader = new BufferedReader(new FileReader(treeFileName));
103 String line = bufferedReader.readLine();
104 while (line != null && line.length() == 0) {
105 line = bufferedReader.readLine();
106 }
107
108 bufferedReader.close();
109
110 boolean isNexus = (line != null && line.toUpperCase().contains("#NEXUS"));
111
112 Reader reader = new FileReader(treeFileName);
113
114 Map<String, Object> settings = new HashMap<String, Object>();
115
116 ExtendedTreeViewer treeViewer = new ExtendedTreeViewer();
117 ControlPalette controlPalette = new BasicControlPalette(FigTreePanel.CONTROL_PALETTE_WIDTH, BasicControlPalette.DisplayMode.ONLY_ONE_OPEN);
118 FigTreePanel figTreePanel = new FigTreePanel(null, treeViewer, controlPalette);
119
120 // First of all, fully populate the settings map so that
121 // all the settings have defaults
122 controlPalette.getSettings(settings);
123
124 List<Tree> trees = new ArrayList<Tree>();

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…