X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=forester%2Fjava%2Fsrc%2Forg%2Fforester%2Farchaeopteryx%2FMainFrame.java;h=4c85a4a28975b5e1e106b0040afba37afdca0825;hb=a9e626aa67ff9cb1649c371f9d705eb04498cc33;hp=80a5ac71285b76ed1e5959c4a6557424c63a8627;hpb=54d8e3a926c3cf3477199c8b85aca478230e223c;p=jalview.git diff --git a/forester/java/src/org/forester/archaeopteryx/MainFrame.java b/forester/java/src/org/forester/archaeopteryx/MainFrame.java index 80a5ac7..4c85a4a 100644 --- a/forester/java/src/org/forester/archaeopteryx/MainFrame.java +++ b/forester/java/src/org/forester/archaeopteryx/MainFrame.java @@ -58,6 +58,7 @@ import org.forester.archaeopteryx.AptxUtil.GraphicsExportType; 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.ProcessPool; import org.forester.archaeopteryx.tools.ProcessRunning; @@ -93,8 +94,8 @@ public abstract class MainFrame extends JFrame implements ActionListener { final static SequencesFileFilter seqsfilter = new SequencesFileFilter(); final static DefaultFilter defaultfilter = new DefaultFilter(); static final String USE_MOUSEWHEEL_SHIFT_TO_ROTATE = "In this display type, use mousewheel + Shift to rotate [or A and S]"; - static final String PHYLOXML_REF_TOOL_TIP = Constants.PHYLOXML_REFERENCE; //TODO //FIXME - static final String APTX_REF_TOOL_TIP = Constants.APTX_REFERENCE; + static final String PHYLOXML_REF_TOOL_TIP = AptxConstants.PHYLOXML_REFERENCE; //TODO //FIXME + static final String APTX_REF_TOOL_TIP = AptxConstants.APTX_REFERENCE; private static final long serialVersionUID = 3655000897845508358L; final static Font menu_font = new Font( Configuration.getDefaultFontFamilyName(), Font.PLAIN, @@ -145,6 +146,8 @@ public abstract class MainFrame extends JFrame implements ActionListener { static final String SHOW_BASIC_TREE_INFORMATION_LABEL = "Basic Tree Information"; static final String RIGHT_LINE_UP_DOMAINS = "Right-align Domain Architectures"; static final String LINE_UP_RENDERABLE_DATA = "Line Up Diagrams (such as Domain Architectures)"; + static final String INFER_ANCESTOR_TAXONOMIES = "Infer Ancestor Taxonomies"; + static final String OBTAIN_DETAILED_TAXONOMIC_INFORMATION = "Obtain Detailed Taxonomic Information"; JMenuBar _jmenubar; JMenu _file_jmenu; JMenu _tools_menu; @@ -250,6 +253,7 @@ public abstract class MainFrame extends JFrame implements ActionListener { JCheckBoxMenuItem _search_whole_words_only_cbmi; JCheckBoxMenuItem _inverse_search_result_cbmi; JCheckBoxMenuItem _search_with_regex_cbmi; + JCheckBoxMenuItem _color_all_found_nodes_when_coloring_subtree_cbmi; // type menu: JMenu _type_menu; JCheckBoxMenuItem _rectangular_type_cbmi; @@ -273,13 +277,12 @@ public abstract class MainFrame extends JFrame implements ActionListener { JMenuItem _phyloxml_ref_item; JMenuItem _aptx_ref_item; // - JFileChooser _writetopdf_filechooser; File _current_dir; + JFileChooser _writetopdf_filechooser; JFileChooser _save_filechooser; JFileChooser _writetographics_filechooser; // process menu: JMenu _process_menu; - // Handy pointers to child components: MainPanel _mainpanel; Container _contentpane; final LinkedList _textframes = new LinkedList(); ; @@ -293,15 +296,27 @@ public abstract class MainFrame extends JFrame implements ActionListener { MainFrame() { _process_pool = ProcessPool.createInstance(); _writetopdf_filechooser = new JFileChooser(); + _writetopdf_filechooser.setMultiSelectionEnabled( false ); + _writetopdf_filechooser.addChoosableFileFilter( pdffilter ); + _writetographics_filechooser = new JFileChooser(); + _writetographics_filechooser.setMultiSelectionEnabled( false ); + _writetographics_filechooser.addChoosableFileFilter( graphicsfilefilter ); _save_filechooser = new JFileChooser(); - _save_filechooser.setCurrentDirectory( new File( "." ) ); _save_filechooser.setMultiSelectionEnabled( false ); _save_filechooser.setFileFilter( xmlfilter ); _save_filechooser.addChoosableFileFilter( nhfilter ); _save_filechooser.addChoosableFileFilter( nexusfilter ); _save_filechooser.addChoosableFileFilter( _save_filechooser.getAcceptAllFileFilter() ); - _writetographics_filechooser = new JFileChooser(); - _writetographics_filechooser.addChoosableFileFilter( MainFrame.graphicsfilefilter ); + try { + final String home_dir = System.getProperty( "user.home" ); + _save_filechooser.setCurrentDirectory( new File( home_dir ) ); + _writetopdf_filechooser.setCurrentDirectory( new File( home_dir ) ); + _writetographics_filechooser.setCurrentDirectory( new File( home_dir ) ); + } + catch ( final Exception e ) { + e.printStackTrace(); + // Do nothing. Not important. + } } /** @@ -520,6 +535,9 @@ public abstract class MainFrame extends JFrame implements ActionListener { getMainPanel().getControlPanel().search0(); getMainPanel().getControlPanel().search1(); } + else if ( o == _color_all_found_nodes_when_coloring_subtree_cbmi ) { + updateOptions( getOptions() ); + } else if ( o == _show_scale_cbmi ) { updateOptions( getOptions() ); } @@ -572,42 +590,42 @@ public abstract class MainFrame extends JFrame implements ActionListener { } else if ( o == _help_item ) { try { - AptxUtil.openWebsite( Constants.APTX_DOC_SITE, is_applet, applet ); + AptxUtil.openWebsite( AptxConstants.APTX_DOC_SITE, is_applet, applet ); } catch ( final IOException e1 ) { - ForesterUtil.printErrorMessage( Constants.PRG_NAME, e1.toString() ); + ForesterUtil.printErrorMessage( AptxConstants.PRG_NAME, e1.toString() ); } } else if ( o == _website_item ) { try { - AptxUtil.openWebsite( Constants.APTX_WEB_SITE, is_applet, applet ); + AptxUtil.openWebsite( AptxConstants.APTX_WEB_SITE, is_applet, applet ); } catch ( final IOException e1 ) { - ForesterUtil.printErrorMessage( Constants.PRG_NAME, e1.toString() ); + ForesterUtil.printErrorMessage( AptxConstants.PRG_NAME, e1.toString() ); } } else if ( o == _phyloxml_website_item ) { try { - AptxUtil.openWebsite( Constants.PHYLOXML_WEB_SITE, is_applet, applet ); + AptxUtil.openWebsite( AptxConstants.PHYLOXML_WEB_SITE, is_applet, applet ); } catch ( final IOException e1 ) { - ForesterUtil.printErrorMessage( Constants.PRG_NAME, e1.toString() ); + ForesterUtil.printErrorMessage( AptxConstants.PRG_NAME, e1.toString() ); } } else if ( o == _aptx_ref_item ) { try { - AptxUtil.openWebsite( Constants.APTX_REFERENCE_URL, is_applet, applet ); + AptxUtil.openWebsite( AptxConstants.APTX_REFERENCE_URL, is_applet, applet ); } catch ( final IOException e1 ) { - ForesterUtil.printErrorMessage( Constants.PRG_NAME, e1.toString() ); + ForesterUtil.printErrorMessage( AptxConstants.PRG_NAME, e1.toString() ); } } else if ( o == _phyloxml_ref_item ) { try { - AptxUtil.openWebsite( Constants.PHYLOXML_REFERENCE_URL, is_applet, applet ); + AptxUtil.openWebsite( AptxConstants.PHYLOXML_REFERENCE_URL, is_applet, applet ); } catch ( final IOException e1 ) { - ForesterUtil.printErrorMessage( Constants.PRG_NAME, e1.toString() ); + ForesterUtil.printErrorMessage( AptxConstants.PRG_NAME, e1.toString() ); } } else if ( o == _write_to_pdf_item ) { @@ -719,6 +737,16 @@ public abstract class MainFrame extends JFrame implements ActionListener { else if ( o == _choose_pdf_width_mi ) { choosePdfWidth(); } + else if ( o == _lineage_inference ) { + if ( isSubtreeDisplayed() ) { + JOptionPane.showMessageDialog( this, + "Subtree is shown.", + "Cannot infer ancestral taxonomies", + JOptionPane.ERROR_MESSAGE ); + return; + } + executeLineageInference(); + } else { if ( _load_phylogeny_from_webservice_menu_items != null ) { for( int i = 0; i < _load_phylogeny_from_webservice_menu_items.length; ++i ) { @@ -801,10 +829,10 @@ public abstract class MainFrame extends JFrame implements ActionListener { } if ( ( nodes == null ) || nodes.isEmpty() ) { JOptionPane - .showMessageDialog( this, - "Need to select nodes, either via direct selection or via the \"Search\" function", - "No nodes selected for annotation", - JOptionPane.ERROR_MESSAGE ); + .showMessageDialog( this, + "Need to select nodes, either via direct selection or via the \"Search\" function", + "No nodes selected for annotation", + JOptionPane.ERROR_MESSAGE ); return; } final Phylogeny phy = getMainPanel().getCurrentPhylogeny(); @@ -823,7 +851,7 @@ public abstract class MainFrame extends JFrame implements ActionListener { my_panel, "Enter the sequence annotation(s) for the " + nodes.size() + " selected nodes", - JOptionPane.OK_CANCEL_OPTION ); + JOptionPane.OK_CANCEL_OPTION ); if ( result == JOptionPane.OK_OPTION ) { String ref = ref_field.getText(); String desc = desc_filed.getText(); @@ -850,7 +878,7 @@ public abstract class MainFrame extends JFrame implements ActionListener { for( final PhylogenyNode n : nodes ) { ForesterUtil.ensurePresenceOfSequence( n ); final Annotation ann = ForesterUtil.isEmpty( ref ) ? new Annotation() - : new Annotation( ref ); + : new Annotation( ref ); if ( !ForesterUtil.isEmpty( desc ) ) { ann.setDesc( desc ); } @@ -875,11 +903,11 @@ public abstract class MainFrame extends JFrame implements ActionListener { .showInputDialog( this, "Please enter the minimum for confidence values to be displayed.\n" + "[current value: " + getOptions().getMinConfidenceValue() + "]\n", - "Minimal Confidence Value", - JOptionPane.QUESTION_MESSAGE, - null, - null, - getOptions().getMinConfidenceValue() ); + "Minimal Confidence Value", + JOptionPane.QUESTION_MESSAGE, + null, + null, + getOptions().getMinConfidenceValue() ); if ( !ForesterUtil.isEmpty( s ) ) { boolean success = true; double m = 0.0; @@ -921,10 +949,10 @@ public abstract class MainFrame extends JFrame implements ActionListener { } if ( ( nodes == null ) || nodes.isEmpty() ) { JOptionPane - .showMessageDialog( this, - "Need to select external nodes, either via direct selection or via the \"Search\" function", - "No external nodes selected to " + function.toLowerCase(), - JOptionPane.ERROR_MESSAGE ); + .showMessageDialog( this, + "Need to select external nodes, either via direct selection or via the \"Search\" function", + "No external nodes selected to " + function.toLowerCase(), + JOptionPane.ERROR_MESSAGE ); return; } final int todo = nodes.size(); @@ -941,8 +969,8 @@ public abstract class MainFrame extends JFrame implements ActionListener { return; } final int result = JOptionPane.showConfirmDialog( null, function + " " + todo - + " external node(s), from a total of " + ext + " external nodes," + "\nresulting in tree with " + res - + " nodes?", function + " external nodes", JOptionPane.OK_CANCEL_OPTION ); + + " external node(s), from a total of " + ext + " external nodes," + "\nresulting in tree with " + res + + " nodes?", function + " external nodes", JOptionPane.OK_CANCEL_OPTION ); if ( result == JOptionPane.OK_OPTION ) { if ( !delete ) { final List to_delete = new ArrayList(); @@ -1212,11 +1240,11 @@ public abstract class MainFrame extends JFrame implements ActionListener { "Please enter the default line width for PDF export.\n" + "[current value: " + getOptions().getPrintLineWidth() + "]\n", - "Line Width for PDF Export", - JOptionPane.QUESTION_MESSAGE, - null, - null, - getOptions().getPrintLineWidth() ); + "Line Width for PDF Export", + JOptionPane.QUESTION_MESSAGE, + null, + null, + getOptions().getPrintLineWidth() ); if ( !ForesterUtil.isEmpty( s ) ) { boolean success = true; float f = 0.0f; @@ -1244,16 +1272,16 @@ public abstract class MainFrame extends JFrame implements ActionListener { + "[current values: " + getOptions().getPrintSizeX() + ", " + getOptions().getPrintSizeY() + "]\n" - + "[A4: " + Constants.A4_SIZE_X + ", " - + Constants.A4_SIZE_Y + "]\n" + "[US Letter: " - + Constants.US_LETTER_SIZE_X + ", " - + Constants.US_LETTER_SIZE_Y + "]", - "Default Size for Graphics Export", - JOptionPane.QUESTION_MESSAGE, - null, - null, - getOptions().getPrintSizeX() + ", " - + getOptions().getPrintSizeY() ); + + "[A4: " + AptxConstants.A4_SIZE_X + ", " + + AptxConstants.A4_SIZE_Y + "]\n" + "[US Letter: " + + AptxConstants.US_LETTER_SIZE_X + ", " + + AptxConstants.US_LETTER_SIZE_Y + "]", + "Default Size for Graphics Export", + JOptionPane.QUESTION_MESSAGE, + null, + null, + getOptions().getPrintSizeX() + ", " + + getOptions().getPrintSizeY() ); if ( !ForesterUtil.isEmpty( s ) && ( s.indexOf( ',' ) > 0 ) ) { boolean success = true; int x = 0; @@ -1432,8 +1460,8 @@ public abstract class MainFrame extends JFrame implements ActionListener { + gsdi.getStrippedExternalGeneTreeNodes().size() + "\n" + "Taxonomy linkage based on: " + gsdi.getTaxCompBase() + "\n" + "Number of polytomies in species tree used: " + poly + "\n", - "GSDI successfully completed", - JOptionPane.WARNING_MESSAGE ); + "GSDI successfully completed", + JOptionPane.WARNING_MESSAGE ); } else { JOptionPane.showMessageDialog( this, @@ -1445,8 +1473,8 @@ public abstract class MainFrame extends JFrame implements ActionListener { + gsdi.getStrippedExternalGeneTreeNodes().size() + "\n" + "Taxonomy linkage based on: " + gsdi.getTaxCompBase() + "\n" + "Number of polytomies in species tree used: " + poly + "\n", - "GSDI successfully completed", - JOptionPane.INFORMATION_MESSAGE ); + "GSDI successfully completed", + JOptionPane.INFORMATION_MESSAGE ); } } @@ -1505,8 +1533,8 @@ public abstract class MainFrame extends JFrame implements ActionListener { + gsdir.getStrippedExternalGeneTreeNodes().size() + "\n" + "Taxonomy linkage based on: " + gsdir.getTaxCompBase() + "\n" + "Number of polytomies in species tree used: " + poly + "\n", - "GSDIR successfully completed", - JOptionPane.WARNING_MESSAGE ); + "GSDIR successfully completed", + JOptionPane.WARNING_MESSAGE ); } else { JOptionPane.showMessageDialog( this, @@ -1516,11 +1544,29 @@ public abstract class MainFrame extends JFrame implements ActionListener { + gsdir.getStrippedExternalGeneTreeNodes().size() + "\n" + "Taxonomy linkage based on: " + gsdir.getTaxCompBase() + "\n" + "Number of polytomies in species tree used: " + poly + "\n", - "GSDIR successfully completed", - JOptionPane.INFORMATION_MESSAGE ); + "GSDIR successfully completed", + JOptionPane.INFORMATION_MESSAGE ); } } + 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(); + } + boolean GAndSDoHaveMoreThanOneSpeciesInComman( final Phylogeny gene_tree ) { if ( ( gene_tree == null ) || gene_tree.isEmpty() ) { JOptionPane.showMessageDialog( this, @@ -1651,10 +1697,10 @@ public abstract class MainFrame extends JFrame implements ActionListener { if ( getCurrentTreePanel() != null ) { if ( getCurrentTreePanel().isCurrentTreeIsSubtree() ) { JOptionPane - .showMessageDialog( this, - "This operation can only be performed on a complete tree, not on the currently displayed sub-tree only.", - "Operation can not be exectuted on a sub-tree", - JOptionPane.WARNING_MESSAGE ); + .showMessageDialog( this, + "This operation can only be performed on a complete tree, not on the currently displayed sub-tree only.", + "Operation can not be exectuted on a sub-tree", + JOptionPane.WARNING_MESSAGE ); return true; } } @@ -1805,20 +1851,20 @@ public abstract class MainFrame extends JFrame implements ActionListener { void updateOptions( final Options options ) { options.setAntialiasScreen( ( _screen_antialias_cbmi != null ) && _screen_antialias_cbmi.isSelected() ); options.setBackgroundColorGradient( ( _background_gradient_cbmi != null ) - && _background_gradient_cbmi.isSelected() ); + && _background_gradient_cbmi.isSelected() ); options.setShowDomainLabels( ( _show_domain_labels != null ) && _show_domain_labels.isSelected() ); options.setShowAnnotationRefSource( ( _show_annotation_ref_source != null ) - && _show_annotation_ref_source.isSelected() ); + && _show_annotation_ref_source.isSelected() ); options.setAbbreviateScientificTaxonNames( ( _abbreviate_scientific_names != null ) - && _abbreviate_scientific_names.isSelected() ); + && _abbreviate_scientific_names.isSelected() ); options.setColorLabelsSameAsParentBranch( ( _color_labels_same_as_parent_branch != null ) - && _color_labels_same_as_parent_branch.isSelected() ); + && _color_labels_same_as_parent_branch.isSelected() ); options.setShowDefaultNodeShapesInternal( ( _show_default_node_shapes_internal_cbmi != null ) - && _show_default_node_shapes_internal_cbmi.isSelected() ); + && _show_default_node_shapes_internal_cbmi.isSelected() ); options.setShowDefaultNodeShapesExternal( ( _show_default_node_shapes_external_cbmi != null ) - && _show_default_node_shapes_external_cbmi.isSelected() ); + && _show_default_node_shapes_external_cbmi.isSelected() ); options.setShowDefaultNodeShapesForMarkedNodes( ( _show_default_node_shapes_for_marked_cbmi != null ) - && _show_default_node_shapes_for_marked_cbmi.isSelected() ); + && _show_default_node_shapes_for_marked_cbmi.isSelected() ); if ( ( _non_lined_up_cladograms_rbmi != null ) && ( _non_lined_up_cladograms_rbmi.isSelected() ) ) { options.setCladogramType( CLADOGRAM_TYPE.NON_LINED_UP ); } @@ -1829,7 +1875,7 @@ public abstract class MainFrame extends JFrame implements ActionListener { options.setCladogramType( CLADOGRAM_TYPE.EXT_NODE_SUM_DEP ); } options.setSearchCaseSensitive( ( _search_case_senstive_cbmi != null ) - && _search_case_senstive_cbmi.isSelected() ); + && _search_case_senstive_cbmi.isSelected() ); if ( ( _show_scale_cbmi != null ) && _show_scale_cbmi.isEnabled() ) { options.setShowScale( _show_scale_cbmi.isSelected() ); } @@ -1843,14 +1889,14 @@ public abstract class MainFrame extends JFrame implements ActionListener { } options.setShowOverview( ( _show_overview_cbmi != null ) && _show_overview_cbmi.isSelected() ); options.setShowConfidenceStddev( ( _show_confidence_stddev_cbmi != null ) - && _show_confidence_stddev_cbmi.isSelected() ); + && _show_confidence_stddev_cbmi.isSelected() ); if ( ( _color_by_taxonomic_group_cbmi != null ) && _color_by_taxonomic_group_cbmi.isEnabled() ) { options.setColorByTaxonomicGroup( _color_by_taxonomic_group_cbmi.isSelected() ); } options.setPrintUsingActualSize( ( _print_using_actual_size_cbmi != null ) - && ( _print_using_actual_size_cbmi.isSelected() ) ); + && ( _print_using_actual_size_cbmi.isSelected() ) ); options.setGraphicsExportUsingActualSize( ( _graphics_export_using_actual_size_cbmi != null ) - && ( _graphics_export_using_actual_size_cbmi.isSelected() ) ); + && ( _graphics_export_using_actual_size_cbmi.isSelected() ) ); options.setAntialiasPrint( ( _antialias_print_cbmi != null ) && _antialias_print_cbmi.isSelected() ); if ( ( _use_brackets_for_conf_in_nh_export_cbmi != null ) && _use_brackets_for_conf_in_nh_export_cbmi.isSelected() ) { @@ -1864,9 +1910,9 @@ public abstract class MainFrame extends JFrame implements ActionListener { options.setNhConversionSupportValueStyle( NH_CONVERSION_SUPPORT_VALUE_STYLE.NONE ); } options.setPrintBlackAndWhite( ( _print_black_and_white_cbmi != null ) - && _print_black_and_white_cbmi.isSelected() ); + && _print_black_and_white_cbmi.isSelected() ); options.setInternalNumberAreConfidenceForNhParsing( ( _internal_number_are_confidence_for_nh_parsing_cbmi != null ) - && _internal_number_are_confidence_for_nh_parsing_cbmi.isSelected() ); + && _internal_number_are_confidence_for_nh_parsing_cbmi.isSelected() ); if ( ( _extract_taxonomy_pfam_strict_rbmi != null ) && _extract_taxonomy_pfam_strict_rbmi.isSelected() ) { options.setTaxonomyExtraction( TAXONOMY_EXTRACTION.PFAM_STYLE_STRICT ); } @@ -1880,14 +1926,14 @@ public abstract class MainFrame extends JFrame implements ActionListener { options.setTaxonomyExtraction( TAXONOMY_EXTRACTION.NO ); } options.setReplaceUnderscoresInNhParsing( ( _replace_underscores_cbmi != null ) - && _replace_underscores_cbmi.isSelected() ); + && _replace_underscores_cbmi.isSelected() ); options.setAllowErrorsInDistanceToParent( ( _allow_errors_in_distance_to_parent_cbmi != null ) - && _allow_errors_in_distance_to_parent_cbmi.isSelected() ); + && _allow_errors_in_distance_to_parent_cbmi.isSelected() ); options.setMatchWholeTermsOnly( ( _search_whole_words_only_cbmi != null ) - && _search_whole_words_only_cbmi.isSelected() ); + && _search_whole_words_only_cbmi.isSelected() ); options.setSearchWithRegex( ( _search_with_regex_cbmi != null ) && _search_with_regex_cbmi.isSelected() ); options.setInverseSearchResult( ( _inverse_search_result_cbmi != null ) - && _inverse_search_result_cbmi.isSelected() ); + && _inverse_search_result_cbmi.isSelected() ); if ( _graphics_export_visible_only_cbmi != null ) { options.setGraphicsExportVisibleOnly( _graphics_export_visible_only_cbmi.isSelected() ); if ( _graphics_export_visible_only_cbmi.isSelected() && ( _graphics_export_using_actual_size_cbmi != null ) ) { @@ -1928,6 +1974,9 @@ public abstract class MainFrame extends JFrame implements ActionListener { if ( ( _line_up_renderable_data_cbmi != null ) && _line_up_renderable_data_cbmi.isEnabled() ) { options.setLineUpRendarableNodeData( _line_up_renderable_data_cbmi.isSelected() ); } + if ( ( _color_all_found_nodes_when_coloring_subtree_cbmi != null ) && _color_all_found_nodes_when_coloring_subtree_cbmi.isEnabled() ) { + options.setColorAllFoundNodesWhenColoringSubtree( _color_all_found_nodes_when_coloring_subtree_cbmi.isSelected() ); + } } void updateTypeCheckboxes( final Options options, final Object o ) { @@ -1953,8 +2002,8 @@ public abstract class MainFrame extends JFrame implements ActionListener { title = "\"" + getMainPanel().getCurrentPhylogeny().getName() + "\" in " + title; } showTextFrame( _mainpanel.getCurrentPhylogeny().toNewHampshire( getOptions() - .getNhConversionSupportValueStyle() ), - title ); + .getNhConversionSupportValueStyle() ), + title ); } } @@ -2007,11 +2056,11 @@ public abstract class MainFrame extends JFrame implements ActionListener { * Display the about box. */ static void about() { - final StringBuffer about = new StringBuffer( "Archaeopteryx\nVersion " + Constants.VERSION + "\n" ); - about.append( "Copyright (C) 2014 Christian M Zmasek\n" ); + final StringBuffer about = new StringBuffer( "Archaeopteryx\nVersion " + AptxConstants.VERSION + "\n" ); + about.append( "Copyright (C) 2016 Christian M Zmasek\n" ); about.append( "All Rights Reserved\n" ); about.append( "License: GNU Lesser General Public License (LGPL)\n" ); - about.append( "Last modified: " + Constants.PRG_DATE + "\n" ); + about.append( "Last modified: " + AptxConstants.PRG_DATE + "\n" ); about.append( "Based on: " + ForesterUtil.getForesterLibraryInformation() + "\n" ); about.append( "phyloXML version : " + ForesterConstants.PHYLO_XML_VERSION + "\n" ); about.append( "phyloXML location: " + ForesterConstants.PHYLO_XML_LOCATION + "\n" ); @@ -2029,13 +2078,13 @@ public abstract class MainFrame extends JFrame implements ActionListener { about.append( "[free memory: " + free_memory + "MB, total memory: " + total_memory + "MB]\n" ); about.append( "[locale: " + Locale.getDefault() + "]\n" ); about.append( "References:\n" ); - about.append( Constants.PHYLOXML_REFERENCE_SHORT + "\n" ); + about.append( AptxConstants.PHYLOXML_REFERENCE_SHORT + "\n" ); about.append( "For more information & download:\n" ); - about.append( Constants.APTX_WEB_SITE + "\n" ); + about.append( AptxConstants.APTX_WEB_SITE + "\n" ); about.append( "Documentation:\n" ); - about.append( Constants.APTX_DOC_SITE + "\n" ); - about.append( "Comments: " + Constants.AUTHOR_EMAIL ); - JOptionPane.showMessageDialog( null, about, Constants.PRG_NAME, JOptionPane.PLAIN_MESSAGE ); + about.append( AptxConstants.APTX_DOC_SITE + "\n" ); + about.append( "Comments: " + AptxConstants.AUTHOR_EMAIL ); + JOptionPane.showMessageDialog( null, about, AptxConstants.PRG_NAME, JOptionPane.PLAIN_MESSAGE ); } static void chooseNodeSize( final Options options, final Component parent ) { @@ -2043,11 +2092,11 @@ public abstract class MainFrame extends JFrame implements ActionListener { "Please enter the default size for node shapes.\n" + "[current value: " + options.getDefaultNodeShapeSize() + "]\n", - "Node Shape Size", - JOptionPane.QUESTION_MESSAGE, - null, - null, - options.getDefaultNodeShapeSize() ); + "Node Shape Size", + JOptionPane.QUESTION_MESSAGE, + null, + null, + options.getDefaultNodeShapeSize() ); if ( !ForesterUtil.isEmpty( s ) ) { boolean success = true; double m = 0.0; @@ -2168,7 +2217,7 @@ public abstract class MainFrame extends JFrame implements ActionListener { tp.resetPreferredSize(); tp.repaint(); } - final String job_name = Constants.PRG_NAME; + final String job_name = AptxConstants.PRG_NAME; boolean error = false; String printer_name = null; try { @@ -2227,8 +2276,8 @@ public abstract class MainFrame extends JFrame implements ActionListener { JOptionPane.showMessageDialog( comp, "There was an unknown problem when attempting to write to PDF file: \"" + file_name + "\"", - "Error", - JOptionPane.ERROR_MESSAGE ); + "Error", + JOptionPane.ERROR_MESSAGE ); } } if ( !opts.isPrintUsingActualSize() ) { @@ -2277,7 +2326,7 @@ public abstract class MainFrame extends JFrame implements ActionListener { static void setTextColorChooseMenuItem( final JMenuItem mi, final TreePanel tree_panel ) { if ( ( tree_panel != null ) && ( tree_panel.getTreeColorSet() != null ) ) { mi.setText( "Select Color Scheme... (current: " + tree_panel.getTreeColorSet().getCurrentColorSchemeName() - + ")" ); + + ")" ); } else { mi.setText( "Select Color Scheme..." ); @@ -2389,8 +2438,8 @@ public abstract class MainFrame extends JFrame implements ActionListener { JOptionPane.showMessageDialog( comp, "There was an unknown problem when attempting to write to an image file: \"" + file_name + "\"", - "Error", - JOptionPane.ERROR_MESSAGE ); + "Error", + JOptionPane.ERROR_MESSAGE ); } } contentpane.repaint(); @@ -2440,7 +2489,7 @@ public abstract class MainFrame extends JFrame implements ActionListener { return null; } else { - final File to = new File( file.getAbsoluteFile().toString() + Constants.BACKUP_FILE_SUFFIX ); + final File to = new File( file.getAbsoluteFile().toString() + AptxConstants.BACKUP_FILE_SUFFIX ); try { ForesterUtil.copyFile( file, to ); }