+ } );
+ _options_jmenu.add( customizeMenuItemAsLabel( new JMenuItem( DISPLAY_SUBHEADER ), getConfiguration() ) );
+ _options_jmenu
+ .add( _ext_node_dependent_cladogram_rbmi = new JRadioButtonMenuItem( MainFrame.NONUNIFORM_CLADOGRAMS_LABEL ) );
+ _options_jmenu.add( _uniform_cladograms_rbmi = new JRadioButtonMenuItem( MainFrame.UNIFORM_CLADOGRAMS_LABEL ) );
+ _options_jmenu.add( _non_lined_up_cladograms_rbmi = new JRadioButtonMenuItem( NON_LINED_UP_CLADOGRAMS_LABEL ) );
+ _radio_group_1 = new ButtonGroup();
+ _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_overview_cbmi = new JCheckBoxMenuItem( SHOW_OVERVIEW_LABEL ) );
+ _options_jmenu.add( _show_scale_cbmi = new JCheckBoxMenuItem( DISPLAY_SCALE_LABEL ) );
+ _options_jmenu
+ .add( _show_branch_length_values_cbmi = new JCheckBoxMenuItem( 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_cbmi = new JCheckBoxMenuItem( DISPLAY_NODE_BOXES_LABEL ) );
+ _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( _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 ) );
+ _color_labels_same_as_parent_branch.setToolTipText( MainFrame.COLOR_LABELS_TIP );
+ _options_jmenu.add( _abbreviate_scientific_names = new JCheckBoxMenuItem( ABBREV_SN_LABEL ) );
+ _options_jmenu.add( _screen_antialias_cbmi = new JCheckBoxMenuItem( SCREEN_ANTIALIAS_LABEL ) );
+ _options_jmenu.add( _background_gradient_cbmi = new JCheckBoxMenuItem( BG_GRAD_LABEL ) );
+ if ( getConfiguration().doDisplayOption( Configuration.show_domain_architectures ) ) {
+ _options_jmenu.add( _show_domain_labels = new JCheckBoxMenuItem( SHOW_DOMAIN_LABELS_LABEL ) );
+ }
+ _options_jmenu.add( _choose_minimal_confidence_mi = new JMenuItem( "" ) );
+ _options_jmenu.add( _overview_placment_mi = new JMenuItem( "" ) );
+ _options_jmenu.add( _switch_colors_mi = new JMenuItem( "" ) );
+ _options_jmenu.add( _choose_font_mi = new JMenuItem( "" ) );
+ _options_jmenu.addSeparator();
+ _options_jmenu.add( customizeMenuItemAsLabel( new JMenuItem( SEARCH_SUBHEADER ), getConfiguration() ) );
+ _options_jmenu.add( _search_case_senstive_cbmi = new JCheckBoxMenuItem( SEARCH_CASE_SENSITIVE_LABEL ) );
+ _options_jmenu.add( _search_whole_words_only_cbmi = new JCheckBoxMenuItem( SEARCH_TERMS_ONLY_LABEL ) );
+ _options_jmenu.add( _inverse_search_result_cbmi = new JCheckBoxMenuItem( INVERSE_SEARCH_RESULT_LABEL ) );
+ _options_jmenu.addSeparator();
+ _options_jmenu.add( customizeMenuItemAsLabel( new JMenuItem( "Graphics Export & Printing:" ),
+ getConfiguration() ) );
+ _options_jmenu.add( _antialias_print_cbmi = new JCheckBoxMenuItem( "Antialias" ) );
+ _options_jmenu.add( _print_black_and_white_cbmi = new JCheckBoxMenuItem( "Export in Black and White" ) );
+ _options_jmenu
+ .add( _print_using_actual_size_cbmi = new JCheckBoxMenuItem( "Use Current Image Size for PDF export and Printing" ) );
+ _options_jmenu
+ .add( _graphics_export_using_actual_size_cbmi = new JCheckBoxMenuItem( "Use Current Image Size for PNG, JPG, and GIF export" ) );
+ _options_jmenu
+ .add( _graphics_export_visible_only_cbmi = new JCheckBoxMenuItem( "Limit to Visible ('Screenshot') for PNG, JPG, and GIF export" ) );
+ _options_jmenu.add( _print_size_mi = new JMenuItem( "" ) );
+ _options_jmenu.add( _choose_pdf_width_mi = new JMenuItem( "" ) );
+ _options_jmenu.addSeparator();
+ _options_jmenu.add( customizeMenuItemAsLabel( new JMenuItem( "Newick/NHX/Nexus Input:" ), getConfiguration() ) );
+ _options_jmenu
+ .add( _internal_number_are_confidence_for_nh_parsing_cbmi = new JCheckBoxMenuItem( "Internal Node Names are Confidence Values" ) );
+ _options_jmenu.add( _replace_underscores_cbmi = new JCheckBoxMenuItem( "Replace Underscores with Spaces" ) );
+ //
+ _options_jmenu.add( _extract_taxonomy_no_rbmi = new JRadioButtonMenuItem( "No Taxonomy Extraction" ) );
+ _options_jmenu
+ .add( _extract_taxonomy_pfam_rbmi = new JRadioButtonMenuItem( "Extract Taxonomy Codes from Pfam-style Node Names" ) );
+ _extract_taxonomy_pfam_rbmi
+ .setToolTipText( "To extract 5-letter taxonomy codes from node names in the form of \"BCL2_MOUSE/134-298\"" );
+ _options_jmenu
+ .add( _extract_taxonomy_yes_rbmi = new JRadioButtonMenuItem( "Extract Taxonomy Codes from Node Names" ) );
+ _extract_taxonomy_yes_rbmi
+ .setToolTipText( "To extract 5-letter taxonomy codes from node names in the form of \"BCL2_MOUSE\" or \"BCL2_MOUSE B-cell lymphoma 2...\"" );
+ _radio_group_2 = new ButtonGroup();
+ _radio_group_2.add( _extract_taxonomy_no_rbmi );
+ _radio_group_2.add( _extract_taxonomy_pfam_rbmi );
+ _radio_group_2.add( _extract_taxonomy_yes_rbmi );
+ //
+ _options_jmenu.add( customizeMenuItemAsLabel( new JMenuItem( "Newick/Nexus Output:" ), getConfiguration() ) );
+ _options_jmenu
+ .add( _use_brackets_for_conf_in_nh_export_cbmi = new JCheckBoxMenuItem( USE_BRACKETS_FOR_CONF_IN_NH_LABEL ) );
+ _use_brackets_for_conf_in_nh_export_cbmi
+ .setToolTipText( "e.g. \"0.1[90]\" for a branch with support 90 and a length of 0.1" );
+ _options_jmenu
+ .add( _use_internal_names_for_conf_in_nh_export_cbmi = new JCheckBoxMenuItem( USE_INTERNAL_NAMES_FOR_CONF_IN_NH_LABEL ) );
+ customizeJMenuItem( _choose_font_mi );
+ customizeJMenuItem( _choose_minimal_confidence_mi );
+ customizeJMenuItem( _switch_colors_mi );
+ customizeJMenuItem( _print_size_mi );
+ customizeJMenuItem( _choose_pdf_width_mi );
+ customizeJMenuItem( _overview_placment_mi );
+ customizeCheckBoxMenuItem( _show_default_node_shapes_cbmi, getOptions().isShowDefaultNodeShapes() );
+ customizeCheckBoxMenuItem( _taxonomy_colorize_node_shapes_cbmi, getOptions().isTaxonomyColorizeNodeShapes() );
+ customizeJMenuItem( _cycle_node_shape_mi );
+ customizeJMenuItem( _cycle_node_fill_mi );
+ customizeJMenuItem( _choose_node_size_mi );
+ customizeCheckBoxMenuItem( _color_labels_same_as_parent_branch, getOptions().isColorLabelsSameAsParentBranch() );
+ customizeCheckBoxMenuItem( _screen_antialias_cbmi, getOptions().isAntialiasScreen() );
+ customizeCheckBoxMenuItem( _background_gradient_cbmi, getOptions().isBackgroundColorGradient() );
+ customizeCheckBoxMenuItem( _show_domain_labels, getOptions().isShowDomainLabels() );
+ customizeCheckBoxMenuItem( _abbreviate_scientific_names, getOptions().isAbbreviateScientificTaxonNames() );
+ customizeCheckBoxMenuItem( _search_case_senstive_cbmi, getOptions().isSearchCaseSensitive() );
+ customizeCheckBoxMenuItem( _show_scale_cbmi, getOptions().isShowScale() );
+ customizeRadioButtonMenuItem( _non_lined_up_cladograms_rbmi,
+ getOptions().getCladogramType() == CLADOGRAM_TYPE.NON_LINED_UP );
+ customizeRadioButtonMenuItem( _uniform_cladograms_rbmi,
+ getOptions().getCladogramType() == CLADOGRAM_TYPE.TOTAL_NODE_SUM_DEP );
+ customizeRadioButtonMenuItem( _ext_node_dependent_cladogram_rbmi,
+ getOptions().getCladogramType() == CLADOGRAM_TYPE.EXT_NODE_SUM_DEP );
+ customizeCheckBoxMenuItem( _show_branch_length_values_cbmi, getOptions().isShowBranchLengthValues() );
+ customizeCheckBoxMenuItem( _show_overview_cbmi, getOptions().isShowOverview() );
+ customizeCheckBoxMenuItem( _label_direction_cbmi,
+ getOptions().getNodeLabelDirection() == NODE_LABEL_DIRECTION.RADIAL );
+ customizeCheckBoxMenuItem( _antialias_print_cbmi, getOptions().isAntialiasPrint() );
+ customizeCheckBoxMenuItem( _print_black_and_white_cbmi, getOptions().isPrintBlackAndWhite() );
+ customizeCheckBoxMenuItem( _internal_number_are_confidence_for_nh_parsing_cbmi, getOptions()
+ .isInternalNumberAreConfidenceForNhParsing() );
+ customizeRadioButtonMenuItem( _extract_taxonomy_no_rbmi,
+ getOptions().getTaxonomyExtraction() == TAXONOMY_EXTRACTION.NO );
+ customizeRadioButtonMenuItem( _extract_taxonomy_yes_rbmi,
+ getOptions().getTaxonomyExtraction() == TAXONOMY_EXTRACTION.YES );
+ customizeRadioButtonMenuItem( _extract_taxonomy_pfam_rbmi,
+ getOptions().getTaxonomyExtraction() == TAXONOMY_EXTRACTION.PFAM_STYLE_ONLY );
+ customizeCheckBoxMenuItem( _replace_underscores_cbmi, getOptions().isReplaceUnderscoresInNhParsing() );
+ customizeCheckBoxMenuItem( _search_whole_words_only_cbmi, getOptions().isMatchWholeTermsOnly() );
+ customizeCheckBoxMenuItem( _inverse_search_result_cbmi, getOptions().isInverseSearchResult() );
+ customizeCheckBoxMenuItem( _graphics_export_visible_only_cbmi, getOptions().isGraphicsExportVisibleOnly() );
+ customizeCheckBoxMenuItem( _print_using_actual_size_cbmi, getOptions().isPrintUsingActualSize() );
+ customizeCheckBoxMenuItem( _graphics_export_using_actual_size_cbmi, getOptions()
+ .isGraphicsExportUsingActualSize() );
+ customizeCheckBoxMenuItem( _show_confidence_stddev_cbmi, getOptions().isShowConfidenceStddev() );
+ customizeCheckBoxMenuItem( _use_brackets_for_conf_in_nh_export_cbmi, getOptions()
+ .getNhConversionSupportValueStyle() == NH_CONVERSION_SUPPORT_VALUE_STYLE.IN_SQUARE_BRACKETS );
+ customizeCheckBoxMenuItem( _use_internal_names_for_conf_in_nh_export_cbmi, getOptions()
+ .getNhConversionSupportValueStyle() == NH_CONVERSION_SUPPORT_VALUE_STYLE.AS_INTERNAL_NODE_NAMES );
+ _jmenubar.add( _options_jmenu );
+ }
+
+ void buildPhylogeneticInferenceMenu() {
+ final InferenceManager im = getInferenceManager();
+ _inference_menu = MainFrame.createMenu( "Inference", getConfiguration() );
+ _inference_menu.add( _inference_from_msa_item = new JMenuItem( "From Multiple Sequence Alignment..." ) );
+ customizeJMenuItem( _inference_from_msa_item );
+ _inference_from_msa_item.setToolTipText( "Basic phylogenetic inference from MSA" );
+ if ( im.canDoMsa() ) {
+ _inference_menu.add( _inference_from_seqs_item = new JMenuItem( "From Unaligned Sequences..." ) );
+ customizeJMenuItem( _inference_from_seqs_item );
+ _inference_from_seqs_item
+ .setToolTipText( "Basic phylogenetic inference including multiple sequence alignment" );
+ }
+ else {
+ _inference_menu
+ .add( _inference_from_seqs_item = new JMenuItem( "From Unaligned Sequences (no program found)" ) );
+ customizeJMenuItem( _inference_from_seqs_item );
+ _inference_from_seqs_item.setEnabled( false );
+ }
+ _jmenubar.add( _inference_menu );
+ }
+
+ void buildToolsMenu() {
+ _tools_menu = createMenu( "Tools", getConfiguration() );
+ _tools_menu.add( _confcolor_item = new JMenuItem( "Colorize Branches Depending on Confidence" ) );
+ customizeJMenuItem( _confcolor_item );
+ _tools_menu.add( _color_rank_jmi = new JMenuItem( "Colorize Subtrees via Taxonomic Rank" ) );
+ customizeJMenuItem( _color_rank_jmi );
+ _color_rank_jmi.setToolTipText( "for example, at \"Class\" level, colorize mammal specific subtree red" );
+ _tools_menu.add( _taxcolor_item = new JMenuItem( "Taxonomy Colorize Branches" ) );
+ customizeJMenuItem( _taxcolor_item );
+ _tools_menu.add( _remove_branch_color_item = new JMenuItem( "Delete Branch Colors" ) );
+ _remove_branch_color_item.setToolTipText( "To delete branch color values from the current phylogeny" );
+ customizeJMenuItem( _remove_branch_color_item );
+ _tools_menu.addSeparator();
+ _tools_menu.add( _annotate_item = new JMenuItem( "Annotate Sequences of Selected Nodes" ) );
+ customizeJMenuItem( _annotate_item );
+ _tools_menu.addSeparator();
+ _tools_menu.add( _midpoint_root_item = new JMenuItem( "Midpoint-Root" ) );
+ customizeJMenuItem( _midpoint_root_item );
+ _tools_menu.addSeparator();
+ _tools_menu.add( _collapse_species_specific_subtrees = new JMenuItem( "Collapse Species-Specific Subtrees" ) );
+ customizeJMenuItem( _collapse_species_specific_subtrees );
+ _tools_menu
+ .add( _collapse_below_threshold = new JMenuItem( "Collapse Branches with Confidence Below Threshold into Multifurcations" ) );
+ customizeJMenuItem( _collapse_below_threshold );
+ _collapse_below_threshold
+ .setToolTipText( "To collapse branches with confidence values below a threshold into multifurcations (in the case of multiple confidences per branch: without at least one confidence value above a threshold)" );
+ _tools_menu.addSeparator();
+ _tools_menu
+ .add( _extract_tax_code_from_node_names_jmi = new JMenuItem( "Extract Taxonomic Data from Node Names" ) );
+ customizeJMenuItem( _extract_tax_code_from_node_names_jmi );
+ _extract_tax_code_from_node_names_jmi
+ .setToolTipText( "To extract SwissProt/Uniprot taxonomic codes (mnemonics) from nodes names in the form of 'xyz_CAEEL', Uniprot/NCBI identifiers form of 'xyz_6239', or scientific names form of 'xyz_Caenorhabditis_elegans'" );
+ _tools_menu
+ .add( _move_node_names_to_tax_sn_jmi = new JMenuItem( "Transfer Node Names to Taxonomic Scientific Names" ) );
+ customizeJMenuItem( _move_node_names_to_tax_sn_jmi );
+ _move_node_names_to_tax_sn_jmi.setToolTipText( "To interpret node names as taxonomic scientific names" );
+ _tools_menu.add( _move_node_names_to_seq_names_jmi = new JMenuItem( "Transfer Node Names to Sequence Names" ) );
+ customizeJMenuItem( _move_node_names_to_seq_names_jmi );
+ _move_node_names_to_seq_names_jmi.setToolTipText( "To interpret node names as sequence (protein, gene) names" );
+ _tools_menu.addSeparator();
+ _tools_menu
+ .add( _obtain_detailed_taxonomic_information_jmi = new JMenuItem( OBTAIN_DETAILED_TAXONOMIC_INFORMATION ) );
+ customizeJMenuItem( _obtain_detailed_taxonomic_information_jmi );
+ _obtain_detailed_taxonomic_information_jmi
+ .setToolTipText( "To add additional taxonomic information (from UniProt Taxonomy)" );
+ _tools_menu
+ .add( _obtain_detailed_taxonomic_information_deleting_jmi = new JMenuItem( "Obtain Detailed Taxonomic Information (deletes nodes!)" ) );
+ customizeJMenuItem( _obtain_detailed_taxonomic_information_deleting_jmi );
+ _obtain_detailed_taxonomic_information_deleting_jmi
+ .setToolTipText( "To add additional taxonomic information, deletes nodes for which taxonomy cannot found (from UniProt Taxonomy)" );
+ _tools_menu.add( _obtain_seq_information_jmi = new JMenuItem( "Obtain Sequence Information" ) );
+ customizeJMenuItem( _obtain_seq_information_jmi );
+ _obtain_seq_information_jmi.setToolTipText( "To add additional sequence information" );
+ _tools_menu.addSeparator();
+ if ( !Constants.__RELEASE ) {
+ _tools_menu.add( _function_analysis = new JMenuItem( "Add UniProtKB Annotations" ) );
+ customizeJMenuItem( _function_analysis );
+ _function_analysis
+ .setToolTipText( "To add UniProtKB annotations for sequences with appropriate identifiers" );
+ _tools_menu.addSeparator();
+ }
+ _tools_menu.add( _read_values_jmi = new JMenuItem( "Read Vector/Expression Values" ) );
+ customizeJMenuItem( _read_values_jmi );
+ _read_values_jmi.setToolTipText( "To add vector (e.g. gene expression) values (beta)" );
+ _jmenubar.add( _tools_menu );
+ }
+
+ @Override
+ void close() {
+ if ( isUnsavedDataPresent() ) {
+ final int r = JOptionPane.showConfirmDialog( this,
+ "Exit despite potentially unsaved changes?",
+ "Exit?",
+ JOptionPane.YES_NO_OPTION );
+ if ( r != JOptionPane.YES_OPTION ) {
+ return;