X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=forester%2Fjava%2Fsrc%2Forg%2Fforester%2Farchaeopteryx%2FMainFrameApplication.java;h=b940f35be2e7757a1558cb29eb4e632e9e0396d4;hb=a9e626aa67ff9cb1649c371f9d705eb04498cc33;hp=853b1d5722170d56f06e8351c06d4d88baf00ce8;hpb=236967e4df09b7a3fd6659a8131aa97ef9906a28;p=jalview.git diff --git a/forester/java/src/org/forester/archaeopteryx/MainFrameApplication.java b/forester/java/src/org/forester/archaeopteryx/MainFrameApplication.java index 853b1d5..b940f35 100644 --- a/forester/java/src/org/forester/archaeopteryx/MainFrameApplication.java +++ b/forester/java/src/org/forester/archaeopteryx/MainFrameApplication.java @@ -63,7 +63,6 @@ import org.forester.analysis.TaxonomyDataManager; import org.forester.archaeopteryx.Options.CLADOGRAM_TYPE; import org.forester.archaeopteryx.Options.NODE_LABEL_DIRECTION; import org.forester.archaeopteryx.Options.PHYLOGENY_GRAPHICS_TYPE; -import org.forester.archaeopteryx.tools.AncestralTaxonomyInferrer; import org.forester.archaeopteryx.tools.InferenceManager; import org.forester.archaeopteryx.tools.PhyloInferenceDialog; import org.forester.archaeopteryx.tools.PhylogeneticInferenceOptions; @@ -105,13 +104,11 @@ import org.forester.util.ForesterUtil; public final class MainFrameApplication extends MainFrame { - static final String INFER_ANCESTOR_TAXONOMIES = "Infer Ancestor Taxonomies"; - static final String OBTAIN_DETAILED_TAXONOMIC_INFORMATION = "Obtain Detailed Taxonomic Information"; - private final static int FRAME_X_SIZE = 800; - private final static int FRAME_Y_SIZE = 800; + private final static int FRAME_X_SIZE = 800; + private final static int FRAME_Y_SIZE = 800; // Filters for the file-open dialog (classes defined in this file) - private static final long serialVersionUID = -799735726778865234L; - private static final boolean PREPROCESS_TREES = false; + private static final long serialVersionUID = -799735726778865234L; + private static final boolean PREPROCESS_TREES = false; private final JFileChooser _values_filechooser; private final JFileChooser _sequences_filechooser; private final JFileChooser _open_filechooser; @@ -124,18 +121,18 @@ public final class MainFrameApplication extends MainFrame { private ButtonGroup _radio_group_1; private ButtonGroup _radio_group_2; // Others: - double _min_not_collapse = Constants.MIN_NOT_COLLAPSE_DEFAULT; - double _min_not_collapse_bl = 0.001; + double _min_not_collapse = AptxConstants.MIN_NOT_COLLAPSE_DEFAULT; + double _min_not_collapse_bl = 0.001; // Phylogeny Inference menu private JMenu _inference_menu; private JMenuItem _inference_from_msa_item; private JMenuItem _inference_from_seqs_item; // Phylogeny Inference - private PhylogeneticInferenceOptions _phylogenetic_inference_options = null; - private Msa _msa = null; - private File _msa_file = null; - private List _seqs = null; - private File _seqs_file = null; + private PhylogeneticInferenceOptions _phylogenetic_inference_options = null; + private Msa _msa = null; + private File _msa_file = null; + private List _seqs = null; + private File _seqs_file = null; JMenuItem _read_values_jmi; JMenuItem _read_seqs_jmi; @@ -200,7 +197,7 @@ public final class MainFrameApplication extends MainFrame { } try { boolean synth_exception = false; - if ( Constants.__SYNTH_LF ) { + if ( AptxConstants.__SYNTH_LF ) { try { final SynthLookAndFeel synth = new SynthLookAndFeel(); synth.load( MainFrameApplication.class.getResourceAsStream( "/resources/synth_look_and_feel_1.xml" ), @@ -209,12 +206,12 @@ public final class MainFrameApplication extends MainFrame { } catch ( final Exception ex ) { synth_exception = true; - ForesterUtil.printWarningMessage( Constants.PRG_NAME, + ForesterUtil.printWarningMessage( AptxConstants.PRG_NAME, "could not create synth look and feel: " + ex.getLocalizedMessage() ); } } - if ( !Constants.__SYNTH_LF || synth_exception ) { + if ( !AptxConstants.__SYNTH_LF || synth_exception ) { if ( _configuration.isUseNativeUI() ) { UIManager.setLookAndFeel( UIManager.getSystemLookAndFeelClassName() ); } @@ -244,14 +241,12 @@ public final class MainFrameApplication extends MainFrame { setOptions( Options.createInstance( _configuration ) ); setInferenceManager( InferenceManager.createInstance( _configuration ) ); setPhylogeneticInferenceOptions( PhylogeneticInferenceOptions.createInstance( _configuration ) ); - // _textframe = null; #~~~~ // set title - setTitle( Constants.PRG_NAME + " " + Constants.VERSION + " (" + Constants.PRG_DATE + ")" ); + setTitle( AptxConstants.PRG_NAME + " " + AptxConstants.VERSION + " (" + AptxConstants.PRG_DATE + ")" ); _mainpanel = new MainPanel( _configuration, this ); // The file dialogs _open_filechooser = new JFileChooser(); - _open_filechooser.setCurrentDirectory( new File( "." ) ); - _open_filechooser.setMultiSelectionEnabled( false ); + _open_filechooser.setMultiSelectionEnabled( true ); _open_filechooser.addChoosableFileFilter( MainFrame.xmlfilter ); _open_filechooser.addChoosableFileFilter( MainFrame.nhxfilter ); _open_filechooser.addChoosableFileFilter( MainFrame.nhfilter ); @@ -260,51 +255,48 @@ public final class MainFrameApplication extends MainFrame { _open_filechooser.addChoosableFileFilter( _open_filechooser.getAcceptAllFileFilter() ); _open_filechooser.setFileFilter( MainFrame.defaultfilter ); _open_filechooser_for_species_tree = new JFileChooser(); - _open_filechooser_for_species_tree.setCurrentDirectory( new File( "." ) ); _open_filechooser_for_species_tree.setMultiSelectionEnabled( false ); _open_filechooser_for_species_tree.addChoosableFileFilter( MainFrame.xmlfilter ); _open_filechooser_for_species_tree.addChoosableFileFilter( MainFrame.tolfilter ); _open_filechooser_for_species_tree.setFileFilter( MainFrame.xmlfilter ); - _save_filechooser = new JFileChooser(); - _save_filechooser.setCurrentDirectory( new File( "." ) ); - _save_filechooser.setMultiSelectionEnabled( false ); - _save_filechooser.setFileFilter( MainFrame.xmlfilter ); - _save_filechooser.addChoosableFileFilter( MainFrame.nhfilter ); - _save_filechooser.addChoosableFileFilter( MainFrame.nexusfilter ); - _save_filechooser.addChoosableFileFilter( _save_filechooser.getAcceptAllFileFilter() ); - _writetopdf_filechooser = new JFileChooser(); - _writetopdf_filechooser.addChoosableFileFilter( MainFrame.pdffilter ); - _writetographics_filechooser = new JFileChooser(); - _writetographics_filechooser.addChoosableFileFilter( MainFrame.graphicsfilefilter ); // Msa: _msa_filechooser = new JFileChooser(); _msa_filechooser.setName( "Read Multiple Sequence Alignment File" ); - _msa_filechooser.setCurrentDirectory( new File( "." ) ); _msa_filechooser.setMultiSelectionEnabled( false ); _msa_filechooser.addChoosableFileFilter( _msa_filechooser.getAcceptAllFileFilter() ); _msa_filechooser.addChoosableFileFilter( MainFrame.msafilter ); // Seqs: _seqs_pi_filechooser = new JFileChooser(); _seqs_pi_filechooser.setName( "Read Sequences File" ); - _seqs_pi_filechooser.setCurrentDirectory( new File( "." ) ); _seqs_pi_filechooser.setMultiSelectionEnabled( false ); _seqs_pi_filechooser.addChoosableFileFilter( _seqs_pi_filechooser.getAcceptAllFileFilter() ); _seqs_pi_filechooser.addChoosableFileFilter( MainFrame.seqsfilter ); // Expression _values_filechooser = new JFileChooser(); - _values_filechooser.setCurrentDirectory( new File( "." ) ); _values_filechooser.setMultiSelectionEnabled( false ); // Sequences _sequences_filechooser = new JFileChooser(); - _sequences_filechooser.setCurrentDirectory( new File( "." ) ); _sequences_filechooser.setMultiSelectionEnabled( false ); + try { + final String home_dir = System.getProperty( "user.home" ); + _open_filechooser.setCurrentDirectory( new File( home_dir ) ); + _open_filechooser_for_species_tree.setCurrentDirectory( new File( home_dir ) ); + _msa_filechooser.setCurrentDirectory( new File( home_dir ) ); + _seqs_pi_filechooser.setCurrentDirectory( new File( home_dir ) ); + _values_filechooser.setCurrentDirectory( new File( home_dir ) ); + _sequences_filechooser.setCurrentDirectory( new File( home_dir ) ); + } + catch ( final Exception e ) { + e.printStackTrace(); + // Do nothing. Not important. + } // build the menu bar _jmenubar = new JMenuBar(); if ( !_configuration.isUseNativeUI() ) { _jmenubar.setBackground( getConfiguration().getGuiMenuBackgroundColor() ); } buildFileMenu(); - if ( Constants.__ALLOW_PHYLOGENETIC_INFERENCE ) { + if ( AptxConstants.__ALLOW_PHYLOGENETIC_INFERENCE ) { buildPhylogeneticInferenceMenu(); } buildAnalysisMenu(); @@ -362,9 +354,9 @@ public final class MainFrameApplication extends MainFrame { public void componentResized( final ComponentEvent e ) { if ( _mainpanel.getCurrentTreePanel() != null ) { _mainpanel.getCurrentTreePanel().calcParametersForPainting( _mainpanel.getCurrentTreePanel() - .getWidth(), + .getWidth(), _mainpanel.getCurrentTreePanel() - .getHeight() ); + .getHeight() ); } } } ); @@ -409,16 +401,6 @@ public final class MainFrameApplication extends MainFrame { else if ( o == _load_species_tree_item ) { readSpeciesTreeFromFile(); } - else if ( o == _lineage_inference ) { - if ( isSubtreeDisplayed() ) { - JOptionPane.showMessageDialog( this, - "Subtree is shown.", - "Cannot infer ancestral taxonomies", - JOptionPane.ERROR_MESSAGE ); - return; - } - executeLineageInference(); - } else if ( o == _obtain_detailed_taxonomic_information_jmi ) { if ( isSubtreeDisplayed() ) { return; @@ -756,8 +738,8 @@ public final class MainFrameApplication extends MainFrame { JOptionPane.showMessageDialog( this, "Table contains " + t.getNumberOfRows() + " rows, but tree contains " + phy.getNumberOfExternalNodes() + " external nodes", - "Warning", - JOptionPane.WARNING_MESSAGE ); + "Warning", + JOptionPane.WARNING_MESSAGE ); } final DescriptiveStatistics stats = new BasicDescriptiveStatistics(); int not_found = 0; @@ -771,10 +753,10 @@ public final class MainFrameApplication extends MainFrame { } catch ( final IllegalArgumentException e ) { JOptionPane - .showMessageDialog( this, - e.getMessage(), - "Error Mapping Node Identifiers to Expression Value Identifiers", - JOptionPane.ERROR_MESSAGE ); + .showMessageDialog( this, + e.getMessage(), + "Error Mapping Node Identifiers to Expression Value Identifiers", + JOptionPane.ERROR_MESSAGE ); return; } if ( row < 0 ) { @@ -792,7 +774,7 @@ public final class MainFrameApplication extends MainFrame { catch ( final NumberFormatException e ) { JOptionPane.showMessageDialog( this, "Could not parse \"" + t.getValueAsString( col, row ) - + "\" into a decimal value", + + "\" into a decimal value", "Issue with Expression Value Table", JOptionPane.ERROR_MESSAGE ); return; @@ -803,7 +785,7 @@ public final class MainFrameApplication extends MainFrame { if ( !l.isEmpty() ) { if ( node.getNodeData().getProperties() != null ) { node.getNodeData().getProperties() - .removePropertiesWithGivenReferencePrefix( PhyloXmlUtil.VECTOR_PROPERTY_REF ); + .removePropertiesWithGivenReferencePrefix( PhyloXmlUtil.VECTOR_PROPERTY_REF ); } node.getNodeData().setVector( l ); } @@ -811,7 +793,7 @@ public final class MainFrameApplication extends MainFrame { } if ( not_found > 0 ) { JOptionPane.showMessageDialog( this, "Could not fine expression values for " + not_found - + " external node(s)", "Warning", JOptionPane.WARNING_MESSAGE ); + + " external node(s)", "Warning", JOptionPane.WARNING_MESSAGE ); } getCurrentTreePanel().setStatisticsForExpressionValues( stats ); } @@ -920,7 +902,7 @@ public final class MainFrameApplication extends MainFrame { } if ( nodes.size() > 1 ) { JOptionPane.showMessageDialog( this, "Split sequence name \"" + seq_name_split - + "\" is not unique", "Sequence name not unique", JOptionPane.ERROR_MESSAGE ); + + "\" is not unique", "Sequence name not unique", JOptionPane.ERROR_MESSAGE ); setArrowCursor(); return; } @@ -965,13 +947,13 @@ public final class MainFrameApplication extends MainFrame { } else { JOptionPane.showMessageDialog( this, "Attached " + attached_counter - + " sequences out of a total of " + total_counter + " sequences.\n" + s, attached_counter - + " sequences attached", JOptionPane.WARNING_MESSAGE ); + + " sequences out of a total of " + total_counter + " sequences.\n" + s, attached_counter + + " sequences attached", JOptionPane.WARNING_MESSAGE ); } } else { JOptionPane.showMessageDialog( this, "No maching tree node for any of the " + total_counter - + " sequences", "Could not attach any sequences", JOptionPane.ERROR_MESSAGE ); + + " sequences", "Could not attach any sequences", JOptionPane.ERROR_MESSAGE ); } } } @@ -1038,8 +1020,8 @@ public final class MainFrameApplication extends MainFrame { } if ( to_be_removed.size() > 0 ) { JOptionPane.showMessageDialog( this, "Collapsed " + to_be_removed.size() - + " branches with\nconfidence values below " + getMinNotCollapseConfidenceValue(), "Collapsed " - + to_be_removed.size() + " branches", JOptionPane.INFORMATION_MESSAGE ); + + " branches with\nconfidence values below " + getMinNotCollapseConfidenceValue(), "Collapsed " + + to_be_removed.size() + " branches", JOptionPane.INFORMATION_MESSAGE ); } else { JOptionPane.showMessageDialog( this, "No branch collapsed,\nminimum confidence value per branch is " @@ -1165,8 +1147,8 @@ public final class MainFrameApplication extends MainFrame { } if ( to_be_removed.size() > 0 ) { JOptionPane.showMessageDialog( this, "Collapsed " + to_be_removed.size() - + " branches with\nbranch length values below " + getMinNotCollapseBlValue(), "Collapsed " - + to_be_removed.size() + " branches", JOptionPane.INFORMATION_MESSAGE ); + + " branches with\nbranch length values below " + getMinNotCollapseBlValue(), "Collapsed " + + to_be_removed.size() + " branches", JOptionPane.INFORMATION_MESSAGE ); } else { JOptionPane.showMessageDialog( this, @@ -1212,7 +1194,7 @@ public final class MainFrameApplication extends MainFrame { if ( getMsa() != null ) { final PhylogeneticInferrer inferrer = new PhylogeneticInferrer( getMsa(), getPhylogeneticInferenceOptions() - .copy(), this ); + .copy(), this ); new Thread( inferrer ).start(); } else { @@ -1226,7 +1208,7 @@ public final class MainFrameApplication extends MainFrame { if ( getSeqs() != null ) { final PhylogeneticInferrer inferrer = new PhylogeneticInferrer( getSeqs(), getPhylogeneticInferenceOptions() - .copy(), this ); + .copy(), this ); new Thread( inferrer ).start(); } else { @@ -1284,17 +1266,17 @@ public final class MainFrameApplication extends MainFrame { } JOptionPane.showMessageDialog( this, "Extracted taxonomic data from " + all + counter - + " named external nodes:\n" + sb.toString() + failed, + + " named external nodes:\n" + sb.toString() + failed, "Taxonomic Data Extraction Completed", counter_failed > 0 ? JOptionPane.WARNING_MESSAGE : JOptionPane.INFORMATION_MESSAGE ); } else { JOptionPane - .showMessageDialog( this, - "Could not extract any taxonomic data.\nMaybe node names are empty\n" - + "or not in the forms \"XYZ_CAEEL\", \"XYZ_6239\", or \"XYZ_Caenorhabditis_elegans\"\n" - + "or nodes already have taxonomic data?\n", + .showMessageDialog( this, + "Could not extract any taxonomic data.\nMaybe node names are empty\n" + + "or not in the forms \"XYZ_CAEEL\", \"XYZ_6239\", or \"XYZ_Caenorhabditis_elegans\"\n" + + "or nodes already have taxonomic data?\n", "No Taxonomic Data Extracted", JOptionPane.ERROR_MESSAGE ); } @@ -1332,7 +1314,7 @@ public final class MainFrameApplication extends MainFrame { final Phylogeny phy = getCurrentTreePanel().getPhylogeny(); if ( ( phy != null ) && !phy.isEmpty() ) { PhylogenyMethods - .transferNodeNameToField( phy, PhylogenyMethods.PhylogenyNodeField.SEQUENCE_NAME, false ); + .transferNodeNameToField( phy, PhylogenyMethods.PhylogenyNodeField.SEQUENCE_NAME, false ); } } } @@ -1362,7 +1344,7 @@ public final class MainFrameApplication extends MainFrame { if ( getMainPanel().getMainFrame() == null ) { // Must be "E" applet version. ( ( ArchaeopteryxE ) ( ( MainPanelApplets ) getMainPanel() ).getApplet() ) - .setSelectedTypeInTypeMenu( PHYLOGENY_GRAPHICS_TYPE.RECTANGULAR ); + .setSelectedTypeInTypeMenu( PHYLOGENY_GRAPHICS_TYPE.RECTANGULAR ); } else { getMainPanel().getMainFrame().setSelectedTypeInTypeMenu( PHYLOGENY_GRAPHICS_TYPE.RECTANGULAR ); @@ -1440,7 +1422,6 @@ public final class MainFrameApplication extends MainFrame { Phylogeny[] phys = null; // Set an initial directory if none set yet final File my_dir = getCurrentDir(); - _open_filechooser.setMultiSelectionEnabled( true ); // Open file-open dialog and set current directory if ( my_dir != null ) { _open_filechooser.setCurrentDirectory( my_dir ); @@ -1509,7 +1490,7 @@ public final class MainFrameApplication extends MainFrame { try { final PhylogenyParser parser = ParserUtils .createParserDependingOnFileType( file, getConfiguration() - .isValidatePhyloXmlAgainstSchema() ); + .isValidatePhyloXmlAgainstSchema() ); if ( parser instanceof NexusPhylogeniesParser ) { final NexusPhylogeniesParser nex = ( NexusPhylogeniesParser ) parser; setSpecialOptionsForNexParser( nex ); @@ -1560,10 +1541,10 @@ public final class MainFrameApplication extends MainFrame { _mainpanel.getControlPanel().showWhole(); if ( nhx_or_nexus && one_desc ) { JOptionPane - .showMessageDialog( this, - "One or more trees contain (a) node(s) with one descendant, " - + ForesterUtil.LINE_SEPARATOR - + "possibly indicating illegal parentheses within node names.", + .showMessageDialog( this, + "One or more trees contain (a) node(s) with one descendant, " + + ForesterUtil.LINE_SEPARATOR + + "possibly indicating illegal parentheses within node names.", "Warning: Possible Error in New Hampshire Formatted Data", JOptionPane.WARNING_MESSAGE ); } @@ -1589,7 +1570,7 @@ public final class MainFrameApplication extends MainFrame { if ( _open_filechooser_for_species_tree.getFileFilter() == MainFrame.xmlfilter ) { try { final Phylogeny[] trees = PhylogenyMethods.readPhylogenies( PhyloXmlParser - .createPhyloXmlParserXsdValidating(), file ); + .createPhyloXmlParserXsdValidating(), file ); t = trees[ 0 ]; } catch ( final Exception e ) { @@ -1611,7 +1592,7 @@ public final class MainFrameApplication extends MainFrame { else { try { final Phylogeny[] trees = PhylogenyMethods.readPhylogenies( PhyloXmlParser - .createPhyloXmlParserXsdValidating(), file ); + .createPhyloXmlParserXsdValidating(), file ); t = trees[ 0 ]; } catch ( final Exception e ) { @@ -1635,10 +1616,10 @@ public final class MainFrameApplication extends MainFrame { exception = true; t = null; JOptionPane - .showMessageDialog( this, - "Species tree contains external node(s) without taxonomy information", - "Species tree not loaded", - JOptionPane.ERROR_MESSAGE ); + .showMessageDialog( this, + "Species tree contains external node(s) without taxonomy information", + "Species tree not loaded", + JOptionPane.ERROR_MESSAGE ); break; } else { @@ -1649,8 +1630,8 @@ public final class MainFrameApplication extends MainFrame { "Taxonomy [" + node.getNodeData().getTaxonomy().asSimpleText() + "] is not unique in species tree", - "Species tree not loaded", - JOptionPane.ERROR_MESSAGE ); + "Species tree not loaded", + JOptionPane.ERROR_MESSAGE ); break; } else { @@ -1727,7 +1708,7 @@ public final class MainFrameApplication extends MainFrame { _file_jmenu.addSeparator(); final WebservicesManager webservices_manager = WebservicesManager.getInstance(); _load_phylogeny_from_webservice_menu_items = new JMenuItem[ webservices_manager - .getAvailablePhylogeniesWebserviceClients().size() ]; + .getAvailablePhylogeniesWebserviceClients().size() ]; for( int i = 0; i < webservices_manager.getAvailablePhylogeniesWebserviceClients().size(); ++i ) { final PhylogeniesWebserviceClient client = webservices_manager.getAvailablePhylogeniesWebserviceClient( i ); _load_phylogeny_from_webservice_menu_items[ i ] = new JMenuItem( client.getMenuName() ); @@ -1766,7 +1747,7 @@ public final class MainFrameApplication extends MainFrame { _file_jmenu.add( _exit_item = new JMenuItem( "Exit" ) ); customizeJMenuItem( _open_item ); _open_item - .setFont( new Font( _open_item.getFont().getFontName(), Font.BOLD, _open_item.getFont().getSize() + 4 ) ); + .setFont( new Font( _open_item.getFont().getFontName(), Font.BOLD, _open_item.getFont().getSize() + 4 ) ); customizeJMenuItem( _open_url_item ); for( int i = 0; i < webservices_manager.getAvailablePhylogeniesWebserviceClients().size(); ++i ) { customizeJMenuItem( _load_phylogeny_from_webservice_menu_items[ i ] ); @@ -1797,9 +1778,9 @@ public final class MainFrameApplication extends MainFrame { MainFrame.setOvPlacementColorChooseMenuItem( _overview_placment_mi, getOptions() ); MainFrame.setTextColorChooseMenuItem( _switch_colors_mi, getCurrentTreePanel() ); MainFrame - .setTextMinSupportMenuItem( _choose_minimal_confidence_mi, getOptions(), getCurrentTreePanel() ); + .setTextMinSupportMenuItem( _choose_minimal_confidence_mi, getOptions(), getCurrentTreePanel() ); MainFrame.setTextForFontChooserMenuItem( _choose_font_mi, MainFrame - .createCurrentFontDesc( getMainPanel().getTreeFontSet() ) ); + .createCurrentFontDesc( getMainPanel().getTreeFontSet() ) ); MainFrame.setTextForGraphicsSizeChooserMenuItem( _print_size_mi, getOptions() ); MainFrame.setTextForPdfLineWidthChooserMenuItem( _choose_pdf_width_mi, getOptions() ); MainFrame.setCycleNodeFillMenuItem( _cycle_node_fill_mi, getOptions() ); @@ -1817,7 +1798,7 @@ public final class MainFrameApplication extends MainFrame { } ); _options_jmenu.add( customizeMenuItemAsLabel( new JMenuItem( DISPLAY_SUBHEADER ), getConfiguration() ) ); _options_jmenu - .add( _ext_node_dependent_cladogram_rbmi = new JRadioButtonMenuItem( MainFrame.NONUNIFORM_CLADOGRAMS_LABEL ) ); + .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(); @@ -1827,11 +1808,11 @@ public final class MainFrameApplication extends MainFrame { _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_default_node_shapes_internal_cbmi = new JCheckBoxMenuItem( DISPLAY_NODE_BOXES_LABEL_INT ) ); + .add( _show_default_node_shapes_internal_cbmi = new JCheckBoxMenuItem( DISPLAY_NODE_BOXES_LABEL_INT ) ); _options_jmenu - .add( _show_default_node_shapes_external_cbmi = new JCheckBoxMenuItem( DISPLAY_NODE_BOXES_LABEL_EXT ) ); + .add( _show_default_node_shapes_external_cbmi = new JCheckBoxMenuItem( DISPLAY_NODE_BOXES_LABEL_EXT ) ); _options_jmenu - .add( _show_default_node_shapes_for_marked_cbmi = new JCheckBoxMenuItem( MainFrame.DISPLAY_NODE_BOXES_LABEL_MARKED ) ); + .add( _show_default_node_shapes_for_marked_cbmi = new JCheckBoxMenuItem( MainFrame.DISPLAY_NODE_BOXES_LABEL_MARKED ) ); _options_jmenu.add( _line_up_renderable_data_cbmi = new JCheckBoxMenuItem( MainFrame.LINE_UP_RENDERABLE_DATA ) ); if ( getConfiguration().doDisplayOption( Configuration.show_domain_architectures ) ) { _options_jmenu.add( _right_line_up_domains_cbmi = new JCheckBoxMenuItem( MainFrame.RIGHT_LINE_UP_DOMAINS ) ); @@ -1863,51 +1844,52 @@ public final class MainFrameApplication extends MainFrame { _options_jmenu.add( _search_with_regex_cbmi = new JCheckBoxMenuItem( MainFrame.SEARCH_REGEX_LABEL ) ); _search_with_regex_cbmi.setToolTipText( MainFrame.SEARCH_WITH_REGEX_TIP ); _options_jmenu.add( _inverse_search_result_cbmi = new JCheckBoxMenuItem( INVERSE_SEARCH_RESULT_LABEL ) ); + _options_jmenu.add( _color_all_found_nodes_when_coloring_subtree_cbmi = new JCheckBoxMenuItem( "Colorize All Found Nodes When Colorizing Subtree(s)" ) ); _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" ) ); + .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" ) ); + .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" ) ); + .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( customizeMenuItemAsLabel( new JMenuItem( "Newick/NHX/Nexus Read:" ), getConfiguration() ) ); _options_jmenu - .add( _internal_number_are_confidence_for_nh_parsing_cbmi = new JCheckBoxMenuItem( "Internal Node Names are Confidence Values" ) ); + .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( _allow_errors_in_distance_to_parent_cbmi = new JCheckBoxMenuItem( "Ignore Distance Values Format Errors" ) ); + .add( _allow_errors_in_distance_to_parent_cbmi = new JCheckBoxMenuItem( "Ignore Distance Values Format Errors" ) ); _options_jmenu.add( _extract_taxonomy_no_rbmi = new JRadioButtonMenuItem( "No Taxonomy Extraction" ) ); _options_jmenu - .add( _extract_taxonomy_pfam_strict_rbmi = new JRadioButtonMenuItem( "Extract Taxonomy Codes/Ids from Pfam-style Node Names" ) ); + .add( _extract_taxonomy_pfam_strict_rbmi = new JRadioButtonMenuItem( "Extract Taxonomy Codes/Ids from Pfam-style Node Names" ) ); _options_jmenu - .add( _extract_taxonomy_pfam_relaxed_rbmi = new JRadioButtonMenuItem( "Extract Taxonomy Codes/Ids from Pfam-style like Node Names" ) ); + .add( _extract_taxonomy_pfam_relaxed_rbmi = new JRadioButtonMenuItem( "Extract Taxonomy Codes/Ids from Pfam-style like Node Names" ) ); _options_jmenu - .add( _extract_taxonomy_agressive_rbmi = new JRadioButtonMenuItem( "Extract Taxonomy Codes/Ids/Scientific Names from Node Names" ) ); + .add( _extract_taxonomy_agressive_rbmi = new JRadioButtonMenuItem( "Extract Taxonomy Codes/Ids/Scientific Names from Node Names" ) ); _extract_taxonomy_pfam_strict_rbmi - .setToolTipText( "To extract taxonomy codes/ids from node names in the form of e.g. \"BCL2_MOUSE/123-304\" or \"BCL2_10090/123-304\"" ); + .setToolTipText( "To extract taxonomy codes/ids from node names in the form of e.g. \"BCL2_MOUSE/123-304\" or \"BCL2_10090/123-304\"" ); _extract_taxonomy_pfam_relaxed_rbmi - .setToolTipText( "To extract taxonomy codes/ids from node names in the form of e.g. \"bax_MOUSE\" or \"bax_10090\"" ); + .setToolTipText( "To extract taxonomy codes/ids from node names in the form of e.g. \"bax_MOUSE\" or \"bax_10090\"" ); _extract_taxonomy_agressive_rbmi - .setToolTipText( "To extract taxonomy codes/ids or scientific names from node names in the form of e.g. \"MOUSE\" or \"10090\" or \"xyz_Nematostella_vectensis\"" ); + .setToolTipText( "To extract taxonomy codes/ids or scientific names from node names in the form of e.g. \"MOUSE\" or \"10090\" or \"xyz_Nematostella_vectensis\"" ); _radio_group_2 = new ButtonGroup(); _radio_group_2.add( _extract_taxonomy_no_rbmi ); _radio_group_2.add( _extract_taxonomy_pfam_strict_rbmi ); _radio_group_2.add( _extract_taxonomy_pfam_relaxed_rbmi ); _radio_group_2.add( _extract_taxonomy_agressive_rbmi ); - _options_jmenu.add( customizeMenuItemAsLabel( new JMenuItem( "Newick/Nexus Output:" ), getConfiguration() ) ); + _options_jmenu.add( customizeMenuItemAsLabel( new JMenuItem( "Newick/Nexus Save:" ), getConfiguration() ) ); _options_jmenu - .add( _use_brackets_for_conf_in_nh_export_cbmi = new JCheckBoxMenuItem( USE_BRACKETS_FOR_CONF_IN_NH_LABEL ) ); + .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" ); + .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 ) ); + .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 ); @@ -1915,11 +1897,11 @@ public final class MainFrameApplication extends MainFrame { customizeJMenuItem( _choose_pdf_width_mi ); customizeJMenuItem( _overview_placment_mi ); customizeCheckBoxMenuItem( _show_default_node_shapes_external_cbmi, getOptions() - .isShowDefaultNodeShapesExternal() ); + .isShowDefaultNodeShapesExternal() ); customizeCheckBoxMenuItem( _show_default_node_shapes_internal_cbmi, getOptions() - .isShowDefaultNodeShapesInternal() ); + .isShowDefaultNodeShapesInternal() ); customizeCheckBoxMenuItem( _show_default_node_shapes_for_marked_cbmi, getOptions() - .isShowDefaultNodeShapesForMarkedNodes() ); + .isShowDefaultNodeShapesForMarkedNodes() ); customizeJMenuItem( _cycle_node_shape_mi ); customizeJMenuItem( _cycle_node_fill_mi ); customizeJMenuItem( _choose_node_size_mi ); @@ -1945,7 +1927,7 @@ public final class MainFrameApplication extends MainFrame { 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() ); + .isInternalNumberAreConfidenceForNhParsing() ); customizeRadioButtonMenuItem( _extract_taxonomy_no_rbmi, getOptions().getTaxonomyExtraction() == TAXONOMY_EXTRACTION.NO ); customizeRadioButtonMenuItem( _extract_taxonomy_pfam_strict_rbmi, @@ -1956,19 +1938,20 @@ public final class MainFrameApplication extends MainFrame { getOptions().getTaxonomyExtraction() == TAXONOMY_EXTRACTION.AGGRESSIVE ); customizeCheckBoxMenuItem( _replace_underscores_cbmi, getOptions().isReplaceUnderscoresInNhParsing() ); customizeCheckBoxMenuItem( _allow_errors_in_distance_to_parent_cbmi, getOptions() - .isReplaceUnderscoresInNhParsing() ); + .isReplaceUnderscoresInNhParsing() ); customizeCheckBoxMenuItem( _search_with_regex_cbmi, getOptions().isSearchWithRegex() ); customizeCheckBoxMenuItem( _search_whole_words_only_cbmi, getOptions().isMatchWholeTermsOnly() ); customizeCheckBoxMenuItem( _inverse_search_result_cbmi, getOptions().isInverseSearchResult() ); + customizeCheckBoxMenuItem( _color_all_found_nodes_when_coloring_subtree_cbmi, getOptions().isColorAllFoundNodesWhenColoringSubtree() ); 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() ); + .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 ); + .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 ); + .getNhConversionSupportValueStyle() == NH_CONVERSION_SUPPORT_VALUE_STYLE.AS_INTERNAL_NODE_NAMES ); customizeCheckBoxMenuItem( _line_up_renderable_data_cbmi, getOptions().isLineUpRendarableNodeData() ); customizeCheckBoxMenuItem( _right_line_up_domains_cbmi, getOptions().isRightLineUpDomains() ); _jmenubar.add( _options_jmenu ); @@ -1984,11 +1967,11 @@ public final class MainFrameApplication extends MainFrame { _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" ); + .setToolTipText( "Basic phylogenetic inference including multiple sequence alignment" ); } else { _inference_menu - .add( _inference_from_seqs_item = new JMenuItem( "From Unaligned Sequences (no program found)" ) ); + .add( _inference_from_seqs_item = new JMenuItem( "From Unaligned Sequences (no program found)" ) ); customizeJMenuItem( _inference_from_seqs_item ); _inference_from_seqs_item.setEnabled( false ); } @@ -2007,7 +1990,7 @@ public final class MainFrameApplication extends MainFrame { _tools_menu.addSeparator(); _tools_menu.add( _remove_visual_styles_item = new JMenuItem( "Delete All Visual Styles From Nodes" ) ); _remove_visual_styles_item - .setToolTipText( "To remove all node visual styles (fonts, colors) from the current phylogeny" ); + .setToolTipText( "To remove all node visual styles (fonts, colors) from the current phylogeny" ); customizeJMenuItem( _remove_visual_styles_item ); _tools_menu.add( _remove_branch_color_item = new JMenuItem( "Delete All Colors From Branches" ) ); _remove_branch_color_item.setToolTipText( "To remove all branch color values from the current phylogeny" ); @@ -2030,25 +2013,25 @@ public final class MainFrameApplication extends MainFrame { customizeJMenuItem( _collapse_species_specific_subtrees ); _collapse_species_specific_subtrees.setToolTipText( "To (reversibly) collapse species-specific subtrees" ); _tools_menu - .add( _collapse_below_threshold = new JMenuItem( "Collapse Branches with Confidence Below Threshold into Multifurcations" ) ); + .add( _collapse_below_threshold = new JMenuItem( "Collapse Branches with Confidence Below Threshold into Multifurcations" ) ); customizeJMenuItem( _collapse_below_threshold ); _collapse_below_threshold - .setToolTipText( "To (permanently) 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)" ); + .setToolTipText( "To (permanently) 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 - .add( _collapse_below_branch_length = new JMenuItem( "Collapse Branches with Branch Lengths Below Threshold into Multifurcations" ) ); + .add( _collapse_below_branch_length = new JMenuItem( "Collapse Branches with Branch Lengths Below Threshold into Multifurcations" ) ); customizeJMenuItem( _collapse_below_branch_length ); _collapse_below_branch_length - .setToolTipText( "To (permanently) collapse branches with branches with branch lengths below a threshold into multifurcations" ); + .setToolTipText( "To (permanently) collapse branches with branches with branch lengths below a threshold into multifurcations" ); // _tools_menu.addSeparator(); _tools_menu - .add( _extract_tax_code_from_node_names_jmi = new JMenuItem( "Extract Taxonomic Data from Node Names" ) ); + .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'" ); + .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" ) ); + .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" ) ); @@ -2059,15 +2042,15 @@ public final class MainFrameApplication extends MainFrame { customizeJMenuItem( _obtain_seq_information_jmi ); _obtain_seq_information_jmi.setToolTipText( "To add additional sequence information" ); _tools_menu - .add( _obtain_detailed_taxonomic_information_jmi = new JMenuItem( OBTAIN_DETAILED_TAXONOMIC_INFORMATION ) ); + .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)" ); + .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!)" ) ); + .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)" ); + .setToolTipText( "To add additional taxonomic information, deletes nodes for which taxonomy cannot found (from UniProt Taxonomy)" ); _tools_menu.addSeparator(); _tools_menu.add( _read_values_jmi = new JMenuItem( "Attach Vector/Expression Values" ) ); customizeJMenuItem( _read_values_jmi ); @@ -2076,7 +2059,7 @@ public final class MainFrameApplication extends MainFrame { _tools_menu.add( _read_seqs_jmi = new JMenuItem( "Attach Molecular Sequences" ) ); customizeJMenuItem( _read_seqs_jmi ); _read_seqs_jmi - .setToolTipText( "To attach molecular sequences to tree nodes (from Fasta-formatted file) (beta)" ); + .setToolTipText( "To attach molecular sequences to tree nodes (from Fasta-formatted file) (beta)" ); _jmenubar.add( _tools_menu ); } @@ -2094,24 +2077,6 @@ public final class MainFrameApplication extends MainFrame { exit(); } - void executeLineageInference() { - if ( ( _mainpanel.getCurrentPhylogeny() == null ) || ( _mainpanel.getCurrentPhylogeny().isEmpty() ) ) { - return; - } - if ( !_mainpanel.getCurrentPhylogeny().isRooted() ) { - JOptionPane.showMessageDialog( this, - "Phylogeny is not rooted.", - "Cannot infer ancestral taxonomies", - JOptionPane.ERROR_MESSAGE ); - return; - } - final AncestralTaxonomyInferrer inferrer = new AncestralTaxonomyInferrer( this, - _mainpanel.getCurrentTreePanel(), - _mainpanel.getCurrentPhylogeny() - .copy() ); - new Thread( inferrer ).start(); - } - void exit() { removeAllTextFrames(); _mainpanel.terminate(); @@ -2139,7 +2104,7 @@ public final class MainFrameApplication extends MainFrame { } else { parser = ParserUtils.createParserDependingOnUrlContents( url, getConfiguration() - .isValidatePhyloXmlAgainstSchema() ); + .isValidatePhyloXmlAgainstSchema() ); } if ( parser instanceof NexusPhylogeniesParser ) { nhx_or_nexus = true; @@ -2166,8 +2131,8 @@ public final class MainFrameApplication extends MainFrame { JOptionPane.showMessageDialog( this, "Could not read from " + url + "\n" + ForesterUtil.wordWrap( e.getLocalizedMessage(), 80 ), - "Failed to read URL", - JOptionPane.ERROR_MESSAGE ); + "Failed to read URL", + JOptionPane.ERROR_MESSAGE ); } catch ( final Exception e ) { JOptionPane.showMessageDialog( this, @@ -2239,12 +2204,12 @@ public final class MainFrameApplication extends MainFrame { static void warnIfNotPhyloXmlValidation( final Configuration c ) { if ( !c.isValidatePhyloXmlAgainstSchema() ) { JOptionPane - .showMessageDialog( null, - ForesterUtil - .wordWrap( "phyloXML XSD-based validation is turned off [enable with line 'validate_against_phyloxml_xsd_schem: true' in configuration file]", - 80 ), - "Warning", - JOptionPane.WARNING_MESSAGE ); + .showMessageDialog( null, + ForesterUtil + .wordWrap( "phyloXML XSD-based validation is turned off [enable with line 'validate_against_phyloxml_xsd_schem: true' in configuration file]", + 80 ), + "Warning", + JOptionPane.WARNING_MESSAGE ); } } } // MainFrameApplication.