final class ControlPanel extends JPanel implements ActionListener {
- private static final String RETURN_TO_SUPER_TREE_TEXT = "Back to Super Tree";
+ final static Font jcb_bold_font = new Font( Configuration.getDefaultFontFamilyName(),
+ Font.BOLD,
+ 9 );
final static Font jcb_font = new Font( Configuration.getDefaultFontFamilyName(),
Font.PLAIN,
9 );
final static Font js_font = new Font( Configuration.getDefaultFontFamilyName(),
Font.PLAIN,
9 );
- final static Font jcb_bold_font = new Font( Configuration.getDefaultFontFamilyName(),
- Font.BOLD,
- 9 );
+ private static final String RETURN_TO_SUPER_TREE_TEXT = "Back to Super Tree";
private static final long serialVersionUID = -8463483932821545633L;
- private final MainPanel _mainpanel;
+ private NodeClickAction _action_when_node_clicked;
+ private int _add_new_node_item;
+ private Map<Integer, String> _all_click_to_names;
+ private Map<String, Color> _annotation_colors;
+ private int _blast_item;
+ private JComboBox _click_to_combobox;
+ private JLabel _click_to_label;
+ private List<String> _click_to_names;
+ private int _collapse_cb_item;
+ private JCheckBox _color_acc_species;
+ private JCheckBox _color_according_to_annotation;
+ private boolean _color_branches;
+ private JCheckBox _color_branches_cb;
+ private int _color_subtree_cb_item;
// The settings from the conf file
private final Configuration _configuration;
+ private int _copy_subtree_item;
+ private int _cut_subtree_item;
+ private JButton _decr_domain_structure_evalue_thr;
+ private int _delete_node_or_subtree_item;
+ private JCheckBox _display_as_phylogram_cb;
// Tree checkboxes
private JCheckBox _display_internal_data;
- private JCheckBox _show_node_names;
- private JCheckBox _show_taxo_code;
- private JCheckBox _write_confidence;
- private JCheckBox _show_events;
- private JCheckBox _color_acc_species;
- private JCheckBox _color_branches_cb;
- private JCheckBox _width_branches;
- private JCheckBox _show_domain_architectures;
+ private JLabel _domain_display_label;
+ private JTextField _domain_structure_evalue_thr_tf;
+ private List<Boolean> _draw_phylogram;
+ private JCheckBox _dynamically_hide_data;
+ private int _edit_node_data_item;
+ private int _get_ext_desc_data;
+ private JButton _incr_domain_structure_evalue_thr;
+ private final MainPanel _mainpanel;
+ private JCheckBox _node_desc_popup_cb;
+ private int _open_pdb_item;
+ private int _open_seq_web_item;
+ private int _open_tax_web_item;
+ private JButton _order;
+ private boolean _order_of_appearance;
+ private int _paste_subtree_item;
+ private int _reroot_cb_item;
+ private JButton _return_to_super_tree;
+ // Search
+ private JLabel _search_found_label_0;
+ private JLabel _search_found_label_1;
+ private JButton _search_reset_button_0;
+ private JButton _search_reset_button_1;
+ private JTextField _search_tf_0;
+ private JTextField _search_tf_1;
+ private int _select_nodes_item;
+ private Sequence _selected_query_seq;
+ private JCheckBox _seq_relation_confidence_switch;
+ private JComboBox _sequence_relation_type_box;
private JCheckBox _show_annotation;
- private JCheckBox _show_binary_characters;
private JCheckBox _show_binary_character_counts;
+ private JCheckBox _show_binary_characters;
+ // Indices for the click-to options in the combo box
+ private int _show_data_item;
+ private JCheckBox _show_domain_architectures;
+ private JCheckBox _show_events;
private JCheckBox _show_gene_names;
- private JCheckBox _show_gene_symbols;
+ private JCheckBox _show_node_names;
+ private JCheckBox _show_properties_cb;
+ private JCheckBox _show_seq_names;
+ private JCheckBox _show_seq_symbols;
private JCheckBox _show_sequence_acc;
- private JCheckBox _node_desc_popup_cb;
- private JCheckBox _dynamically_hide_data;
- private JCheckBox _show_taxo_scientific_names;
+ private JComboBox _show_sequence_relations;
+ private JCheckBox _show_taxo_code;
private JCheckBox _show_taxo_common_names;
private JCheckBox _show_taxo_images_cb;
- private JCheckBox _color_according_to_annotation;
- private JCheckBox _display_as_phylogram_cb;
- private JCheckBox _seq_relation_confidence_switch;
- private JComboBox _show_sequence_relations;
- private JComboBox _sequence_relation_type_box;
+ private JCheckBox _show_taxo_scientific_names;
private JCheckBox _show_vector_data_cb;
- private JCheckBox _show_properties_cb;
- private JLabel _click_to_label;
- private JLabel _zoom_label;
- private JLabel _domain_display_label;
- private JComboBox _click_to_combobox;
- private Map<Integer, String> _all_click_to_names;
- private List<String> _click_to_names;
- // Indices for the click-to options in the combo box
- private int _show_data_item;
- private int _collapse_cb_item;
- private int _reroot_cb_item;
- private int _swap_cb_item;
- private int _subtree_cb_item;
- private int _color_subtree_cb_item;
- private int _open_seq_web_item;
+ private JButton _show_whole;
private int _sort_descendents_item;
- private int _open_tax_web_item;
- private int _cut_subtree_item;
- private int _copy_subtree_item;
- private int _delete_node_or_subtree_item;
- private int _paste_subtree_item;
- private int _add_new_node_item;
- private int _edit_node_data_item;
- private int _select_nodes_item;
- private int _get_ext_desc_data;
- private int _blast_item;
+ private Map<String, Color> _species_colors;
+ private int _subtree_cb_item;
+ private int _swap_cb_item;
+ private JButton _uncollapse_all;
+ 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;
+ private JButton _zoom_out_domain_structure;
private JButton _zoom_out_x;
private JButton _zoom_out_y;
- private JButton _show_whole;
- private JButton _order;
- private JButton _uncollapse_all;
- private JButton _zoom_in_domain_structure;
- private JButton _zoom_out_domain_structure;
- private JButton _decr_domain_structure_evalue_thr;
- private JButton _incr_domain_structure_evalue_thr;
- private JButton _return_to_super_tree;
- private JTextField _domain_structure_evalue_thr_tf;
- private JTextField _search_tf;
- private boolean _order_of_appearance;
- private boolean _color_branches;
- private NodeClickAction _action_when_node_clicked;
- private List<Boolean> _draw_phylogram;
- private Map<String, Color> _annotation_colors;
- private Map<String, Color> _species_colors;
- private JButton _search_reset_button;
- private JLabel _search_found_label;
- private Sequence _selected_query_seq;
ControlPanel( final MainPanel ap, final Configuration configuration ) {
init();
displayedPhylogenyMightHaveChanged( true );
}
else if ( e.getSource() == _show_domain_architectures ) {
- search();
- displayedPhylogenyMightHaveChanged( false );
+ search0();
+ search1();
+ displayedPhylogenyMightHaveChanged( true );
}
else if ( ( tp != null ) && ( tp.getPhylogeny() != null ) ) {
if ( e.getSource() == getDisplayAsPhylogramCb() ) {
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() ) {
_mainpanel.getCurrentTreePanel().increaseDomainStructureEvalueThreshold();
displayedPhylogenyMightHaveChanged( true );
}
- else if ( e.getSource() == _search_tf ) {
- search();
+ else if ( e.getSource() == _search_tf_0 ) {
+ search0();
+ displayedPhylogenyMightHaveChanged( true );
+ }
+ else if ( e.getSource() == _search_tf_1 ) {
+ search1();
displayedPhylogenyMightHaveChanged( true );
}
else {
_return_to_super_tree.setEnabled( true );
}
- void showAnnotations() {
- _show_annotation.setSelected( true );
- _color_according_to_annotation.setSelected( true );
- _color_acc_species.setSelected( false );
- _mainpanel.getCurrentTreePanel().repaint();
- }
-
/**
* Add zoom and quick edit buttons. (Last modified 8/9/04)
*/
_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 ) );
}
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:
return getMainPanel().getOptions();
}
- JTextField getSearchTextField() {
- return _search_tf;
+ JLabel getSearchFoundCountsLabel0() {
+ return _search_found_label_0;
+ }
+
+ JLabel getSearchFoundCountsLabel1() {
+ return _search_found_label_1;
+ }
+
+ JButton getSearchResetButton0() {
+ return _search_reset_button_0;
+ }
+
+ JButton getSearchResetButton1() {
+ return _search_reset_button_1;
+ }
+
+ JTextField getSearchTextField0() {
+ return _search_tf_0;
+ }
+
+ JTextField getSearchTextField1() {
+ return _search_tf_1;
}
List<String> getSingleClickToNames() {
return ( ( _show_gene_names != null ) && _show_gene_names.isSelected() );
}
- boolean isShowGeneSymbols() {
- return ( ( _show_gene_symbols != null ) && _show_gene_symbols.isSelected() );
- }
-
boolean isShowInternalData() {
return ( ( _display_internal_data == null ) || _display_internal_data.isSelected() );
}
return ( ( _show_node_names != null ) && _show_node_names.isSelected() );
}
+ boolean isShowSeqNames() {
+ return ( ( _show_seq_names != null ) && _show_seq_names.isSelected() );
+ }
+
+ boolean isShowSeqSymbols() {
+ return ( ( _show_seq_symbols != null ) && _show_seq_symbols.isSelected() );
+ }
+
boolean isShowSequenceAcc() {
return ( ( _show_sequence_acc != null ) && _show_sequence_acc.isSelected() );
}
getIsDrawPhylogramList().remove( index );
}
- void search() {
+ void search0() {
final MainPanel main_panel = getMainPanel();
final Phylogeny tree = main_panel.getCurrentPhylogeny();
if ( ( tree == null ) || tree.isEmpty() ) {
return;
}
- String query = getSearchTextField().getText();
+ String query = getSearchTextField0().getText();
if ( query != null ) {
query = query.trim();
}
+ if ( !ForesterUtil.isEmpty( query ) ) {
+ search0( main_panel, tree, query );
+ }
else {
- getSearchFoundCountsLabel().setVisible( false );
- getSearchResetButton().setEnabled( false );
- getSearchResetButton().setVisible( false );
- searchReset();
+ getSearchFoundCountsLabel0().setVisible( false );
+ getSearchResetButton0().setEnabled( false );
+ getSearchResetButton0().setVisible( false );
+ searchReset0();
+ }
+ }
+
+ void search1() {
+ final MainPanel main_panel = getMainPanel();
+ final Phylogeny tree = main_panel.getCurrentPhylogeny();
+ if ( ( tree == null ) || tree.isEmpty() ) {
+ return;
+ }
+ String query = getSearchTextField1().getText();
+ if ( query != null ) {
+ query = query.trim();
}
if ( !ForesterUtil.isEmpty( query ) ) {
- search( main_panel, tree, query );
+ search1( main_panel, tree, query );
}
else {
- getSearchFoundCountsLabel().setVisible( false );
- getSearchResetButton().setEnabled( false );
- getSearchResetButton().setVisible( false );
- searchReset();
+ getSearchFoundCountsLabel1().setVisible( false );
+ getSearchResetButton1().setEnabled( false );
+ getSearchResetButton1().setVisible( false );
+ searchReset1();
+ }
+ }
+
+ void searchReset0() {
+ if ( getMainPanel().getCurrentTreePanel() != null ) {
+ getMainPanel().getCurrentTreePanel().setFoundNodes0( null );
+ }
+ }
+
+ void searchReset1() {
+ if ( getMainPanel().getCurrentTreePanel() != null ) {
+ getMainPanel().getCurrentTreePanel().setFoundNodes1( null );
}
}
_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:
else if ( action == _get_ext_desc_data ) {
setActionWhenNodeClicked( NodeClickAction.GET_EXT_DESC_DATA );
}
+ else if ( action == _open_pdb_item ) {
+ setActionWhenNodeClicked( NodeClickAction.OPEN_PDB_WEB );
+ }
else {
throw new RuntimeException( "unknown action: " + action );
}
// }
}
+ void setSearchFoundCountsOnLabel0( final int counts ) {
+ getSearchFoundCountsLabel0().setText( "Found: " + counts );
+ }
+
+ void setSearchFoundCountsOnLabel1( final int counts ) {
+ getSearchFoundCountsLabel1().setText( "Found: " + counts );
+ }
+
void setShowEvents( final boolean show_events ) {
if ( getShowEventsCb() == null ) {
_show_events = new JCheckBox( "" );
endClickToOptions();
// Zoom and quick edit buttons
addButtons();
- setupSearchTools();
+ setupSearchTools0();
+ setupSearchTools1();
}
void setUpControlsForDomainStrucures() {
addJButton( _incr_domain_structure_evalue_thr, d2_panel );
}
- void setupSearchTools() {
+ void setupSearchTools0() {
+ final String tip = "Enter text to search for. Use ',' for multiple searches (logical OR) and '+' for logical AND.";
+ final JLabel search_label = new JLabel( "Search (A):" );
+ search_label.setFont( ControlPanel.jcb_bold_font );
+ if ( !getConfiguration().isUseNativeUI() ) {
+ search_label.setForeground( getConfiguration().getGuiCheckboxTextColor() );
+ }
+ add( search_label );
+ search_label.setToolTipText( tip );
+ _search_found_label_0 = new JLabel();
+ getSearchFoundCountsLabel0().setVisible( false );
+ _search_found_label_0.setFont( ControlPanel.jcb_bold_font );
+ if ( !getConfiguration().isUseNativeUI() ) {
+ _search_found_label_0.setForeground( getConfiguration().getGuiCheckboxTextColor() );
+ }
+ _search_tf_0 = new JTextField( 3 );
+ _search_tf_0.setToolTipText( tip );
+ _search_tf_0.setEditable( true );
+ if ( !getConfiguration().isUseNativeUI() ) {
+ _search_tf_0.setForeground( getConfiguration().getGuiMenuBackgroundColor() );
+ _search_tf_0.setBackground( getConfiguration().getGuiCheckboxTextColor() );
+ _search_tf_0.setBorder( null );
+ }
+ _search_reset_button_0 = new JButton();
+ getSearchResetButton0().setText( "Reset" );
+ getSearchResetButton0().setEnabled( false );
+ getSearchResetButton0().setVisible( false );
+ final JPanel s_panel_1 = new JPanel( new BorderLayout() );
+ final JPanel s_panel_2 = new JPanel( new GridLayout( 1, 2, 0, 0 ) );
+ s_panel_1.setBackground( getBackground() );
+ add( s_panel_1 );
+ s_panel_2.setBackground( getBackground() );
+ add( s_panel_2 );
+ final KeyAdapter key_adapter = new KeyAdapter() {
+
+ @Override
+ public void keyReleased( final KeyEvent key_event ) {
+ search0();
+ displayedPhylogenyMightHaveChanged( true );
+ }
+ };
+ final ActionListener action_listener = new ActionListener() {
+
+ @Override
+ public void actionPerformed( final ActionEvent e ) {
+ searchReset0();
+ setSearchFoundCountsOnLabel0( 0 );
+ getSearchFoundCountsLabel0().setVisible( false );
+ getSearchTextField0().setText( "" );
+ getSearchResetButton0().setEnabled( false );
+ getSearchResetButton0().setVisible( false );
+ displayedPhylogenyMightHaveChanged( true );
+ }
+ };
+ _search_reset_button_0.addActionListener( action_listener );
+ _search_tf_0.addKeyListener( key_adapter );
+ addJTextField( _search_tf_0, s_panel_1 );
+ s_panel_2.add( _search_found_label_0 );
+ addJButton( _search_reset_button_0, s_panel_2 );
+ }
+
+ void setupSearchTools1() {
final String tip = "Enter text to search for. Use ',' for multiple searches (logical OR) and '+' for logical AND.";
- final JLabel search_label = new JLabel( "Search:" );
+ final JLabel search_label = new JLabel( "Search (B):" );
search_label.setFont( ControlPanel.jcb_bold_font );
if ( !getConfiguration().isUseNativeUI() ) {
search_label.setForeground( getConfiguration().getGuiCheckboxTextColor() );
}
add( search_label );
search_label.setToolTipText( tip );
- _search_found_label = new JLabel();
- getSearchFoundCountsLabel().setVisible( false );
- _search_found_label.setFont( ControlPanel.jcb_bold_font );
+ _search_found_label_1 = new JLabel();
+ getSearchFoundCountsLabel1().setVisible( false );
+ _search_found_label_1.setFont( ControlPanel.jcb_bold_font );
if ( !getConfiguration().isUseNativeUI() ) {
- _search_found_label.setForeground( getConfiguration().getGuiCheckboxTextColor() );
+ _search_found_label_1.setForeground( getConfiguration().getGuiCheckboxTextColor() );
}
- _search_tf = new JTextField( 3 );
- _search_tf.setToolTipText( tip );
- _search_tf.setEditable( true );
+ _search_tf_1 = new JTextField( 3 );
+ _search_tf_1.setToolTipText( tip );
+ _search_tf_1.setEditable( true );
if ( !getConfiguration().isUseNativeUI() ) {
- _search_tf.setForeground( getConfiguration().getGuiMenuBackgroundColor() );
- _search_tf.setBackground( getConfiguration().getGuiCheckboxTextColor() );
- _search_tf.setBorder( null );
- }
- _search_reset_button = new JButton();
- getSearchResetButton().setText( "Reset" );
- getSearchResetButton().setEnabled( false );
- getSearchResetButton().setVisible( false );
+ _search_tf_1.setForeground( getConfiguration().getGuiMenuBackgroundColor() );
+ _search_tf_1.setBackground( getConfiguration().getGuiCheckboxTextColor() );
+ _search_tf_1.setBorder( null );
+ }
+ _search_reset_button_1 = new JButton();
+ getSearchResetButton1().setText( "Reset" );
+ getSearchResetButton1().setEnabled( false );
+ getSearchResetButton1().setVisible( false );
final JPanel s_panel_1 = new JPanel( new BorderLayout() );
final JPanel s_panel_2 = new JPanel( new GridLayout( 1, 2, 0, 0 ) );
s_panel_1.setBackground( getBackground() );
@Override
public void keyReleased( final KeyEvent key_event ) {
- search();
+ search1();
displayedPhylogenyMightHaveChanged( true );
}
};
@Override
public void actionPerformed( final ActionEvent e ) {
- searchReset();
- setSearchFoundCountsOnLabel( 0 );
- getSearchFoundCountsLabel().setVisible( false );
- getSearchTextField().setText( "" );
- getSearchResetButton().setEnabled( false );
- getSearchResetButton().setVisible( false );
+ searchReset1();
+ setSearchFoundCountsOnLabel1( 0 );
+ getSearchFoundCountsLabel1().setVisible( false );
+ getSearchTextField1().setText( "" );
+ getSearchResetButton1().setEnabled( false );
+ getSearchResetButton1().setVisible( false );
displayedPhylogenyMightHaveChanged( true );
}
};
- _search_reset_button.addActionListener( action_listener );
- _search_tf.addKeyListener( key_adapter );
- addJTextField( _search_tf, s_panel_1 );
- s_panel_2.add( _search_found_label );
- addJButton( _search_reset_button, s_panel_2 );
+ _search_reset_button_1.addActionListener( action_listener );
+ _search_tf_1.addKeyListener( key_adapter );
+ addJTextField( _search_tf_1, s_panel_1 );
+ s_panel_2.add( _search_found_label_1 );
+ addJButton( _search_reset_button_1, s_panel_2 );
+ }
+
+ void showAnnotations() {
+ 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();
}
/**
.getPhylogenyGraphicsType() );
}
getMainPanel().getCurrentTreePanel().updateSubSuperTreeButton();
- getMainPanel().getControlPanel().search();
+ getMainPanel().getControlPanel().search0();
+ getMainPanel().getControlPanel().search1();
+ getMainPanel().getControlPanel().updateDomainStructureEvaluethresholdDisplay();
getSequenceRelationTypeBox().removeAllItems();
for( final SequenceRelation.SEQUENCE_RELATION_TYPE type : getMainPanel().getCurrentPhylogeny()
.getRelevantSequenceRelationTypes() ) {
_sequence_relation_type_box.addItem( type );
}
+ getMainPanel().getCurrentTreePanel().repaint();
//setSequenceRelationQueries( getMainPanel().getCurrentPhylogeny().getSequenceRelationQueries() );
// according to GUILHEM the line above can be removed.
}
return _draw_phylogram;
}
- JLabel getSearchFoundCountsLabel() {
- return _search_found_label;
- }
-
- JButton getSearchResetButton() {
- return _search_reset_button;
- }
-
private void init() {
_draw_phylogram = new ArrayList<Boolean>();
setSpeciesColors( new HashMap<String, Color>() );
return getIsDrawPhylogramList().get( index );
}
- private void search( final MainPanel main_panel, final Phylogeny tree, final String query_str ) {
- getSearchFoundCountsLabel().setVisible( true );
- getSearchResetButton().setEnabled( true );
- getSearchResetButton().setVisible( true );
+ private void search0( final MainPanel main_panel, final Phylogeny tree, final String query_str ) {
+ getSearchFoundCountsLabel0().setVisible( true );
+ getSearchResetButton0().setEnabled( true );
+ getSearchResetButton0().setVisible( true );
String[] queries = null;
List<PhylogenyNode> nodes = null;
if ( query_str.indexOf( ',' ) >= 0 ) {
}
}
if ( ( nodes != null ) && ( nodes.size() > 0 ) ) {
- main_panel.getCurrentTreePanel().setFoundNodes( new HashSet<Integer>() );
+ main_panel.getCurrentTreePanel().setFoundNodes0( new HashSet<Long>() );
for( final PhylogenyNode node : nodes ) {
- main_panel.getCurrentTreePanel().getFoundNodes().add( node.getId() );
+ main_panel.getCurrentTreePanel().getFoundNodes0().add( node.getId() );
}
- setSearchFoundCountsOnLabel( nodes.size() );
+ setSearchFoundCountsOnLabel0( nodes.size() );
}
else {
- setSearchFoundCountsOnLabel( 0 );
- searchReset();
+ setSearchFoundCountsOnLabel0( 0 );
+ searchReset0();
}
}
- void searchReset() {
- if ( getMainPanel().getCurrentTreePanel() != null ) {
- getMainPanel().getCurrentTreePanel().setFoundNodes( null );
+ private void search1( final MainPanel main_panel, final Phylogeny tree, final String query_str ) {
+ getSearchFoundCountsLabel1().setVisible( true );
+ getSearchResetButton1().setEnabled( true );
+ getSearchResetButton1().setVisible( true );
+ String[] queries = null;
+ List<PhylogenyNode> nodes = null;
+ if ( query_str.indexOf( ',' ) >= 0 ) {
+ queries = query_str.split( ",+" );
+ }
+ else {
+ queries = new String[ 1 ];
+ queries[ 0 ] = query_str.trim();
+ }
+ if ( ( queries != null ) && ( queries.length > 0 ) ) {
+ nodes = new ArrayList<PhylogenyNode>();
+ for( String query : queries ) {
+ if ( ForesterUtil.isEmpty( query ) ) {
+ continue;
+ }
+ query = query.trim();
+ if ( query.indexOf( '+' ) >= 0 ) {
+ nodes.addAll( PhylogenyMethods.searchDataLogicalAnd( query.split( "\\++" ),
+ tree,
+ getOptions().isSearchCaseSensitive(),
+ !getOptions().isMatchWholeTermsOnly(),
+ isShowDomainArchitectures() ) );
+ }
+ else {
+ nodes.addAll( PhylogenyMethods.searchData( query,
+ tree,
+ getOptions().isSearchCaseSensitive(),
+ !getOptions().isMatchWholeTermsOnly(),
+ isShowDomainArchitectures() ) );
+ }
+ }
+ if ( getOptions().isInverseSearchResult() ) {
+ final List<PhylogenyNode> all = PhylogenyMethods.obtainAllNodesAsList( tree );
+ all.removeAll( nodes );
+ nodes = all;
+ }
+ }
+ if ( ( nodes != null ) && ( nodes.size() > 0 ) ) {
+ main_panel.getCurrentTreePanel().setFoundNodes1( new HashSet<Long>() );
+ for( final PhylogenyNode node : nodes ) {
+ main_panel.getCurrentTreePanel().getFoundNodes1().add( node.getId() );
+ }
+ setSearchFoundCountsOnLabel1( nodes.size() );
+ }
+ else {
+ setSearchFoundCountsOnLabel1( 0 );
+ searchReset1();
}
}
getIsDrawPhylogramList().set( index, b );
}
- void setSearchFoundCountsOnLabel( final int counts ) {
- getSearchFoundCountsLabel().setText( "Found: " + counts );
- }
-
private void setupClickToOptions() {
final int default_option = _configuration.getDefaultDisplayClicktoOption();
int selected_index = 0;
}
cb_index++;
}
+ if ( _configuration.doDisplayClickToOption( Configuration.open_pdb_web ) ) {
+ _open_pdb_item = cb_index;
+ addClickToOption( Configuration.open_pdb_web, _configuration.getClickToTitle( Configuration.open_pdb_web ) );
+ if ( default_option == Configuration.open_pdb_web ) {
+ selected_index = cb_index;
+ }
+ cb_index++;
+ }
if ( _configuration.doDisplayClickToOption( Configuration.open_tax_web ) ) {
_open_tax_web_item = cb_index;
addClickToOption( Configuration.open_tax_web, _configuration.getClickToTitle( Configuration.open_tax_web ) );
}
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() ) ) {
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;
}
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 );
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 ) );
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() {
}
enum NodeClickAction {
- SHOW_DATA,
+ ADD_NEW_NODE,
+ BLAST,
COLLAPSE,
- REROOT,
- SUBTREE,
- SWAP,
COLOR_SUBTREE,
- OPEN_TAX_WEB,
- OPEN_SEQ_WEB,
- CUT_SUBTREE,
COPY_SUBTREE,
+ CUT_SUBTREE,
DELETE_NODE_OR_SUBTREE,
- PASTE_SUBTREE,
- ADD_NEW_NODE,
EDIT_NODE_DATA,
+ GET_EXT_DESC_DATA,
+ OPEN_PDB_WEB,
+ OPEN_SEQ_WEB,
+ OPEN_TAX_WEB,
+ PASTE_SUBTREE,
+ REROOT,
SELECT_NODES,
+ SHOW_DATA,
SORT_DESCENDENTS,
- GET_EXT_DESC_DATA,
- BLAST;
+ SUBTREE,
+ SWAP;
}
}