inprogress
[jalview.git] / forester / java / src / org / forester / archaeopteryx / MainFrameApplet.java
index 871cbc6..4a5c932 100644 (file)
@@ -67,16 +67,16 @@ public final class MainFrameApplet extends MainFrame {
         URL url = null;
         Phylogeny[] phys = null;
         // Get URL to tree file
-        if ( _applet.getUrlString() != null ) {
+        if ( _applet.getTreeUrlStr() != null ) {
             try {
-                url = new URL( _applet.getUrlString() );
+                url = new URL( _applet.getTreeUrlStr() );
             }
             catch ( final Exception e ) {
                 ForesterUtil.printErrorMessage( ArchaeopteryxA.NAME, e.toString() );
                 e.printStackTrace();
                 JOptionPane.showMessageDialog( this,
                                                ArchaeopteryxA.NAME + ": Could not create URL from: \""
-                                                       + _applet.getUrlString() + "\"\nError: " + e,
+                                                       + _applet.getTreeUrlStr() + "\"\nError: " + e,
                                                "Failed to create URL",
                                                JOptionPane.ERROR_MESSAGE );
                 close();
@@ -113,6 +113,8 @@ public final class MainFrameApplet extends MainFrame {
         if ( !_configuration.isUseNativeUI() ) {
             _jmenubar.setBackground( _configuration.getGuiMenuBackgroundColor() );
         }
+        //TODO if species tree...
+        buildAnalysisMenu();
         buildToolsMenu();
         buildViewMenu();
         buildFontSizeMenu();
@@ -137,11 +139,11 @@ public final class MainFrameApplet extends MainFrame {
             @Override
             public void componentResized( final ComponentEvent e ) {
                 if ( _mainpanel.getCurrentTreePanel() != null ) {
-                    _mainpanel.getCurrentTreePanel().setParametersForPainting( _mainpanel.getCurrentTreePanel()
-                                                                                       .getWidth(),
-                                                                               _mainpanel.getCurrentTreePanel()
-                                                                                       .getHeight(),
-                                                                               false );
+                    _mainpanel.getCurrentTreePanel().calcParametersForPainting( _mainpanel.getCurrentTreePanel()
+                                                                                        .getWidth(),
+                                                                                _mainpanel.getCurrentTreePanel()
+                                                                                        .getHeight(),
+                                                                                getOptions().isAllowFontSizeChange() );
                 }
             }
         } );
@@ -152,6 +154,19 @@ public final class MainFrameApplet extends MainFrame {
         System.gc();
     }
 
+    void buildAnalysisMenu() {
+        _analysis_menu = MainFrame.createMenu( "Analysis", getConfiguration() );
+        _analysis_menu.add( _gsdi_item = new JMenuItem( "GSDI (Generalized Speciation Duplication Inference)" ) );
+        _analysis_menu.add( _gsdir_item = new JMenuItem( "GSDIR (GSDI with re-rooting)" ) );
+        customizeJMenuItem( _gsdi_item );
+        customizeJMenuItem( _gsdir_item );
+        //  _analysis_menu.addSeparator();
+        //  _analysis_menu.add( _lineage_inference = new JMenuItem( INFER_ANCESTOR_TAXONOMIES ) );
+        //  customizeJMenuItem( _lineage_inference );
+        //  _lineage_inference.setToolTipText( "Inference of ancestor taxonomies/lineages" );
+        _jmenubar.add( _analysis_menu );
+    }
+
     void buildOptionsMenu() {
         _options_jmenu = MainFrame.createMenu( MainFrame.OPTIONS_HEADER, getConfiguration() );
         _options_jmenu.addChangeListener( new ChangeListener() {
@@ -191,7 +206,10 @@ public final class MainFrameApplet extends MainFrame {
         _options_jmenu
                 .add( _show_branch_length_values_cbmi = new JCheckBoxMenuItem( MainFrame.DISPLAY_BRANCH_LENGTH_VALUES_LABEL ) );
         _options_jmenu.add( _show_confidence_stddev_cbmi = new JCheckBoxMenuItem( SHOW_CONF_STDDEV_LABEL ) );
-        _options_jmenu.add( _show_default_node_shapes_cbmi = new JCheckBoxMenuItem( DISPLAY_NODE_BOXES_LABEL ) );
+        _options_jmenu
+                .add( _show_default_node_shapes_internal_cbmi = new JCheckBoxMenuItem( DISPLAY_NODE_BOXES_LABEL_INT ) );
+        _options_jmenu
+                .add( _show_default_node_shapes_external_cbmi = new JCheckBoxMenuItem( DISPLAY_NODE_BOXES_LABEL_EXT ) );
         _options_jmenu
                 .add( _taxonomy_colorize_node_shapes_cbmi = new JCheckBoxMenuItem( MainFrame.TAXONOMY_COLORIZE_NODE_SHAPES_LABEL ) );
         _options_jmenu.add( _cycle_node_shape_mi = new JMenuItem( MainFrame.CYCLE_NODE_SHAPE_LABEL ) );
@@ -222,7 +240,10 @@ public final class MainFrameApplet extends MainFrame {
         customizeJMenuItem( _switch_colors_mi );
         customizeJMenuItem( _choose_minimal_confidence_mi );
         customizeJMenuItem( _overview_placment_mi );
-        customizeCheckBoxMenuItem( _show_default_node_shapes_cbmi, getOptions().isShowDefaultNodeShapes() );
+        customizeCheckBoxMenuItem( _show_default_node_shapes_internal_cbmi, getOptions()
+                .isShowDefaultNodeShapesInternal() );
+        customizeCheckBoxMenuItem( _show_default_node_shapes_external_cbmi, getOptions()
+                .isShowDefaultNodeShapesExternal() );
         customizeCheckBoxMenuItem( _taxonomy_colorize_node_shapes_cbmi, getOptions().isTaxonomyColorizeNodeShapes() );
         customizeJMenuItem( _cycle_node_shape_mi );
         customizeJMenuItem( _cycle_node_fill_mi );
@@ -281,4 +302,8 @@ public final class MainFrameApplet extends MainFrame {
     void readPhylogeniesFromURL() {
         throw new NoSuchMethodError( "not implemented" );
     }
+
+    void setSpeciesTree( final Phylogeny species_tree ) {
+        _species_tree = species_tree;
+    }
 }