inprogress
[jalview.git] / forester / java / src / org / forester / archaeopteryx / MainFrameApplet.java
index cf9a672..1248fa5 100644 (file)
@@ -24,7 +24,7 @@
 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
 //
 // Contact: phylosoft @ gmail . com
-// WWW: www.phylosoft.org/forester
+// WWW: https://sites.google.com/site/cmzmasek/home/software/forester
 
 package org.forester.archaeopteryx;
 
@@ -52,8 +52,9 @@ import org.forester.util.ForesterUtil;
 
 public final class MainFrameApplet extends MainFrame {
 
-    private static final long    serialVersionUID = 1941019292746717053L;
-    private final static int     FRAME_X_SIZE     = 640, FRAME_Y_SIZE = 580;
+    private static final long    serialVersionUID     = 1941019292746717053L;
+    private final static int     DEFAULT_FRAME_X_SIZE = 640;
+    private final static int     DEFAULT_FRAME_Y_SIZE = 580;
     private final ArchaeopteryxA _applet;
     private ButtonGroup          _radio_group_1;
 
@@ -62,7 +63,7 @@ public final class MainFrameApplet extends MainFrame {
         _applet = parent_applet;
         setConfiguration( configuration );
         setOptions( Options.createInstance( configuration ) );
-        _textframe = null;
+        //_textframes = null; //~~~~
         URL url = null;
         Phylogeny[] phys = null;
         // Get URL to tree file
@@ -84,7 +85,11 @@ public final class MainFrameApplet extends MainFrame {
         // Load the tree from URL
         if ( url != null ) {
             try {
-                phys = AptxUtil.readPhylogeniesFromUrl( url, getConfiguration().isValidatePhyloXmlAgainstSchema() );
+                phys = AptxUtil.readPhylogeniesFromUrl( url,
+                                                        configuration.isValidatePhyloXmlAgainstSchema(),
+                                                        configuration.isReplaceUnderscoresInNhParsing(),
+                                                        configuration.isInternalNumberAreConfidenceForNhParsing(),
+                                                        configuration.getTaxonomyExtraction() );
             }
             catch ( final Exception e ) {
                 ForesterUtil.printErrorMessage( ArchaeopteryxA.NAME, e.toString() );
@@ -118,7 +123,8 @@ public final class MainFrameApplet extends MainFrame {
         _contentpane = getContentPane();
         _contentpane.setLayout( new BorderLayout() );
         _contentpane.add( _mainpanel, BorderLayout.CENTER );
-        setSize( FRAME_X_SIZE, FRAME_Y_SIZE );
+        setSize( getConfiguration().getFrameXSize() > 40 ? getConfiguration().getFrameXSize() : DEFAULT_FRAME_X_SIZE,
+                 getConfiguration().getFrameYSize() > 40 ? getConfiguration().getFrameYSize() : DEFAULT_FRAME_Y_SIZE );
         addWindowListener( new WindowAdapter() {
 
             @Override
@@ -180,16 +186,20 @@ public final class MainFrameApplet extends MainFrame {
         _radio_group_1.add( _ext_node_dependent_cladogram_rbmi );
         _radio_group_1.add( _uniform_cladograms_rbmi );
         _radio_group_1.add( _non_lined_up_cladograms_rbmi );
-        _options_jmenu.add( _show_default_node_shapes_cbmi = new JCheckBoxMenuItem( DISPLAY_NODE_BOXES_LABEL ) );
+        _options_jmenu.add( _show_overview_cbmi = new JCheckBoxMenuItem( MainFrame.SHOW_OVERVIEW_LABEL ) );
+        _options_jmenu.add( _show_scale_cbmi = new JCheckBoxMenuItem( MainFrame.DISPLAY_SCALE_LABEL ) );
+        _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_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 ) );
         _options_jmenu.add( _cycle_node_fill_mi = new JMenuItem( MainFrame.CYCLE_NODE_FILL_LABEL ) );
         _options_jmenu.add( _choose_node_size_mi = new JMenuItem( MainFrame.CHOOSE_NODE_SIZE_LABEL ) );
-        _options_jmenu.add( _show_scale_cbmi = new JCheckBoxMenuItem( MainFrame.DISPLAY_SCALE_LABEL ) );
-        _options_jmenu
-                .add( _show_branch_length_values_cbmi = new JCheckBoxMenuItem( MainFrame.DISPLAY_BRANCH_LENGTH_VALUES_LABEL ) );
-        _options_jmenu.add( _show_overview_cbmi = new JCheckBoxMenuItem( MainFrame.SHOW_OVERVIEW_LABEL ) );
         _options_jmenu.add( _label_direction_cbmi = new JCheckBoxMenuItem( LABEL_DIRECTION_LABEL ) );
         _label_direction_cbmi.setToolTipText( LABEL_DIRECTION_TIP );
         _options_jmenu.add( _color_labels_same_as_parent_branch = new JCheckBoxMenuItem( COLOR_LABELS_LABEL ) );
@@ -215,7 +225,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 );
@@ -239,6 +252,7 @@ public final class MainFrameApplet extends MainFrame {
                                    getOptions().getNodeLabelDirection() == NODE_LABEL_DIRECTION.RADIAL );
         customizeCheckBoxMenuItem( _search_whole_words_only_cbmi, getOptions().isMatchWholeTermsOnly() );
         customizeCheckBoxMenuItem( _inverse_search_result_cbmi, getOptions().isInverseSearchResult() );
+        customizeCheckBoxMenuItem( _show_confidence_stddev_cbmi, getOptions().isShowConfidenceStddev() );
         _jmenubar.add( _options_jmenu );
     }
 
@@ -255,9 +269,6 @@ public final class MainFrameApplet extends MainFrame {
         _tools_menu.add( _midpoint_root_item = new JMenuItem( "Midpoint-Root" ) );
         customizeJMenuItem( _midpoint_root_item );
         _tools_menu.addSeparator();
-        _tools_menu
-                .add( _infer_common_sn_names_item = new JMenuItem( "Infer Common Parts of Internal Scientific Names" ) );
-        customizeJMenuItem( _infer_common_sn_names_item );
         _tools_menu.add( _collapse_species_specific_subtrees = new JMenuItem( "Collapse Species-Specific Subtrees" ) );
         customizeJMenuItem( _collapse_species_specific_subtrees );
         _jmenubar.add( _tools_menu );
@@ -268,7 +279,7 @@ public final class MainFrameApplet extends MainFrame {
     }
 
     @Override
-    MainPanel getMainPanel() {
+    public MainPanel getMainPanel() {
         return _mainpanel;
     }