- void addCheckbox( final int which, final String title ) {
- final JPanel ch_panel = new JPanel( new BorderLayout( 0, 0 ) );
- switch ( which ) {
- case Configuration.display_as_phylogram:
- _display_as_phylogram_cb = new JCheckBox( title );
- getDisplayAsPhylogramCb().setToolTipText( "To switch between phylogram and cladogram display" );
- addJCheckBox( getDisplayAsPhylogramCb(), ch_panel );
- add( ch_panel );
- break;
- case Configuration.display_internal_data:
- _display_internal_data = new JCheckBox( title );
- _display_internal_data.setToolTipText( "To allow or disallow display of internal labels" );
- addJCheckBox( _display_internal_data, ch_panel );
- add( ch_panel );
- break;
- case Configuration.color_according_to_species:
- _color_acc_species = new JCheckBox( title );
- _color_acc_species.setToolTipText( "To colorize node labels as a function of taxonomy" );
- addJCheckBox( _color_acc_species, ch_panel );
- add( ch_panel );
- break;
- case Configuration.color_according_to_sequence:
- _color_acc_sequence = new JCheckBox( title );
- _color_acc_sequence.setToolTipText( "To colorize node labels as a function of sequence name" );
- addJCheckBox( _color_acc_sequence, ch_panel );
- add( ch_panel );
- break;
- case Configuration.color_according_to_annotation:
- _color_according_to_annotation = new JCheckBox( title );
- _color_according_to_annotation
- .setToolTipText( "To colorize sequence annotation labels as a function of sequence annotation" );
- addJCheckBox( _color_according_to_annotation, ch_panel );
- add( ch_panel );
- break;
- case Configuration.show_node_names:
- _show_node_names = new JCheckBox( title );
- addJCheckBox( _show_node_names, ch_panel );
- add( ch_panel );
- break;
- case Configuration.show_taxonomy_scientific_names:
- _show_taxo_scientific_names = new JCheckBox( title );
- addJCheckBox( _show_taxo_scientific_names, ch_panel );
- add( ch_panel );
- break;
- case Configuration.show_taxonomy_common_names:
- _show_taxo_common_names = new JCheckBox( title );
- addJCheckBox( _show_taxo_common_names, ch_panel );
- add( ch_panel );
- break;
- case Configuration.show_tax_code:
- _show_taxo_code = new JCheckBox( title );
- addJCheckBox( _show_taxo_code, ch_panel );
- add( ch_panel );
- break;
- case Configuration.show_taxonomy_images:
- _show_taxo_images_cb = new JCheckBox( title );
- addJCheckBox( _show_taxo_images_cb, ch_panel );
- add( ch_panel );
- break;
- case Configuration.show_binary_characters:
- _show_binary_characters = new JCheckBox( title );
- addJCheckBox( _show_binary_characters, ch_panel );
- add( ch_panel );
- break;
- case Configuration.show_annotation:
- _show_annotation = new JCheckBox( title );
- addJCheckBox( _show_annotation, ch_panel );
- add( ch_panel );
- break;
- case Configuration.show_binary_character_counts:
- _show_binary_character_counts = new JCheckBox( title );
- addJCheckBox( _show_binary_character_counts, ch_panel );
- add( ch_panel );
- break;
- case Configuration.write_confidence_values:
- _write_confidence = new JCheckBox( title );
- addJCheckBox( getWriteConfidenceCb(), ch_panel );
- add( ch_panel );
- break;
- case Configuration.write_events:
- _show_events = new JCheckBox( title );
- addJCheckBox( getShowEventsCb(), ch_panel );
- add( ch_panel );
- break;
- case Configuration.use_style:
- _use_visual_styles_cb = new JCheckBox( title );
- getUseVisualStylesCb()
- .setToolTipText( "To use visual styles (node colors, fonts) and branch colors, if present" );
- addJCheckBox( getUseVisualStylesCb(), ch_panel );
- add( ch_panel );
- break;
- case Configuration.width_branches:
- _width_branches = new JCheckBox( title );
- _width_branches.setToolTipText( "To use branch width values, if present" );
- addJCheckBox( _width_branches, ch_panel );
- add( ch_panel );
- break;
- case Configuration.show_domain_architectures:
- _show_domain_architectures = new JCheckBox( title );
- 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_seq_symbols:
- _show_seq_symbols = new JCheckBox( title );
- addJCheckBox( _show_seq_symbols, ch_panel );
- add( ch_panel );
- break;
- case Configuration.show_sequence_acc:
- _show_sequence_acc = new JCheckBox( title );
- addJCheckBox( _show_sequence_acc, ch_panel );
- add( ch_panel );
- break;
- case Configuration.dynamically_hide_data:
- _dynamically_hide_data = new JCheckBox( title );
- getDynamicallyHideData().setToolTipText( "To hide labels depending on expected visibility" );
- addJCheckBox( getDynamicallyHideData(), ch_panel );
- add( ch_panel );
- break;
- case Configuration.node_data_popup:
- _node_desc_popup_cb = new JCheckBox( title );
- getNodeDescPopupCb().setToolTipText( "To enable mouse rollover display of basic node data" );
- addJCheckBox( getNodeDescPopupCb(), ch_panel );
- add( ch_panel );
- break;
- case Configuration.show_relation_confidence:
- _seq_relation_confidence_switch = new JCheckBox( title );
- addJCheckBox( _seq_relation_confidence_switch, ch_panel );
- add( ch_panel );
- break;
- case Configuration.show_vector_data:
- _show_vector_data_cb = new JCheckBox( title );
- addJCheckBox( _show_vector_data_cb, ch_panel );
- add( ch_panel );
- break;
- case Configuration.show_properties:
- _show_properties_cb = new JCheckBox( title );
- addJCheckBox( _show_properties_cb, ch_panel );
- add( ch_panel );
- break;
- default:
- throw new RuntimeException( "unknown checkbox: " + which );
- }
- }// addCheckbox
-
- void addJButton( final JButton jb, final JPanel p ) {
- jb.setFocusPainted( false );
- jb.setFont( ControlPanel.jcb_font );
- if ( !_configuration.isUseNativeUI() ) {
- jb.setBorder( BorderFactory.createLineBorder( getConfiguration().getGuiButtonBorderColor() ) );
- jb.setBackground( getConfiguration().getGuiButtonBackgroundColor() );
- jb.setForeground( getConfiguration().getGuiButtonTextColor() );
- }
- p.add( jb );
- jb.addActionListener( this );
- }
-
- void addJCheckBox( final JCheckBox jcb, final JPanel p ) {
- jcb.setFocusPainted( false );
- jcb.setFont( ControlPanel.jcb_font );
- if ( !_configuration.isUseNativeUI() ) {
- jcb.setBackground( getConfiguration().getGuiBackgroundColor() );
- jcb.setForeground( getConfiguration().getGuiCheckboxTextColor() );
- }
- p.add( jcb, "Center" );
- jcb.addActionListener( this );
- }
-
- void addJTextField( final JTextField tf, final JPanel p ) {
- if ( !_configuration.isUseNativeUI() ) {
- tf.setForeground( getConfiguration().getGuiBackgroundColor() );
- tf.setFont( ControlPanel.jcb_font );
- }
- p.add( tf );
- tf.addActionListener( this );
- }
-
- void deactivateButtonToReturnToSuperTree() {
- _return_to_super_tree.setText( RETURN_TO_SUPER_TREE_TEXT );
- _return_to_super_tree.setForeground( getConfiguration().getGuiButtonTextColor() );
- _return_to_super_tree.setEnabled( false );
- }
-
- void displayedPhylogenyMightHaveChanged( final boolean recalc_longest_ext_node_info ) {
- if ( ( _mainpanel != null )
- && ( ( _mainpanel.getCurrentPhylogeny() != null ) && !_mainpanel.getCurrentPhylogeny().isEmpty() ) ) {
- if ( getOptions().isShowOverview() ) {
- _mainpanel.getCurrentTreePanel().updateOvSizes();
- }
- _mainpanel.getCurrentTreePanel().recalculateMaxDistanceToRoot();
- setVisibilityOfDomainStrucureControls();
- updateDomainStructureEvaluethresholdDisplay();
- _mainpanel.getCurrentTreePanel().calculateScaleDistance();
- _mainpanel.getCurrentTreePanel().calcMaxDepth();
- _mainpanel.adjustJScrollPane();
- if ( recalc_longest_ext_node_info ) {
- _mainpanel.getCurrentTreePanel().initNodeData();
- _mainpanel.getCurrentTreePanel().calculateLongestExtNodeInfo();
- }
- _mainpanel.getCurrentTreePanel().repaint();
- // _mainpanel.getCurrentTreePanel().setUpUrtFactors();
- }
- }
-
- void endClickToOptions() {
- _click_to_combobox.addActionListener( this );
- }
-
- /**
- * Indicates what action should be execute when a node is clicked
- *
- * @return the click-on action
- */
- NodeClickAction getActionWhenNodeClicked() {
- return _action_when_node_clicked;
- }
-
- Map<Integer, String> getAllClickToItems() {
- return _all_click_to_names;
- }
-
- Map<String, Color> getAnnotationColors() {
- return _annotation_colors;
- }
-
- Configuration getConfiguration() {
- return _configuration;
- }
-
- TreePanel getCurrentTreePanel() {
- return getMainPanel().getCurrentTreePanel();
- }
-
- MainPanel getMainPanel() {
- return _mainpanel;
- }
-
- Options getOptions() {
- return getMainPanel().getOptions();
- }
-
- 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 _click_to_names;
- }
-
- Map<String, Color> getSpeciesColors() {
- return _species_colors;
- }
-
- Map<String, Color> getSequenceColors() {
- return _sequence_colors;
- }
-
- boolean isAntialiasScreenText() {
- return true;
- }
-
- boolean isColorAccordingToAnnotation() {
- return ( ( _color_according_to_annotation != null ) && _color_according_to_annotation.isSelected() );
- }
-
- boolean isColorAccordingToTaxonomy() {
- return ( ( _color_acc_species != null ) && _color_acc_species.isSelected() );
- }
-
- boolean isColorAccordingToSequence() {
- return ( ( _color_acc_sequence != null ) && _color_acc_sequence.isSelected() );
- }
-
- boolean isUseVisualStyles() {
- return ( ( ( getUseVisualStylesCb() != null ) && getUseVisualStylesCb().isSelected() ) || ( ( getUseVisualStylesCb() == null ) && _color_branches ) );
- }
-
- boolean isDrawPhylogram() {
- return isDrawPhylogram( getMainPanel().getCurrentTabIndex() );
- }
-
- boolean isDynamicallyHideData() {
- return ( ( getDynamicallyHideData() != null ) && getDynamicallyHideData().isSelected() );
- }
-
- boolean isEvents() {
- return ( ( getShowEventsCb() != null ) && getShowEventsCb().isSelected() );
- }
-
- boolean isNodeDescPopup() {
- return ( ( getNodeDescPopupCb() != null ) && getNodeDescPopupCb().isSelected() );
- }
-
- boolean isShowAnnotation() {
- return ( ( _show_annotation != null ) && _show_annotation.isSelected() );
- }
-
- boolean isShowBinaryCharacterCounts() {
- return ( ( _show_binary_character_counts != null ) && _show_binary_character_counts.isSelected() );
- }
-
- boolean isShowBinaryCharacters() {
- return ( ( _show_binary_characters != null ) && _show_binary_characters.isSelected() );
- }
-
- boolean isShowConfidenceValues() {
- return ( ( getWriteConfidenceCb() != null ) && getWriteConfidenceCb().isSelected() );
- }
-
- boolean isShowDomainArchitectures() {
- return ( ( _show_domain_architectures != null ) && _show_domain_architectures.isSelected() );
- }
-
- boolean isShowGeneNames() {
- return ( ( _show_gene_names != null ) && _show_gene_names.isSelected() );
- }
-
- boolean isShowInternalData() {
- return ( ( _display_internal_data == null ) || _display_internal_data.isSelected() );