in progress
authorcmzmasek@gmail.com <cmzmasek@gmail.com@ca865154-3058-d1c3-3e42-d8f55a55bdbd>
Wed, 20 Aug 2014 19:59:25 +0000 (19:59 +0000)
committercmzmasek@gmail.com <cmzmasek@gmail.com@ca865154-3058-d1c3-3e42-d8f55a55bdbd>
Wed, 20 Aug 2014 19:59:25 +0000 (19:59 +0000)
forester/java/src/org/forester/archaeopteryx/ArchaeopteryxE.java
forester/java/src/org/forester/archaeopteryx/ControlPanel.java
forester/java/src/org/forester/archaeopteryx/MainFrame.java
forester/java/src/org/forester/archaeopteryx/MainFrameApplet.java
forester/java/src/org/forester/archaeopteryx/MainFrameApplication.java

index 77355ea..fb37c4f 100644 (file)
@@ -736,16 +736,16 @@ public class ArchaeopteryxE extends JApplet implements ActionListener {
                         .setTextMinSupportMenuItem( _choose_minimal_confidence_mi, getOptions(), getCurrentTreePanel() );
                 MainFrame.setTextForFontChooserMenuItem( _choose_font_mi, MainFrame
                         .createCurrentFontDesc( getMainPanel().getTreeFontSet() ) );
-                MainFrame.updateOptionsMenuDependingOnPhylogenyType( getMainPanel(),
-                                                                     _show_scale_cbmi,
-                                                                     _show_branch_length_values_cbmi,
-                                                                     _non_lined_up_cladograms_rbmi,
-                                                                     _uniform_cladograms_rbmi,
-                                                                     _ext_node_dependent_cladogram_rbmi,
-                                                                     _label_direction_cbmi );
                 MainFrame.setCycleNodeFillMenuItem( _cycle_node_fill_mi, getOptions() );
                 MainFrame.setCycleNodeShapeMenuItem( _cycle_node_shape_mi, getOptions() );
                 MainFrame.setTextNodeSizeMenuItem( _choose_node_size_mi, getOptions() );
+                try {
+                    getMainPanel().getControlPanel().setVisibilityOfDomainStrucureCB();
+                    getMainPanel().getControlPanel().setVisibilityOfX();
+                }
+                catch ( final Exception ignore ) {
+                    // do nothing, not important.
+                }
             }
         } );
         _options_jmenu.add( MainFrame.customizeMenuItemAsLabel( new JMenuItem( MainFrame.DISPLAY_SUBHEADER ),
index 225a591..e8ba350 100644 (file)
@@ -165,7 +165,6 @@ final class ControlPanel extends JPanel implements ActionListener {
     private JCheckBox                         _width_branches;
     private JCheckBox                         _write_confidence;
     private JButton                           _zoom_in_domain_structure;
-    // zooming and quick tree manipulation buttons:
     private JButton                           _zoom_in_x;
     private JButton                           _zoom_in_y;
     private JLabel                            _zoom_label;
@@ -1297,7 +1296,7 @@ final class ControlPanel extends JPanel implements ActionListener {
     }
 
     void setUpControlsForDomainStrucures() {
-        _domain_display_label = new JLabel( "Domain Display:" );
+        _domain_display_label = new JLabel( "Domain Architectures:" );
         add( customizeLabel( _domain_display_label, getConfiguration() ) );
         add( _domain_display_label );
         _zoom_in_domain_structure = new JButton( "d+" );
@@ -2273,6 +2272,12 @@ final class ControlPanel extends JPanel implements ActionListener {
                 _decr_domain_structure_evalue_thr.setVisible( true );
                 _incr_domain_structure_evalue_thr.setVisible( true );
                 _domain_structure_evalue_thr_tf.setVisible( true );
+                if ( getMainPanel().getMainFrame()._right_line_up_domains_cbmi != null ) {
+                    getMainPanel().getMainFrame()._right_line_up_domains_cbmi.setVisible( true );
+                }
+                if ( getMainPanel().getMainFrame()._show_domain_labels != null ) {
+                    getMainPanel().getMainFrame()._show_domain_labels.setVisible( true );
+                }
             }
             else {
                 _domain_display_label.setVisible( false );
@@ -2281,8 +2286,109 @@ final class ControlPanel extends JPanel implements ActionListener {
                 _decr_domain_structure_evalue_thr.setVisible( false );
                 _incr_domain_structure_evalue_thr.setVisible( false );
                 _domain_structure_evalue_thr_tf.setVisible( false );
+                if ( getMainPanel().getMainFrame()._right_line_up_domains_cbmi != null ) {
+                    getMainPanel().getMainFrame()._right_line_up_domains_cbmi.setVisible( false );
+                }
+                if ( getMainPanel().getMainFrame()._show_domain_labels != null ) {
+                    getMainPanel().getMainFrame()._show_domain_labels.setVisible( false );
+                }
+            }
+        }
+    }
+
+    void setVisibilityOfX() {
+        try {
+            if ( isDrawPhylogram()
+                    || ( ( getCurrentTreePanel() != null ) && ( ( getCurrentTreePanel().getPhylogenyGraphicsType() == PHYLOGENY_GRAPHICS_TYPE.CIRCULAR ) || ( getCurrentTreePanel()
+                            .getPhylogenyGraphicsType() == PHYLOGENY_GRAPHICS_TYPE.UNROOTED ) ) ) ) {
+                if ( getMainPanel().getMainFrame()._non_lined_up_cladograms_rbmi != null ) {
+                    getMainPanel().getMainFrame()._non_lined_up_cladograms_rbmi.setVisible( false );
+                }
+                if ( getMainPanel().getMainFrame()._uniform_cladograms_rbmi != null ) {
+                    getMainPanel().getMainFrame()._uniform_cladograms_rbmi.setVisible( false );
+                }
+                if ( getMainPanel().getMainFrame()._ext_node_dependent_cladogram_rbmi != null ) {
+                    getMainPanel().getMainFrame()._ext_node_dependent_cladogram_rbmi.setVisible( false );
+                }
+            }
+            else {
+                if ( getMainPanel().getMainFrame()._non_lined_up_cladograms_rbmi != null ) {
+                    getMainPanel().getMainFrame()._non_lined_up_cladograms_rbmi.setVisible( true );
+                }
+                if ( getMainPanel().getMainFrame()._uniform_cladograms_rbmi != null ) {
+                    getMainPanel().getMainFrame()._uniform_cladograms_rbmi.setVisible( true );
+                }
+                if ( getMainPanel().getMainFrame()._ext_node_dependent_cladogram_rbmi != null ) {
+                    getMainPanel().getMainFrame()._ext_node_dependent_cladogram_rbmi.setVisible( true );
+                }
+            }
+            if ( isDrawPhylogram() ) {
+                if ( getMainPanel().getMainFrame()._show_scale_cbmi != null ) {
+                    getMainPanel().getMainFrame()._show_scale_cbmi.setVisible( true );
+                }
+            }
+            else {
+                if ( getMainPanel().getMainFrame()._show_scale_cbmi != null ) {
+                    getMainPanel().getMainFrame()._show_scale_cbmi.setVisible( false );
+                }
+            }
+            if ( getCurrentTreePanel() != null ) {
+                if ( ( getCurrentTreePanel().getPhylogenyGraphicsType() == PHYLOGENY_GRAPHICS_TYPE.CIRCULAR )
+                        || ( getCurrentTreePanel().getPhylogenyGraphicsType() == PHYLOGENY_GRAPHICS_TYPE.UNROOTED ) ) {
+                    if ( getMainPanel().getMainFrame()._label_direction_cbmi != null ) {
+                        getMainPanel().getMainFrame()._label_direction_cbmi.setVisible( true );
+                    }
+                    if ( getMainPanel().getMainFrame()._show_branch_length_values_cbmi != null ) {
+                        getMainPanel().getMainFrame()._show_branch_length_values_cbmi.setVisible( false );
+                    }
+                }
+                else {
+                    if ( getMainPanel().getMainFrame()._label_direction_cbmi != null ) {
+                        getMainPanel().getMainFrame()._label_direction_cbmi.setVisible( false );
+                    }
+                    if ( getMainPanel().getMainFrame()._show_branch_length_values_cbmi != null ) {
+                        getMainPanel().getMainFrame()._show_branch_length_values_cbmi.setVisible( true );
+                    }
+                }
             }
         }
+        catch ( final Exception ignore ) {
+            //not important...
+        }
+    }
+
+    void setVisibilityOfDomainStrucureCB() {
+        try {
+            if ( ( getCurrentTreePanel() != null )
+                    && ( ( getCurrentTreePanel().getPhylogenyGraphicsType() == PHYLOGENY_GRAPHICS_TYPE.CIRCULAR ) || ( getCurrentTreePanel()
+                            .getPhylogenyGraphicsType() == PHYLOGENY_GRAPHICS_TYPE.UNROOTED ) ) ) {
+                if ( getMainPanel().getMainFrame()._right_line_up_domains_cbmi != null ) {
+                    getMainPanel().getMainFrame()._right_line_up_domains_cbmi.setVisible( false );
+                }
+                if ( getMainPanel().getMainFrame()._show_domain_labels != null ) {
+                    getMainPanel().getMainFrame()._show_domain_labels.setVisible( false );
+                }
+            }
+            else if ( isShowDomainArchitectures() ) {
+                if ( getMainPanel().getMainFrame()._right_line_up_domains_cbmi != null ) {
+                    getMainPanel().getMainFrame()._right_line_up_domains_cbmi.setVisible( true );
+                }
+                if ( getMainPanel().getMainFrame()._show_domain_labels != null ) {
+                    getMainPanel().getMainFrame()._show_domain_labels.setVisible( true );
+                }
+            }
+            else {
+                if ( getMainPanel().getMainFrame()._right_line_up_domains_cbmi != null ) {
+                    getMainPanel().getMainFrame()._right_line_up_domains_cbmi.setVisible( false );
+                }
+                if ( getMainPanel().getMainFrame()._show_domain_labels != null ) {
+                    getMainPanel().getMainFrame()._show_domain_labels.setVisible( false );
+                }
+            }
+        }
+        catch ( final Exception ignore ) {
+            //not important...
+        }
     }
 
     static JLabel customizeLabel( final JLabel label, final Configuration configuration ) {
index b64958b..1cf79b0 100644 (file)
@@ -1824,84 +1824,6 @@ public abstract class MainFrame extends JFrame implements ActionListener {
         mi.setText( "Enter Default Node Shape Size... (current: " + options.getDefaultNodeShapeSize() + ")" );\r
     }\r
 \r
-    static void updateOptionsMenuDependingOnPhylogenyType( final MainPanel main_panel,\r
-                                                           final JCheckBoxMenuItem scale,\r
-                                                           final JCheckBoxMenuItem branch_lengths,\r
-                                                           final JRadioButtonMenuItem non_lined_up,\r
-                                                           final JRadioButtonMenuItem uniform_clado,\r
-                                                           final JRadioButtonMenuItem nonuniform_clado,\r
-                                                           final JCheckBoxMenuItem label_direction_cbmi ) {\r
-        final TreePanel tree_panel = main_panel.getCurrentTreePanel();\r
-        final ControlPanel control = main_panel.getControlPanel();\r
-        final Options options = main_panel.getOptions();\r
-        scale.setSelected( options.isShowScale() );\r
-        branch_lengths.setSelected( options.isShowBranchLengthValues() );\r
-        // non_lined_up.setSelected( options.isNonLinedUpCladogram() );\r
-        if ( ( tree_panel != null ) && ( !tree_panel.isPhyHasBranchLengths() ) ) {\r
-            scale.setSelected( false );\r
-            scale.setEnabled( false );\r
-            branch_lengths.setSelected( false );\r
-            branch_lengths.setEnabled( false );\r
-        }\r
-        else if ( ( tree_panel != null ) && !control.isDrawPhylogram() ) {\r
-            scale.setSelected( false );\r
-            scale.setEnabled( false );\r
-            branch_lengths.setEnabled( true );\r
-        }\r
-        else {\r
-            scale.setEnabled( true );\r
-            branch_lengths.setEnabled( true );\r
-        }\r
-        if ( ( tree_panel != null )\r
-                && ( ( tree_panel.getPhylogenyGraphicsType() != PHYLOGENY_GRAPHICS_TYPE.ROUNDED )\r
-                        && ( tree_panel.getPhylogenyGraphicsType() != PHYLOGENY_GRAPHICS_TYPE.EURO_STYLE ) && ( tree_panel\r
-                        .getPhylogenyGraphicsType() != PHYLOGENY_GRAPHICS_TYPE.RECTANGULAR ) ) ) {\r
-            branch_lengths.setSelected( false );\r
-            branch_lengths.setEnabled( false );\r
-        }\r
-        if ( tree_panel != null ) {\r
-            if ( ( tree_panel.getPhylogenyGraphicsType() == PHYLOGENY_GRAPHICS_TYPE.CIRCULAR )\r
-                    || ( tree_panel.getPhylogenyGraphicsType() == PHYLOGENY_GRAPHICS_TYPE.UNROOTED ) ) {\r
-                non_lined_up.setEnabled( false );\r
-                uniform_clado.setEnabled( false );\r
-                nonuniform_clado.setEnabled( false );\r
-            }\r
-            else {\r
-                non_lined_up.setEnabled( true );\r
-                uniform_clado.setEnabled( true );\r
-                nonuniform_clado.setEnabled( true );\r
-            }\r
-        }\r
-        else {\r
-            if ( ( tree_panel != null )\r
-                    && ( ( tree_panel.getPhylogenyGraphicsType() != PHYLOGENY_GRAPHICS_TYPE.EURO_STYLE ) && ( tree_panel\r
-                            .getPhylogenyGraphicsType() != PHYLOGENY_GRAPHICS_TYPE.RECTANGULAR ) ) ) {\r
-                branch_lengths.setSelected( false );\r
-                branch_lengths.setEnabled( false );\r
-            }\r
-            if ( ( tree_panel != null )\r
-                    && ( ( tree_panel.getPhylogenyGraphicsType() == PHYLOGENY_GRAPHICS_TYPE.CIRCULAR ) || ( tree_panel\r
-                            .getPhylogenyGraphicsType() == PHYLOGENY_GRAPHICS_TYPE.UNROOTED ) ) ) {\r
-                non_lined_up.setEnabled( false );\r
-            }\r
-            else {\r
-                // non_lined_up.setSelected( options.isNonLinedUpCladogram() );\r
-                non_lined_up.setEnabled( true );\r
-            }\r
-        }\r
-        label_direction_cbmi.setEnabled( true );\r
-        if ( tree_panel != null ) {\r
-            if ( ( tree_panel.getPhylogenyGraphicsType() != PHYLOGENY_GRAPHICS_TYPE.UNROOTED )\r
-                    && ( tree_panel.getPhylogenyGraphicsType() != PHYLOGENY_GRAPHICS_TYPE.CIRCULAR ) ) {\r
-                label_direction_cbmi.setEnabled( false );\r
-            }\r
-            if ( tree_panel.getPhylogenyGraphicsType() == PHYLOGENY_GRAPHICS_TYPE.CIRCULAR ) {\r
-                scale.setSelected( false );\r
-                scale.setEnabled( false );\r
-            }\r
-        }\r
-    }\r
-\r
     static void updateScreenTextAntialias( final List<TreePanel> treepanels ) {\r
         for( final TreePanel tree_panel : treepanels ) {\r
             tree_panel.setTextAntialias();\r
index 389b626..9713b4f 100644 (file)
@@ -186,16 +186,16 @@ public final class MainFrameApplet extends MainFrame {
                         .setTextMinSupportMenuItem( _choose_minimal_confidence_mi, getOptions(), getCurrentTreePanel() );
                 MainFrame.setTextForFontChooserMenuItem( _choose_font_mi, createCurrentFontDesc( getMainPanel()
                         .getTreeFontSet() ) );
-                MainFrame.updateOptionsMenuDependingOnPhylogenyType( getMainPanel(),
-                                                                     _show_scale_cbmi,
-                                                                     _show_branch_length_values_cbmi,
-                                                                     _non_lined_up_cladograms_rbmi,
-                                                                     _uniform_cladograms_rbmi,
-                                                                     _ext_node_dependent_cladogram_rbmi,
-                                                                     _label_direction_cbmi );
                 MainFrame.setCycleNodeFillMenuItem( _cycle_node_fill_mi, getOptions() );
                 MainFrame.setCycleNodeShapeMenuItem( _cycle_node_shape_mi, getOptions() );
                 MainFrame.setTextNodeSizeMenuItem( _choose_node_size_mi, getOptions() );
+                try {
+                    getMainPanel().getControlPanel().setVisibilityOfDomainStrucureCB();
+                    getMainPanel().getControlPanel().setVisibilityOfX();
+                }
+                catch ( final Exception ignore ) {
+                    // do nothing, not important.
+                }
             }
         } );
         _options_jmenu.add( MainFrame.customizeMenuItemAsLabel( new JMenuItem( MainFrame.DISPLAY_SUBHEADER ),
index 6ad71f3..30721ca 100644 (file)
@@ -868,16 +868,16 @@ public final class MainFrameApplication extends MainFrame {
                         .createCurrentFontDesc( getMainPanel().getTreeFontSet() ) );\r
                 setTextForGraphicsSizeChooserMenuItem( _print_size_mi, getOptions() );\r
                 setTextForPdfLineWidthChooserMenuItem( _choose_pdf_width_mi, getOptions() );\r
-                MainFrame.updateOptionsMenuDependingOnPhylogenyType( getMainPanel(),\r
-                                                                     _show_scale_cbmi,\r
-                                                                     _show_branch_length_values_cbmi,\r
-                                                                     _non_lined_up_cladograms_rbmi,\r
-                                                                     _uniform_cladograms_rbmi,\r
-                                                                     _ext_node_dependent_cladogram_rbmi,\r
-                                                                     _label_direction_cbmi );\r
                 MainFrame.setCycleNodeFillMenuItem( _cycle_node_fill_mi, getOptions() );\r
                 MainFrame.setCycleNodeShapeMenuItem( _cycle_node_shape_mi, getOptions() );\r
                 MainFrame.setTextNodeSizeMenuItem( _choose_node_size_mi, getOptions() );\r
+                try {\r
+                    getMainPanel().getControlPanel().setVisibilityOfDomainStrucureCB();\r
+                    getMainPanel().getControlPanel().setVisibilityOfX();\r
+                }\r
+                catch ( final Exception ignore ) {\r
+                    // do nothing, not important.\r
+                }\r
             }\r
         } );\r
         _options_jmenu.add( customizeMenuItemAsLabel( new JMenuItem( DISPLAY_SUBHEADER ), getConfiguration() ) );\r