inprogress
[jalview.git] / forester / java / src / org / forester / archaeopteryx / ControlPanel.java
index 7c338cb..7586722 100644 (file)
@@ -97,8 +97,9 @@ final class ControlPanel extends JPanel implements ActionListener {
     private JCheckBox            _show_annotation;
     private JCheckBox            _show_binary_characters;
     private JCheckBox            _show_binary_character_counts;
+    private JCheckBox            _show_seq_names;
+    private JCheckBox            _show_seq_symbols;
     private JCheckBox            _show_gene_names;
-    private JCheckBox            _show_gene_symbols;
     private JCheckBox            _show_sequence_acc;
     private JCheckBox            _node_desc_popup_cb;
     private JCheckBox            _dynamically_hide_data;
@@ -237,7 +238,7 @@ final class ControlPanel extends JPanel implements ActionListener {
                 else if ( e.getSource() == _order ) {
                     DESCENDANT_SORT_PRIORITY pri = DESCENDANT_SORT_PRIORITY.TAXONOMY;
                     if ( ( !isShowTaxonomyScientificNames() && !isShowTaxonomyCode() && !isShowTaxonomyCommonNames() ) ) {
-                        if ( ( isShowSequenceAcc() || isShowGeneNames() || isShowGeneSymbols() ) ) {
+                        if ( ( isShowSequenceAcc() || isShowSeqNames() || isShowSeqSymbols() ) ) {
                             pri = DESCENDANT_SORT_PRIORITY.SEQUENCE;
                         }
                         else if ( isShowNodeNames() ) {
@@ -433,9 +434,15 @@ final class ControlPanel extends JPanel implements ActionListener {
     }
 
     void showAnnotations() {
-        _show_annotation.setSelected( true );
-        _color_according_to_annotation.setSelected( true );
-        _color_acc_species.setSelected( false );
+        if ( _show_annotation != null ) {
+            _show_annotation.setSelected( true );
+        }
+        if ( _color_according_to_annotation != null ) {
+            _color_according_to_annotation.setSelected( true );
+        }
+        if ( _color_acc_species != null ) {
+            _color_acc_species.setSelected( false );
+        }
         _mainpanel.getCurrentTreePanel().repaint();
     }
 
@@ -470,12 +477,12 @@ final class ControlPanel extends JPanel implements ActionListener {
         _zoom_in_y = new JButton( "Y+" );
         _zoom_out_y = new JButton( "Y-" );
         _show_whole = new JButton( "F" );
-        _show_whole.setToolTipText( "To fit the complete phylogeny to the current display size [Backspace]" );
-        _zoom_in_x.setToolTipText( "To zoom in horizontally [Shift+Right]" );
-        _zoom_in_y.setToolTipText( "To zoom in vertically [Shift+Up]" );
-        _zoom_out_x.setToolTipText( "To zoom out horizontally [Shift+Left]" );
-        _zoom_out_y.setToolTipText( "To zoom out vertically [Shift+Down]" );
-        if ( getConfiguration().isUseNativeUI() && AptxUtil.isMac() ) {
+        _show_whole.setToolTipText( "To fit the complete phylogeny to the current display size [F or Home]" );
+        _zoom_in_x.setToolTipText( "To zoom in horizontally [Shift+cursor-right]" );
+        _zoom_in_y.setToolTipText( "To zoom in vertically [Shift+cursor-up]" );
+        _zoom_out_x.setToolTipText( "To zoom out horizontally [Shift+cursor-left]" );
+        _zoom_out_y.setToolTipText( "To zoom out vertically [Shift+cursor-down]" );
+        if ( getConfiguration().isUseNativeUI() && ForesterUtil.isMac() ) {
             _zoom_out_x.setPreferredSize( new Dimension( 55, 10 ) );
             _zoom_in_x.setPreferredSize( new Dimension( 55, 10 ) );
         }
@@ -604,14 +611,19 @@ final class ControlPanel extends JPanel implements ActionListener {
                 addJCheckBox( _show_domain_architectures, ch_panel );
                 add( ch_panel );
                 break;
+            case Configuration.show_seq_names:
+                _show_seq_names = new JCheckBox( title );
+                addJCheckBox( _show_seq_names, ch_panel );
+                add( ch_panel );
+                break;
             case Configuration.show_gene_names:
                 _show_gene_names = new JCheckBox( title );
                 addJCheckBox( _show_gene_names, ch_panel );
                 add( ch_panel );
                 break;
-            case Configuration.show_gene_symbols:
-                _show_gene_symbols = new JCheckBox( title );
-                addJCheckBox( _show_gene_symbols, ch_panel );
+            case Configuration.show_seq_symbols:
+                _show_seq_symbols = new JCheckBox( title );
+                addJCheckBox( _show_seq_symbols, ch_panel );
                 add( ch_panel );
                 break;
             case Configuration.show_sequence_acc:
@@ -811,12 +823,12 @@ final class ControlPanel extends JPanel implements ActionListener {
         return ( ( _show_domain_architectures != null ) && _show_domain_architectures.isSelected() );
     }
 
-    boolean isShowGeneNames() {
-        return ( ( _show_gene_names != null ) && _show_gene_names.isSelected() );
+    boolean isShowSeqNames() {
+        return ( ( _show_seq_names != null ) && _show_seq_names.isSelected() );
     }
 
-    boolean isShowGeneSymbols() {
-        return ( ( _show_gene_symbols != null ) && _show_gene_symbols.isSelected() );
+    boolean isShowSeqSymbols() {
+        return ( ( _show_seq_symbols != null ) && _show_seq_symbols.isSelected() );
     }
 
     boolean isShowInternalData() {
@@ -831,6 +843,10 @@ final class ControlPanel extends JPanel implements ActionListener {
         return ( ( _show_sequence_acc != null ) && _show_sequence_acc.isSelected() );
     }
 
+    boolean isShowGeneNames() {
+        return ( ( _show_gene_names != null ) && _show_gene_names.isSelected() );
+    }
+
     boolean isShowSequenceRelationConfidence() {
         return ( ( _seq_relation_confidence_switch != null ) && ( _seq_relation_confidence_switch.isSelected() ) );
     }
@@ -985,14 +1001,19 @@ final class ControlPanel extends JPanel implements ActionListener {
                     _show_domain_architectures.setSelected( state );
                 }
                 break;
+            case Configuration.show_seq_names:
+                if ( _show_seq_names != null ) {
+                    _show_seq_names.setSelected( state );
+                }
+                break;
             case Configuration.show_gene_names:
                 if ( _show_gene_names != null ) {
                     _show_gene_names.setSelected( state );
                 }
                 break;
-            case Configuration.show_gene_symbols:
-                if ( _show_gene_symbols != null ) {
-                    _show_gene_symbols.setSelected( state );
+            case Configuration.show_seq_symbols:
+                if ( _show_seq_symbols != null ) {
+                    _show_seq_symbols.setSelected( state );
                 }
                 break;
             case Configuration.show_vector_data:
@@ -1615,7 +1636,7 @@ final class ControlPanel extends JPanel implements ActionListener {
             }
         }
         if ( ( nodes != null ) && ( nodes.size() > 0 ) ) {
-            main_panel.getCurrentTreePanel().setFoundNodes( new HashSet<Integer>() );
+            main_panel.getCurrentTreePanel().setFoundNodes( new HashSet<Long>() );
             for( final PhylogenyNode node : nodes ) {
                 main_panel.getCurrentTreePanel().getFoundNodes().add( node.getId() );
             }
@@ -1728,6 +1749,14 @@ final class ControlPanel extends JPanel implements ActionListener {
             }
             cb_index++;
         }
+        if ( _configuration.doDisplayClickToOption( Configuration.select_nodes ) ) {
+            _select_nodes_item = cb_index;
+            addClickToOption( Configuration.select_nodes, _configuration.getClickToTitle( Configuration.select_nodes ) );
+            if ( default_option == Configuration.select_nodes ) {
+                selected_index = cb_index;
+            }
+            cb_index++;
+        }
         if ( _configuration.doDisplayClickToOption( Configuration.get_ext_desc_data ) ) {
             _get_ext_desc_data = cb_index;
             if ( !ForesterUtil.isEmpty( getConfiguration().getLabelForGetExtDescendentsData() ) ) {
@@ -1746,15 +1775,24 @@ final class ControlPanel extends JPanel implements ActionListener {
                     case SEQUENCE_MOL_SEQ:
                         s = "Molecular Sequence";
                         break;
+                    case SEQUENCE_MOL_SEQ_FASTA:
+                        s = "Molecular Sequence (Fasta)";
+                        break;
                     case SEQUENCE_NAME:
                         s = "Sequence Names";
                         break;
+                    case GENE_NAME:
+                        s = "Gene Names";
+                        break;
                     case SEQUENCE_SYMBOL:
                         s = "Sequence Symbols";
                         break;
                     case TAXONOMY_CODE:
                         s = "Taxonomy Codes";
                         break;
+                    case TAXONOMY_COMM0N_NAME:
+                        s = "Taxonomy Common Names";
+                        break;
                     case TAXONOMY_SCIENTIFIC_NAME:
                         s = "Scientific Names";
                         break;
@@ -1824,15 +1862,6 @@ final class ControlPanel extends JPanel implements ActionListener {
                 }
                 cb_index++;
             }
-            if ( _configuration.doDisplayClickToOption( Configuration.select_nodes ) ) {
-                _select_nodes_item = cb_index;
-                addClickToOption( Configuration.select_nodes,
-                                  _configuration.getClickToTitle( Configuration.select_nodes ) );
-                if ( default_option == Configuration.select_nodes ) {
-                    selected_index = cb_index;
-                }
-                cb_index++;
-            }
         }
         // Set default selection and its action
         _click_to_combobox.setSelectedIndex( selected_index );
@@ -1908,22 +1937,19 @@ final class ControlPanel extends JPanel implements ActionListener {
             setCheckbox( Configuration.show_taxonomy_common_names,
                          _configuration.doCheckOption( Configuration.show_taxonomy_common_names ) );
         }
-        if ( _configuration.doDisplayOption( Configuration.show_taxonomy_images ) ) {
-            addCheckbox( Configuration.show_taxonomy_images,
-                         _configuration.getDisplayTitle( Configuration.show_taxonomy_images ) );
-            setCheckbox( Configuration.show_taxonomy_images,
-                         _configuration.doCheckOption( Configuration.show_taxonomy_images ) );
-        }
-        if ( _configuration.doDisplayOption( Configuration.show_gene_symbols ) ) {
-            addCheckbox( Configuration.show_gene_symbols,
-                         _configuration.getDisplayTitle( Configuration.show_gene_symbols ) );
-            setCheckbox( Configuration.show_gene_symbols,
-                         _configuration.doCheckOption( Configuration.show_gene_symbols ) );
+        if ( _configuration.doDisplayOption( Configuration.show_seq_names ) ) {
+            addCheckbox( Configuration.show_seq_names, _configuration.getDisplayTitle( Configuration.show_seq_names ) );
+            setCheckbox( Configuration.show_seq_names, _configuration.doCheckOption( Configuration.show_seq_names ) );
         }
         if ( _configuration.doDisplayOption( Configuration.show_gene_names ) ) {
             addCheckbox( Configuration.show_gene_names, _configuration.getDisplayTitle( Configuration.show_gene_names ) );
             setCheckbox( Configuration.show_gene_names, _configuration.doCheckOption( Configuration.show_gene_names ) );
         }
+        if ( _configuration.doDisplayOption( Configuration.show_seq_symbols ) ) {
+            addCheckbox( Configuration.show_seq_symbols,
+                         _configuration.getDisplayTitle( Configuration.show_seq_symbols ) );
+            setCheckbox( Configuration.show_seq_symbols, _configuration.doCheckOption( Configuration.show_seq_symbols ) );
+        }
         if ( _configuration.doDisplayOption( Configuration.show_sequence_acc ) ) {
             addCheckbox( Configuration.show_sequence_acc,
                          _configuration.getDisplayTitle( Configuration.show_sequence_acc ) );
@@ -1971,6 +1997,12 @@ final class ControlPanel extends JPanel implements ActionListener {
             addCheckbox( Configuration.show_properties, _configuration.getDisplayTitle( Configuration.show_properties ) );
             setCheckbox( Configuration.show_properties, _configuration.doCheckOption( Configuration.show_properties ) );
         }
+        if ( _configuration.doDisplayOption( Configuration.show_taxonomy_images ) ) {
+            addCheckbox( Configuration.show_taxonomy_images,
+                         _configuration.getDisplayTitle( Configuration.show_taxonomy_images ) );
+            setCheckbox( Configuration.show_taxonomy_images,
+                         _configuration.doCheckOption( Configuration.show_taxonomy_images ) );
+        }
     }
 
     private void setVisibilityOfDomainStrucureControls() {