From 7e567e18a5ba32035a8db4ca041023c9e862d25b Mon Sep 17 00:00:00 2001 From: "cmzmasek@gmail.com" Date: Wed, 20 Aug 2014 01:07:03 +0000 Subject: [PATCH] clean up --- .../analysis/AncestralTaxonomyInference.java | 2 +- .../org/forester/analysis/TaxonomyDataManager.java | 2 +- .../org/forester/application/msa_compactor.java | 2 +- .../java/src/org/forester/application/rio.java | 8 +- .../src/org/forester/application/surfacing.java | 2 +- .../src/org/forester/archaeopteryx/AptxUtil.java | 1 - .../org/forester/archaeopteryx/ArchaeopteryxE.java | 17 +- .../org/forester/archaeopteryx/Configuration.java | 30 +-- .../src/org/forester/archaeopteryx/Constants.java | 11 +- .../org/forester/archaeopteryx/ControlPanel.java | 228 ++++++++++---------- .../src/org/forester/archaeopteryx/MainFrame.java | 24 +-- .../forester/archaeopteryx/MainFrameApplet.java | 1 - .../archaeopteryx/MainFrameApplication.java | 12 +- .../src/org/forester/archaeopteryx/Options.java | 25 +-- .../org/forester/archaeopteryx/TreeColorSet.java | 13 +- .../src/org/forester/archaeopteryx/TreePanel.java | 15 +- .../org/forester/archaeopteryx/TreePanelUtil.java | 4 +- .../phylogeny/data/RenderablePhylogenyData.java | 2 +- .../phylogeny/data/RenderableVector.java | 23 +- .../evoinference/distance/NeighborJoining.java | 8 +- .../evoinference/distance/NeighborJoiningF.java | 8 +- .../evoinference/distance/NeighborJoiningR.java | 4 +- .../org/forester/evoinference/distance/Sarray.java | 2 +- .../src/org/forester/go/BasicGoRelationship.java | 2 +- .../java/src/org/forester/go/GoRelationship.java | 2 +- .../java/src/org/forester/msa/DeleteableMsa.java | 10 +- .../org/forester/phylogeny/PhylogenyMethods.java | 2 +- .../src/org/forester/phylogeny/data/NodeData.java | 2 +- .../src/org/forester/phylogeny/data/Taxonomy.java | 2 +- forester/java/src/org/forester/rio/RIO.java | 2 +- .../AdjactantDirectedBinaryDomainCombination.java | 2 +- .../surfacing/BasicBinaryDomainCombination.java | 2 +- .../surfacing/DirectedBinaryDomainCombination.java | 2 +- .../org/forester/surfacing/DomainSimilarity.java | 2 + 34 files changed, 202 insertions(+), 272 deletions(-) diff --git a/forester/java/src/org/forester/analysis/AncestralTaxonomyInference.java b/forester/java/src/org/forester/analysis/AncestralTaxonomyInference.java index 11d678d..25021bc 100644 --- a/forester/java/src/org/forester/analysis/AncestralTaxonomyInference.java +++ b/forester/java/src/org/forester/analysis/AncestralTaxonomyInference.java @@ -65,7 +65,7 @@ public final class AncestralTaxonomyInference { || !ForesterUtil.isEmpty( desc.getNodeData().getTaxonomy().getScientificName() ) || !ForesterUtil.isEmpty( desc.getNodeData().getTaxonomy().getLineage() ) || !ForesterUtil.isEmpty( desc.getNodeData().getTaxonomy().getTaxonomyCode() ) || !ForesterUtil - .isEmpty( desc.getNodeData().getTaxonomy().getCommonName() ) ) ) { + .isEmpty( desc.getNodeData().getTaxonomy().getCommonName() ) ) ) { final UniProtTaxonomy up_tax = TaxonomyDataManager.obtainUniProtTaxonomy( desc.getNodeData() .getTaxonomy(), null, null ); if ( ( up_tax == null ) && ForesterUtil.isEmpty( desc.getNodeData().getTaxonomy().getLineage() ) ) { diff --git a/forester/java/src/org/forester/analysis/TaxonomyDataManager.java b/forester/java/src/org/forester/analysis/TaxonomyDataManager.java index 6301504..fbc8d0c 100644 --- a/forester/java/src/org/forester/analysis/TaxonomyDataManager.java +++ b/forester/java/src/org/forester/analysis/TaxonomyDataManager.java @@ -251,7 +251,7 @@ public final class TaxonomyDataManager extends RunnableProcess { if ( ( ( tax != null ) && ( isHasAppropriateId( tax ) || !ForesterUtil.isEmpty( tax.getScientificName() ) || !ForesterUtil.isEmpty( tax.getTaxonomyCode() ) || !ForesterUtil - .isEmpty( tax.getCommonName() ) ) ) ) { + .isEmpty( tax.getCommonName() ) ) ) ) { uniprot_tax = obtainUniProtTaxonomy( tax, null, qt ); } else { diff --git a/forester/java/src/org/forester/application/msa_compactor.java b/forester/java/src/org/forester/application/msa_compactor.java index 4e51675..329af42 100644 --- a/forester/java/src/org/forester/application/msa_compactor.java +++ b/forester/java/src/org/forester/application/msa_compactor.java @@ -145,7 +145,7 @@ public class msa_compactor { } if ( cla.isOptionSet( REMOVE_WORST_OFFENDERS_OPTION ) ) { worst_remove = cla.getOptionValueAsInt( REMOVE_WORST_OFFENDERS_OPTION ); - if ( ( worst_remove < 1 ) || ( worst_remove >= msa.getNumberOfSequences() - 1 ) ) { + if ( ( worst_remove < 1 ) || ( worst_remove >= ( msa.getNumberOfSequences() - 1 ) ) ) { ForesterUtil.fatalError( PRG_NAME, "number of worst offender sequences to remove is out of range: " + worst_remove ); } diff --git a/forester/java/src/org/forester/application/rio.java b/forester/java/src/org/forester/application/rio.java index 51a36bf..27c4ee0 100644 --- a/forester/java/src/org/forester/application/rio.java +++ b/forester/java/src/org/forester/application/rio.java @@ -382,15 +382,15 @@ public class rio { final java.text.DecimalFormat df = new java.text.DecimalFormat( "0.#" ); System.out.println( "Mean number of duplications : " + df.format( stats.arithmeticMean() ) + " (sd: " + df.format( stats.sampleStandardDeviation() ) + ") (" - + df.format( 100.0 * stats.arithmeticMean() / rio.getIntNodesOfAnalyzedGeneTrees() ) + "%)" ); + + df.format( ( 100.0 * stats.arithmeticMean() ) / rio.getIntNodesOfAnalyzedGeneTrees() ) + "%)" ); if ( stats.getN() > 3 ) { System.out.println( "Median number of duplications: " + df.format( stats.median() ) + " (" - + df.format( 100.0 * stats.median() / rio.getIntNodesOfAnalyzedGeneTrees() ) + "%)" ); + + df.format( ( 100.0 * stats.median() ) / rio.getIntNodesOfAnalyzedGeneTrees() ) + "%)" ); } System.out.println( "Minimum duplications : " + ( int ) stats.getMin() + " (" - + df.format( 100.0 * stats.getMin() / rio.getIntNodesOfAnalyzedGeneTrees() ) + "%)" ); + + df.format( ( 100.0 * stats.getMin() ) / rio.getIntNodesOfAnalyzedGeneTrees() ) + "%)" ); System.out.println( "Maximum duplications : " + ( int ) stats.getMax() + " (" - + df.format( 100.0 * stats.getMax() / rio.getIntNodesOfAnalyzedGeneTrees() ) + "%)" ); + + df.format( ( 100.0 * stats.getMax() ) / rio.getIntNodesOfAnalyzedGeneTrees() ) + "%)" ); System.out.println( "Gene tree internal nodes : " + rio.getIntNodesOfAnalyzedGeneTrees() ); System.out.println( "Gene tree external nodes : " + rio.getExtNodesOfAnalyzedGeneTrees() ); } diff --git a/forester/java/src/org/forester/application/surfacing.java b/forester/java/src/org/forester/application/surfacing.java index a05cac3..141db17 100644 --- a/forester/java/src/org/forester/application/surfacing.java +++ b/forester/java/src/org/forester/application/surfacing.java @@ -2193,7 +2193,7 @@ public class surfacing { System.out.println(); System.out .println( "Example 1: surfacing -p2g=pfam2go.txt -obo=go.obo -species_tree=tol_156.xml -no_eo -ie=0.01 -dufs -genomes=genomes_all.txt -pos_filter=tf_1.txt -out_dir=_tf1 -o=tf1" ); -System.out.println(); + System.out.println(); System.out .println( "Example 2: surfacing -p2g=pfam2go.txt -obo=go.obo -species_tree=tol_156.xml -last -ignore_viral_ids -no_eo -ie=0.1 -dufs -genomes=genomes_all.txt -pos_filter=tf_1.txt -all_prot -all_prot_e=0.1 -out_dir=_tf1_e01_ape01 -o=tf1_e01_ape01" ); System.out.println(); diff --git a/forester/java/src/org/forester/archaeopteryx/AptxUtil.java b/forester/java/src/org/forester/archaeopteryx/AptxUtil.java index 38ac2b1..e95283d 100644 --- a/forester/java/src/org/forester/archaeopteryx/AptxUtil.java +++ b/forester/java/src/org/forester/archaeopteryx/AptxUtil.java @@ -947,7 +947,6 @@ public final class AptxUtil { } } - public static enum GraphicsExportType { BMP( "bmp" ), GIF( "gif" ), JPG( "jpg" ), PDF( "pdf" ), PNG( "png" ), TIFF( "tif" ); diff --git a/forester/java/src/org/forester/archaeopteryx/ArchaeopteryxE.java b/forester/java/src/org/forester/archaeopteryx/ArchaeopteryxE.java index 95f546c..ece59e5 100644 --- a/forester/java/src/org/forester/archaeopteryx/ArchaeopteryxE.java +++ b/forester/java/src/org/forester/archaeopteryx/ArchaeopteryxE.java @@ -132,10 +132,8 @@ public class ArchaeopteryxE extends JApplet implements ActionListener { private JMenuItem _gsdi_item; private JMenuItem _gsdir_item; private Phylogeny _species_tree; - - private JCheckBoxMenuItem _right_line_up_domains_cbmi; - private JCheckBoxMenuItem _line_up_renderable_data_cbmi; - + private JCheckBoxMenuItem _right_line_up_domains_cbmi; + private JCheckBoxMenuItem _line_up_renderable_data_cbmi; @Override public void actionPerformed( final ActionEvent e ) { @@ -353,9 +351,6 @@ public class ArchaeopteryxE extends JApplet implements ActionListener { else if ( o == _color_by_taxonomic_group_cbmi ) { updateOptions( getOptions() ); } - - - else if ( o == _line_up_renderable_data_cbmi ) { if ( !_line_up_renderable_data_cbmi.isSelected() ) { _right_line_up_domains_cbmi.setSelected( false ); @@ -368,7 +363,6 @@ public class ArchaeopteryxE extends JApplet implements ActionListener { } updateOptions( getOptions() ); } - repaint(); } @@ -1102,8 +1096,6 @@ public class ArchaeopteryxE extends JApplet implements ActionListener { return _options; } - - void initializeTypeMenu( final Options options ) { setTypeMenuToAllUnselected(); try { @@ -1372,17 +1364,12 @@ public class ArchaeopteryxE extends JApplet implements ActionListener { if ( ( _color_by_taxonomic_group_cbmi != null ) && _color_by_taxonomic_group_cbmi.isEnabled() ) { options.setColorByTaxonomicGroup( _color_by_taxonomic_group_cbmi.isSelected() ); } - - if ( ( _right_line_up_domains_cbmi != null ) && _right_line_up_domains_cbmi.isEnabled() ) { options.setRightLineUpDomains( _right_line_up_domains_cbmi.isSelected() ); } - - if ( ( _line_up_renderable_data_cbmi != null ) && _line_up_renderable_data_cbmi.isEnabled() ) { options.setLineUpRendarableNodeData( _line_up_renderable_data_cbmi.isSelected() ); } - } void updateTypeCheckboxes( final Options options, final Object o ) { diff --git a/forester/java/src/org/forester/archaeopteryx/Configuration.java b/forester/java/src/org/forester/archaeopteryx/Configuration.java index c1a1096..5debb52 100644 --- a/forester/java/src/org/forester/archaeopteryx/Configuration.java +++ b/forester/java/src/org/forester/archaeopteryx/Configuration.java @@ -220,9 +220,8 @@ public final class Configuration { private Color _vector_data_mean_color = Color.WHITE; private double _vector_data_height = 12; private int _vector_data_width = 120; - private boolean _line_up_renderable_node_data; - private boolean _right_align_domains; - + private boolean _line_up_renderable_node_data; + private boolean _right_align_domains; static { for( final String font_name : Constants.DEFAULT_FONT_CHOICES ) { if ( Arrays.binarySearch( AptxUtil.getAvailableFontFamiliesSorted(), font_name ) >= 0 ) { @@ -1378,7 +1377,6 @@ public final class Configuration { else if ( key.equals( "gui_button_border_color" ) ) { _gui_button_border_color = Color.decode( ( String ) st.nextElement() ); } - else if ( key.equals( "show_default_node_shapes" ) ) { ForesterUtil .printWarningMessage( Constants.PRG_NAME, @@ -1495,7 +1493,6 @@ public final class Configuration { + "] for [ext_descendents_data_to_return_on]" ); } } - else if ( key.equals( "vector_data_min_color" ) ) { _vector_data_min_color = Color.decode( ( String ) st.nextElement() ); } @@ -1505,7 +1502,6 @@ public final class Configuration { else if ( key.equals( "vector_data_mean_color" ) ) { _vector_data_mean_color = Color.decode( ( String ) st.nextElement() ); } - else if ( key.equals( "vector_data_width" ) ) { _vector_data_width = parseShort( ( String ) st.nextElement() ); if ( _vector_data_width < 1 ) { @@ -1518,16 +1514,12 @@ public final class Configuration { _vector_data_height = 12; } } - else if ( key.equals( "line_up_renderable_data" ) ) { setLineUpRendarableNodeData( parseBoolean( ( String ) st.nextElement() ) ); } - else if ( key.equals( "right_align_domain_architectures" ) ) { setRightLineUpDomains( parseBoolean( ( String ) st.nextElement() ) ); } - - else if ( st.countTokens() >= 2 ) { // counts the tokens that are not // yet retrieved! int key_index = -1; @@ -1759,26 +1751,20 @@ public final class Configuration { public int getVectorDataWidth() { return _vector_data_width; } - + final public boolean isLineUpRendarableNodeData() { - return _line_up_renderable_node_data; } - + final public boolean isRightLineUpDomains() { - return _right_align_domains; } - - final public void setLineUpRendarableNodeData( final boolean line_up_renderable_node_data) { - - _line_up_renderable_node_data = line_up_renderable_node_data; + + final public void setLineUpRendarableNodeData( final boolean line_up_renderable_node_data ) { + _line_up_renderable_node_data = line_up_renderable_node_data; } - + final public void setRightLineUpDomains( final boolean right_align_domains ) { - _right_align_domains = right_align_domains; } - - } diff --git a/forester/java/src/org/forester/archaeopteryx/Constants.java b/forester/java/src/org/forester/archaeopteryx/Constants.java index a048c12..4ecd283 100644 --- a/forester/java/src/org/forester/archaeopteryx/Constants.java +++ b/forester/java/src/org/forester/archaeopteryx/Constants.java @@ -37,9 +37,9 @@ import org.forester.util.ForesterConstants; public final class Constants { final static boolean __ALLOW_PHYLOGENETIC_INFERENCE = true; - public final static boolean __RELEASE = false; // TODO remove me - public final static boolean __SNAPSHOT_RELEASE = false; // TODO remove me - public final static boolean __SYNTH_LF = false; // TODO remove me + public final static boolean __RELEASE = false; // TODO remove me + public final static boolean __SNAPSHOT_RELEASE = false; // TODO remove me + public final static boolean __SYNTH_LF = false; // TODO remove me public final static boolean ALLOW_DDBJ_BLAST = false; public final static String PRG_NAME = "Archaeopteryx"; final static String VERSION = "0.9894 beta"; @@ -59,7 +59,7 @@ public final class Constants { final static float WHEEL_ZOOM_OUT_FACTOR = 1 / Constants.WHEEL_ZOOM_IN_FACTOR; final static float WHEEL_ZOOM_IN_X_CORRECTION_FACTOR = 1.085f; final static float WHEEL_ZOOM_OUT_X_CORRECTION_FACTOR = 1 / Constants.WHEEL_ZOOM_IN_X_CORRECTION_FACTOR; - static final boolean SPECIAL_CUSTOM = false; //TODO remove me + static final boolean SPECIAL_CUSTOM = false; //TODO remove me static final double EXT_NODE_INFO_LENGTH_MAX_RATIO = 0.95; static final Dimension NODE_PANEL_SPLIT_MINIMUM_SIZE = new Dimension( 100, 50 ); static final Dimension NODE_PANEL_SIZE = new Dimension( 500, 600 ); @@ -77,11 +77,10 @@ public final class Constants { final static float PDF_LINE_WIDTH_DEFAULT = 0.5f; final static String APTX_WEB_SITE = "https://sites.google.com/site/cmzmasek/home/software/archaeopteryx"; final static String APTX_DOC_SITE = "https://sites.google.com/site/cmzmasek/home/software/archaeopteryx/documentation"; - final static String PHYLOXML_WEB_SITE = ForesterConstants.PHYLO_XML_LOCATION; final static String PHYLOXML_REFERENCE_URL = "http://www.biomedcentral.com/1471-2105/10/356/"; final static String APTX_REFERENCE_URL = "http://www.biomedcentral.com/bmcbioinformatics/"; - final static String APTX_REFERENCE = "Zmasek..."; //TODO + final static String APTX_REFERENCE = "Zmasek..."; //TODO final static String PHYLOXML_REFERENCE = ForesterConstants.PHYLO_XML_REFERENCE; final static String PHYLOXML_REFERENCE_SHORT = "Han MV and Zmasek CM (2009), BMC Bioinformatics, 10:356"; final static short NUMBER_OF_DIGITS_AFTER_COMMA_FOR_BRANCH_LENGTH_VALUES_DEFAULT = 3; diff --git a/forester/java/src/org/forester/archaeopteryx/ControlPanel.java b/forester/java/src/org/forester/archaeopteryx/ControlPanel.java index 2fe6429..225a591 100644 --- a/forester/java/src/org/forester/archaeopteryx/ControlPanel.java +++ b/forester/java/src/org/forester/archaeopteryx/ControlPanel.java @@ -71,107 +71,107 @@ import org.forester.util.ForesterUtil; final class ControlPanel extends JPanel implements ActionListener { - final static Font jcb_bold_font = new Font( Configuration.getDefaultFontFamilyName(), - Font.BOLD, - 9 ); - final static Font jcb_font = new Font( Configuration.getDefaultFontFamilyName(), - Font.PLAIN, - 9 ); - final static Font js_font = new Font( Configuration.getDefaultFontFamilyName(), - Font.PLAIN, - 9 ); - private static final String RETURN_TO_SUPER_TREE_TEXT = "Back to Super Tree"; - private static final long serialVersionUID = -8463483932821545633L; - private NodeClickAction _action_when_node_clicked; - private int _add_new_node_item; - private Map _all_click_to_names; - private Map _annotation_colors; - private int _blast_item; - private JComboBox _click_to_combobox; - private JLabel _click_to_label; - private List _click_to_names; - private int _collapse_cb_item; - private JCheckBox _color_acc_species; - private JCheckBox _color_acc_sequence; - private JCheckBox _color_according_to_annotation; - private boolean _color_branches; - private JCheckBox _use_visual_styles_cb; - private int _color_subtree_cb_item; - private int _change_node_font_item; + final static Font jcb_bold_font = new Font( Configuration.getDefaultFontFamilyName(), + Font.BOLD, + 9 ); + final static Font jcb_font = new Font( Configuration.getDefaultFontFamilyName(), + Font.PLAIN, + 9 ); + final static Font js_font = new Font( Configuration.getDefaultFontFamilyName(), + Font.PLAIN, + 9 ); + private static final String RETURN_TO_SUPER_TREE_TEXT = "Back to Super Tree"; + private static final long serialVersionUID = -8463483932821545633L; + private NodeClickAction _action_when_node_clicked; + private int _add_new_node_item; + private Map _all_click_to_names; + private Map _annotation_colors; + private int _blast_item; + private JComboBox _click_to_combobox; + private JLabel _click_to_label; + private List _click_to_names; + private int _collapse_cb_item; + private JCheckBox _color_acc_species; + private JCheckBox _color_acc_sequence; + private JCheckBox _color_according_to_annotation; + private boolean _color_branches; + private JCheckBox _use_visual_styles_cb; + private int _color_subtree_cb_item; + private int _change_node_font_item; // The settings from the conf file - private final Configuration _configuration; - private int _copy_subtree_item; - private int _cut_subtree_item; - private JButton _decr_domain_structure_evalue_thr; - private int _delete_node_or_subtree_item; - private JCheckBox _display_as_phylogram_cb; + private final Configuration _configuration; + private int _copy_subtree_item; + private int _cut_subtree_item; + private JButton _decr_domain_structure_evalue_thr; + private int _delete_node_or_subtree_item; + private JCheckBox _display_as_phylogram_cb; // Tree checkboxes - private JCheckBox _display_internal_data; - private JLabel _domain_display_label; - private JTextField _domain_structure_evalue_thr_tf; - private List _draw_phylogram; - private JCheckBox _dynamically_hide_data; - private int _edit_node_data_item; - private int _get_ext_desc_data; - private JButton _incr_domain_structure_evalue_thr; - private final MainPanel _mainpanel; - private JCheckBox _node_desc_popup_cb; - private int _open_pdb_item; - private int _open_seq_web_item; - private int _open_tax_web_item; - private int _color_node_font_item; - private JButton _order; - private boolean _order_of_appearance; - private int _paste_subtree_item; - private int _reroot_cb_item; - private JButton _return_to_super_tree; + private JCheckBox _display_internal_data; + private JLabel _domain_display_label; + private JTextField _domain_structure_evalue_thr_tf; + private List _draw_phylogram; + private JCheckBox _dynamically_hide_data; + private int _edit_node_data_item; + private int _get_ext_desc_data; + private JButton _incr_domain_structure_evalue_thr; + private final MainPanel _mainpanel; + private JCheckBox _node_desc_popup_cb; + private int _open_pdb_item; + private int _open_seq_web_item; + private int _open_tax_web_item; + private int _color_node_font_item; + private JButton _order; + private boolean _order_of_appearance; + private int _paste_subtree_item; + private int _reroot_cb_item; + private JButton _return_to_super_tree; // Search - private JLabel _search_found_label_0; - private JLabel _search_found_label_1; - private JButton _search_reset_button_0; - private JButton _search_reset_button_1; - private JTextField _search_tf_0; - private JTextField _search_tf_1; - private int _select_nodes_item; - private Sequence _selected_query_seq; - private JCheckBox _seq_relation_confidence_switch; - private JComboBox _sequence_relation_type_box; - private JCheckBox _show_annotation; - private JCheckBox _show_binary_character_counts; - private JCheckBox _show_binary_characters; + private JLabel _search_found_label_0; + private JLabel _search_found_label_1; + private JButton _search_reset_button_0; + private JButton _search_reset_button_1; + private JTextField _search_tf_0; + private JTextField _search_tf_1; + private int _select_nodes_item; + private Sequence _selected_query_seq; + private JCheckBox _seq_relation_confidence_switch; + private JComboBox _sequence_relation_type_box; + private JCheckBox _show_annotation; + private JCheckBox _show_binary_character_counts; + private JCheckBox _show_binary_characters; // Indices for the click-to options in the combo box - private int _show_data_item; - private JCheckBox _show_domain_architectures; - private JCheckBox _show_events; - private JCheckBox _show_gene_names; - private JCheckBox _show_node_names; - private JCheckBox _show_properties_cb; - private JCheckBox _show_seq_names; - private JCheckBox _show_seq_symbols; - private JCheckBox _show_sequence_acc; - private JComboBox _show_sequence_relations; - private JCheckBox _show_taxo_code; - private JCheckBox _show_taxo_common_names; - private JCheckBox _show_taxo_images_cb; - private JCheckBox _show_taxo_scientific_names; - private JCheckBox _show_vector_data_cb; - private JButton _show_whole; - private int _sort_descendents_item; - private Map _species_colors; - private Map _sequence_colors; - private int _subtree_cb_item; - private int _swap_cb_item; - private JButton _uncollapse_all; - private JCheckBox _width_branches; - private JCheckBox _write_confidence; - private JButton _zoom_in_domain_structure; + private int _show_data_item; + private JCheckBox _show_domain_architectures; + private JCheckBox _show_events; + private JCheckBox _show_gene_names; + private JCheckBox _show_node_names; + private JCheckBox _show_properties_cb; + private JCheckBox _show_seq_names; + private JCheckBox _show_seq_symbols; + private JCheckBox _show_sequence_acc; + private JComboBox _show_sequence_relations; + private JCheckBox _show_taxo_code; + private JCheckBox _show_taxo_common_names; + private JCheckBox _show_taxo_images_cb; + private JCheckBox _show_taxo_scientific_names; + private JCheckBox _show_vector_data_cb; + private JButton _show_whole; + private int _sort_descendents_item; + private Map _species_colors; + private Map _sequence_colors; + private int _subtree_cb_item; + private int _swap_cb_item; + private JButton _uncollapse_all; + private JCheckBox _width_branches; + private JCheckBox _write_confidence; + private JButton _zoom_in_domain_structure; // zooming and quick tree manipulation buttons: - private JButton _zoom_in_x; - private JButton _zoom_in_y; - private JLabel _zoom_label; - private JButton _zoom_out_domain_structure; - private JButton _zoom_out_x; - private JButton _zoom_out_y; + private JButton _zoom_in_x; + private JButton _zoom_in_y; + private JLabel _zoom_label; + private JButton _zoom_out_domain_structure; + private JButton _zoom_out_x; + private JButton _zoom_out_y; ControlPanel( final MainPanel ap, final Configuration configuration ) { init(); @@ -193,18 +193,15 @@ final class ControlPanel extends JPanel implements ActionListener { public void actionPerformed( final ActionEvent e ) { try { if ( e.getSource() == _color_acc_sequence ) { - if ( _color_acc_species != null ) { + if ( _color_acc_species != null ) { _color_acc_species.setSelected( false ); } - } + } else if ( e.getSource() == _color_acc_species ) { - if ( _color_acc_sequence != null ) { + if ( _color_acc_sequence != null ) { _color_acc_sequence.setSelected( false ); } - } - - final TreePanel tp = getMainPanel().getCurrentTreePanel(); if ( tp == null ) { return; @@ -307,7 +304,8 @@ final class ControlPanel extends JPanel implements ActionListener { search1(); displayedPhylogenyMightHaveChanged( true ); } - else if ( _dynamically_hide_data != null && e.getSource() == _dynamically_hide_data && !_dynamically_hide_data.isSelected() ) { + else if ( ( _dynamically_hide_data != null ) && ( e.getSource() == _dynamically_hide_data ) + && !_dynamically_hide_data.isSelected() ) { setDynamicHidingIsOn( false ); displayedPhylogenyMightHaveChanged( true ); } @@ -330,7 +328,7 @@ final class ControlPanel extends JPanel implements ActionListener { public JCheckBox getColorAccSpeciesCb() { return _color_acc_species; } - + public JCheckBox getColorAccSequenceCb() { return _color_acc_sequence; } @@ -555,15 +553,13 @@ final class ControlPanel extends JPanel implements ActionListener { 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" ); + _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" ); + _color_acc_sequence.setToolTipText( "To colorize node labels as a function of sequence name" ); addJCheckBox( _color_acc_sequence, ch_panel ); add( ch_panel ); break; @@ -821,7 +817,7 @@ final class ControlPanel extends JPanel implements ActionListener { Map getSpeciesColors() { return _species_colors; } - + Map getSequenceColors() { return _sequence_colors; } @@ -837,7 +833,7 @@ final class ControlPanel extends JPanel implements ActionListener { boolean isColorAccordingToTaxonomy() { return ( ( _color_acc_species != null ) && _color_acc_species.isSelected() ); } - + boolean isColorAccordingToSequence() { return ( ( _color_acc_sequence != null ) && _color_acc_sequence.isSelected() ); } @@ -1272,7 +1268,7 @@ final class ControlPanel extends JPanel implements ActionListener { void setSpeciesColors( final Map species_colors ) { _species_colors = species_colors; } - + void setSequenceColors( final Map sequence_colors ) { _sequence_colors = sequence_colors; } @@ -2054,8 +2050,8 @@ final class ControlPanel extends JPanel implements ActionListener { s = "User Selected Data"; break; default: - throw new IllegalStateException( "dont know how to deal with " + getConfiguration().getExtDescNodeDataToReturn() ); - + throw new IllegalStateException( "dont know how to deal with " + + getConfiguration().getExtDescNodeDataToReturn() ); } final String label = _configuration.getClickToTitle( Configuration.get_ext_desc_data ) + " " + s; addClickToOption( Configuration.get_ext_desc_data, label ); @@ -2148,18 +2144,12 @@ final class ControlPanel extends JPanel implements ActionListener { setCheckbox( Configuration.display_internal_data, _configuration.doCheckOption( Configuration.display_internal_data ) ); } - - if ( _configuration.doDisplayOption( Configuration.color_according_to_sequence ) ) { addCheckbox( Configuration.color_according_to_sequence, _configuration.getDisplayTitle( Configuration.color_according_to_sequence ) ); setCheckbox( Configuration.color_according_to_sequence, _configuration.doCheckOption( Configuration.color_according_to_sequence ) ); } - - - - if ( _configuration.doDisplayOption( Configuration.color_according_to_species ) ) { addCheckbox( Configuration.color_according_to_species, _configuration.getDisplayTitle( Configuration.color_according_to_species ) ); diff --git a/forester/java/src/org/forester/archaeopteryx/MainFrame.java b/forester/java/src/org/forester/archaeopteryx/MainFrame.java index 2a50296..ef2ebcb 100644 --- a/forester/java/src/org/forester/archaeopteryx/MainFrame.java +++ b/forester/java/src/org/forester/archaeopteryx/MainFrame.java @@ -125,8 +125,8 @@ public abstract class MainFrame extends JFrame implements ActionListener { static final String USE_BRACKETS_FOR_CONF_IN_NH_LABEL = "Use Brackets for Confidence Values"; static final String USE_INTERNAL_NAMES_FOR_CONF_IN_NH_LABEL = "Use Internal Node Names for Confidence Values"; 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 Node Diagrams"; + static final String RIGHT_LINE_UP_DOMAINS = "Right-align Domain Architectures"; + static final String LINE_UP_RENDERABLE_DATA = "Line Up Node Diagrams"; JMenuBar _jmenubar; JMenu _file_jmenu; JMenu _tools_menu; @@ -200,8 +200,8 @@ public abstract class MainFrame extends JFrame implements ActionListener { JMenuItem _cycle_node_fill_mi; JMenuItem _choose_node_size_mi; JCheckBoxMenuItem _show_confidence_stddev_cbmi; - JCheckBoxMenuItem _right_line_up_domains_cbmi; - JCheckBoxMenuItem _line_up_renderable_data_cbmi; + JCheckBoxMenuItem _right_line_up_domains_cbmi; + JCheckBoxMenuItem _line_up_renderable_data_cbmi; // _ print JCheckBoxMenuItem _graphics_export_visible_only_cbmi; JCheckBoxMenuItem _antialias_print_cbmi; @@ -502,14 +502,11 @@ public abstract class MainFrame extends JFrame implements ActionListener { } updateOptions( getOptions() ); } - - else if ( ( o == _rectangular_type_cbmi ) || ( o == _triangular_type_cbmi ) || ( o == _curved_type_cbmi ) || ( o == _convex_type_cbmi ) || ( o == _euro_type_cbmi ) || ( o == _rounded_type_cbmi ) || ( o == _unrooted_type_cbmi ) || ( o == _circular_type_cbmi ) ) { typeChanged( o ); } - else if ( o == _about_item ) { about(); } @@ -553,7 +550,6 @@ public abstract class MainFrame extends JFrame implements ActionListener { ForesterUtil.printErrorMessage( Constants.PRG_NAME, e1.toString() ); } } - else { if ( _load_phylogeny_from_webservice_menu_items != null ) { for( int i = 0; i < _load_phylogeny_from_webservice_menu_items.length; ++i ) { @@ -566,21 +562,20 @@ public abstract class MainFrame extends JFrame implements ActionListener { _contentpane.repaint(); } - private void deleteSelectedNodes( boolean delete ) { + private void deleteSelectedNodes( final boolean delete ) { final Phylogeny phy = getMainPanel().getCurrentPhylogeny(); - if ( phy == null || phy.getNumberOfExternalNodes() < 2 ) { + if ( ( phy == null ) || ( phy.getNumberOfExternalNodes() < 2 ) ) { return; } - List nodes = new ArrayList(); + final List nodes = new ArrayList(); if ( ( getCurrentTreePanel().getFoundNodes0() != null ) || ( getCurrentTreePanel().getFoundNodes1() != null ) ) { - final List all_selected_nodes = getCurrentTreePanel().getFoundNodesAsListOfPhylogenyNodes(); + final List all_selected_nodes = getCurrentTreePanel().getFoundNodesAsListOfPhylogenyNodes(); for( final PhylogenyNode n : all_selected_nodes ) { if ( n.isExternal() ) { nodes.add( n ); } } } - String function = "Retain"; if ( delete ) { function = "Delete"; @@ -1106,8 +1101,6 @@ public abstract class MainFrame extends JFrame implements ActionListener { return _species_tree; } - - void initializeTypeMenu( final Options options ) { setTypeMenuToAllUnselected(); switch ( options.getPhylogenyGraphicsType() ) { @@ -1426,7 +1419,6 @@ public abstract class MainFrame extends JFrame implements ActionListener { } if ( ( _right_line_up_domains_cbmi != null ) && _right_line_up_domains_cbmi.isEnabled() ) { options.setRightLineUpDomains( _right_line_up_domains_cbmi.isSelected() ); - } if ( ( _line_up_renderable_data_cbmi != null ) && _line_up_renderable_data_cbmi.isEnabled() ) { options.setLineUpRendarableNodeData( _line_up_renderable_data_cbmi.isSelected() ); diff --git a/forester/java/src/org/forester/archaeopteryx/MainFrameApplet.java b/forester/java/src/org/forester/archaeopteryx/MainFrameApplet.java index 22332cd..6e6db91 100644 --- a/forester/java/src/org/forester/archaeopteryx/MainFrameApplet.java +++ b/forester/java/src/org/forester/archaeopteryx/MainFrameApplet.java @@ -222,7 +222,6 @@ public final class MainFrameApplet extends MainFrame { _options_jmenu.add( _right_line_up_domains_cbmi = new JCheckBoxMenuItem( MainFrame.RIGHT_LINE_UP_DOMAINS ) ); } _options_jmenu.add( _line_up_renderable_data_cbmi = new JCheckBoxMenuItem( MainFrame.LINE_UP_RENDERABLE_DATA ) ); - _options_jmenu.add( _show_annotation_ref_source = new JCheckBoxMenuItem( MainFrame.SHOW_ANN_REF_SOURCE_LABEL ) ); _options_jmenu.add( _show_confidence_stddev_cbmi = new JCheckBoxMenuItem( MainFrame.SHOW_CONF_STDDEV_LABEL ) ); _options_jmenu diff --git a/forester/java/src/org/forester/archaeopteryx/MainFrameApplication.java b/forester/java/src/org/forester/archaeopteryx/MainFrameApplication.java index 9c4c701..6ad71f3 100644 --- a/forester/java/src/org/forester/archaeopteryx/MainFrameApplication.java +++ b/forester/java/src/org/forester/archaeopteryx/MainFrameApplication.java @@ -157,7 +157,6 @@ public final class MainFrameApplication extends MainFrame { private File _seqs_file = null; JMenuItem _read_values_jmi; JMenuItem _read_seqs_jmi; - private MainFrameApplication( final Phylogeny[] phys, final Configuration config ) { _configuration = config; @@ -902,9 +901,8 @@ public final class MainFrameApplication extends MainFrame { if ( getConfiguration().doDisplayOption( Configuration.show_domain_architectures ) ) { _options_jmenu.add( _show_domain_labels = new JCheckBoxMenuItem( SHOW_DOMAIN_LABELS_LABEL ) ); _options_jmenu.add( _right_line_up_domains_cbmi = new JCheckBoxMenuItem( MainFrame.RIGHT_LINE_UP_DOMAINS ) ); - } + } _options_jmenu.add( _line_up_renderable_data_cbmi = new JCheckBoxMenuItem( MainFrame.LINE_UP_RENDERABLE_DATA ) ); - _options_jmenu.add( _show_annotation_ref_source = new JCheckBoxMenuItem( SHOW_ANN_REF_SOURCE_LABEL ) ); _options_jmenu.add( _show_confidence_stddev_cbmi = new JCheckBoxMenuItem( SHOW_CONF_STDDEV_LABEL ) ); _options_jmenu.add( _color_by_taxonomic_group_cbmi = new JCheckBoxMenuItem( COLOR_BY_TAXONOMIC_GROUP ) ); @@ -1033,11 +1031,7 @@ public final class MainFrameApplication extends MainFrame { .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 ); - - - customizeCheckBoxMenuItem( _line_up_renderable_data_cbmi, getOptions().isLineUpRendarableNodeData() - ); - + customizeCheckBoxMenuItem( _line_up_renderable_data_cbmi, getOptions().isLineUpRendarableNodeData() ); customizeCheckBoxMenuItem( _right_line_up_domains_cbmi, getOptions().isRightLineUpDomains() ); _jmenubar.add( _options_jmenu ); } @@ -1092,7 +1086,6 @@ public final class MainFrameApplication extends MainFrame { customizeJMenuItem( _delete_selected_nodes_item ); _tools_menu.add( _delete_not_selected_nodes_item = new JMenuItem( "Retain Selected Nodes" ) ); _delete_not_selected_nodes_item.setToolTipText( "To delete all not selected external nodes" ); - customizeJMenuItem( _delete_not_selected_nodes_item ); _tools_menu.addSeparator(); _tools_menu.add( _collapse_species_specific_subtrees = new JMenuItem( "Collapse Species-Specific Subtrees" ) ); @@ -1247,7 +1240,6 @@ public final class MainFrameApplication extends MainFrame { if ( ( phys != null ) && ( phys.length > 0 ) ) { if ( nhx_or_nexus && getOptions().isInternalNumberAreConfidenceForNhParsing() ) { for( final Phylogeny phy : phys ) { - PhylogenyMethods.transferInternalNodeNamesToConfidence( phy, "" ); } } diff --git a/forester/java/src/org/forester/archaeopteryx/Options.java b/forester/java/src/org/forester/archaeopteryx/Options.java index 4d96164..2bf8471 100644 --- a/forester/java/src/org/forester/archaeopteryx/Options.java +++ b/forester/java/src/org/forester/archaeopteryx/Options.java @@ -35,7 +35,6 @@ import org.forester.phylogeny.data.NodeVisualData; import org.forester.phylogeny.data.NodeVisualData.NodeFill; import org.forester.phylogeny.data.NodeVisualData.NodeShape; import org.forester.util.ForesterUtil; -import org.omg.stub.java.rmi._Remote_Stub; /* * This is to hold changeable options. @@ -86,8 +85,8 @@ final public class Options { private boolean _show_overview; private boolean _show_scale; private TAXONOMY_EXTRACTION _taxonomy_extraction; - private boolean _line_up_renderable_node_data; - private boolean _right_align_domains; + private boolean _line_up_renderable_node_data; + private boolean _right_align_domains; private Options() { init(); @@ -566,9 +565,8 @@ final public class Options { if ( configuration.getExtDescNodeDataToReturn() != null ) { instance.setExtDescNodeDataToReturn( configuration.getExtDescNodeDataToReturn() ); } - - instance.setRightLineUpDomains( configuration.isRightLineUpDomains() ); - instance.setLineUpRendarableNodeData( configuration.isLineUpRendarableNodeData() ); + instance.setRightLineUpDomains( configuration.isRightLineUpDomains() ); + instance.setLineUpRendarableNodeData( configuration.isLineUpRendarableNodeData() ); instance.setAllowErrorsInDistanceToParent( false ); } return instance; @@ -613,23 +611,18 @@ final public class Options { } final public boolean isLineUpRendarableNodeData() { - return _line_up_renderable_node_data; } - + final public boolean isRightLineUpDomains() { - return _right_align_domains; } - - final public void setLineUpRendarableNodeData( final boolean line_up_renderable_node_data) { - - _line_up_renderable_node_data = line_up_renderable_node_data; + + final public void setLineUpRendarableNodeData( final boolean line_up_renderable_node_data ) { + _line_up_renderable_node_data = line_up_renderable_node_data; } - + final public void setRightLineUpDomains( final boolean right_align_domains ) { - _right_align_domains = right_align_domains; } - } diff --git a/forester/java/src/org/forester/archaeopteryx/TreeColorSet.java b/forester/java/src/org/forester/archaeopteryx/TreeColorSet.java index 53650d5..2906ae7 100644 --- a/forester/java/src/org/forester/archaeopteryx/TreeColorSet.java +++ b/forester/java/src/org/forester/archaeopteryx/TreeColorSet.java @@ -31,7 +31,6 @@ import java.util.Map; import org.forester.util.ForesterUtil; - public final class TreeColorSet { public static final String ANNOTATION = "Annotation"; @@ -60,9 +59,7 @@ public final class TreeColorSet { BINARY_DOMAIN_COMBINATIONS, ANNOTATION, OVERVIEW }; static final String[] SCHEME_NAMES = { "Default", "Black", "Black & White", "Silver", "Green", "White & Blue", "Cyan", "Orange", "Blue", "Blue & White", "Neon" }; - private int _color_scheme; - private final Color[][] _color_schemes = { { new Color( 0, 0, 0 ), // background_color new Color( 0, 100, 100 ), // background_color_gradient_bottom new Color( 230, 230, 230 ), // sequence __ Default (same as Black) @@ -218,8 +215,8 @@ public final class TreeColorSet { new Color( 255, 0, 0 ), // duplication_box_color new Color( 0, 255, 0 ), // speciation_box_color new Color( 255, 255, 0 ), // duplication_speciation_color - new Color( 255, 200, 0 ), // domain_label - new Color( 255, 200, 0 ), // domains_base + new Color( 255, 200, 0 ), // domain_label + new Color( 255, 200, 0 ), // domains_base new Color( 150, 150, 150 ), // binary_domain_combinations_color new Color( 150, 150, 150 ) // annotation , new Color( 150, 150, 150 ) // ov @@ -238,7 +235,7 @@ public final class TreeColorSet { new Color( 255, 0, 0 ), // duplication_box_color new Color( 0, 255, 0 ), // speciation_box_color new Color( 255, 255, 0 ), // duplication_speciation_color - new Color(255, 255, 255 ), // domain_label + new Color( 255, 255, 255 ), // domain_label new Color( 100, 100, 100 ), // domains_base new Color( 255, 255, 255 ), // binary_domain_combinations_color new Color( 255, 255, 255 ) // annotation @@ -279,7 +276,7 @@ public final class TreeColorSet { new Color( 0, 255, 0 ), // speciation_box_color new Color( 255, 255, 0 ), // duplication_speciation_color new Color( 127, 255, 0 ), // domain_label - new Color( 234, 173, 234 ), // domains_base + new Color( 234, 173, 234 ), // domains_base new Color( 27, 255, 0 ), // binary_domain_combinations_color new Color( 27, 255, 0 ) // annotation , new Color( 77, 77, 255 ) // ov @@ -377,7 +374,7 @@ public final class TreeColorSet { public Color getDomainBaseColor() { return domain_base_color; } - + public Color getDomainLabelColor() { return domain_label_color; } diff --git a/forester/java/src/org/forester/archaeopteryx/TreePanel.java b/forester/java/src/org/forester/archaeopteryx/TreePanel.java index 4178b2a..a4c7821 100644 --- a/forester/java/src/org/forester/archaeopteryx/TreePanel.java +++ b/forester/java/src/org/forester/archaeopteryx/TreePanel.java @@ -4797,16 +4797,17 @@ public final class TreePanel extends JPanel implements ActionListener, MouseWhee if ( getControlPanel().isDrawPhylogram() ) { if ( getOptions().isLineUpRendarableNodeData() ) { if ( getOptions().isRightLineUpDomains() ) { - rds.render( getMaxDistanceToRoot() * getXcorrectionFactor() + _length_of_longest_text - + ( _longest_domain - rds.getTotalLength() ) - * rds.getRenderingFactorWidth(), + rds.render( ( getMaxDistanceToRoot() * getXcorrectionFactor() ) + + _length_of_longest_text + + ( ( _longest_domain - rds.getTotalLength() ) * rds + .getRenderingFactorWidth() ), node.getYcoord() - ( h / 2 ), g, this, to_pdf ); } else { - rds.render( getMaxDistanceToRoot() * getXcorrectionFactor() + _length_of_longest_text, + rds.render( ( getMaxDistanceToRoot() * getXcorrectionFactor() ) + _length_of_longest_text, node.getYcoord() - ( h / 2 ), g, this, @@ -4819,9 +4820,9 @@ public final class TreePanel extends JPanel implements ActionListener, MouseWhee } else { if ( getOptions().isRightLineUpDomains() ) { - rds.render( getPhylogeny().getFirstExternalNode().getXcoord() + _length_of_longest_text - - 20 + ( _longest_domain - rds.getTotalLength() ) - * rds.getRenderingFactorWidth(), + rds.render( ( ( getPhylogeny().getFirstExternalNode().getXcoord() + _length_of_longest_text ) - 20 ) + + ( ( _longest_domain - rds.getTotalLength() ) * rds + .getRenderingFactorWidth() ), node.getYcoord() - ( h / 2 ), g, this, diff --git a/forester/java/src/org/forester/archaeopteryx/TreePanelUtil.java b/forester/java/src/org/forester/archaeopteryx/TreePanelUtil.java index e131214..6f6999d 100644 --- a/forester/java/src/org/forester/archaeopteryx/TreePanelUtil.java +++ b/forester/java/src/org/forester/archaeopteryx/TreePanelUtil.java @@ -296,7 +296,7 @@ public class TreePanelUtil { if ( n.getNodeData().isHasTaxonomy() && ( !ForesterUtil.isEmpty( n.getNodeData().getTaxonomy().getScientificName() ) || !ForesterUtil.isEmpty( n.getNodeData().getTaxonomy().getCommonName() ) || !ForesterUtil - .isEmpty( n.getNodeData().getTaxonomy().getTaxonomyCode() ) ) ) { + .isEmpty( n.getNodeData().getTaxonomy().getTaxonomyCode() ) ) ) { if ( !ForesterUtil.isEmpty( n.getNodeData().getTaxonomy().getRank() ) && n.getNodeData().getTaxonomy().getRank().equalsIgnoreCase( rank ) ) { final BranchColor c = new BranchColor( tree_panel.calculateTaxonomyBasedColor( n.getNodeData() @@ -397,7 +397,7 @@ public class TreePanelUtil { if ( sb.charAt( sb.length() - 1 ) == ' ' ) { sb.deleteCharAt( sb.length() - 1 ); } - if ( i < ans.size() - 1 ) { + if ( i < ( ans.size() - 1 ) ) { sb.append( ", " ); } } diff --git a/forester/java/src/org/forester/archaeopteryx/phylogeny/data/RenderablePhylogenyData.java b/forester/java/src/org/forester/archaeopteryx/phylogeny/data/RenderablePhylogenyData.java index 84de7d3..9536554 100644 --- a/forester/java/src/org/forester/archaeopteryx/phylogeny/data/RenderablePhylogenyData.java +++ b/forester/java/src/org/forester/archaeopteryx/phylogeny/data/RenderablePhylogenyData.java @@ -47,7 +47,7 @@ public interface RenderablePhylogenyData extends PhylogenyData { * @param g * the Graphics to render to */ - public void render( final double x, final double y, final Graphics2D g, final TreePanel tree_panel, boolean to_pdf ); + public void render( final double x, final double y, final Graphics2D g, final TreePanel tree_panel, boolean to_pdf ); public void setParameter( final double parameter ); diff --git a/forester/java/src/org/forester/archaeopteryx/phylogeny/data/RenderableVector.java b/forester/java/src/org/forester/archaeopteryx/phylogeny/data/RenderableVector.java index 02782ff..b084491 100644 --- a/forester/java/src/org/forester/archaeopteryx/phylogeny/data/RenderableVector.java +++ b/forester/java/src/org/forester/archaeopteryx/phylogeny/data/RenderableVector.java @@ -43,22 +43,19 @@ import org.forester.util.ForesterUtil; public final class RenderableVector implements RenderablePhylogenyData { - final static int VECTOR_DEFAULT_HEIGHT = 12; - public final static int VECTOR_DEFAULT_WIDTH = 120; + final static int VECTOR_DEFAULT_HEIGHT = 12; + public final static int VECTOR_DEFAULT_WIDTH = 120; private double _rendering_factor_width = 1.0; private List _values; private final Rectangle2D _rectangle = new Rectangle2D.Float(); - - private double _height = VECTOR_DEFAULT_HEIGHT; + private double _height = VECTOR_DEFAULT_HEIGHT; private double _min; private double _max; private double _mean; - private Color _min_color = Color.BLUE; - private Color _max_color = Color.YELLOW; - private Color _mean_color = Color.WHITE; - private int _width = VECTOR_DEFAULT_WIDTH; - - + private Color _min_color = Color.BLUE; + private Color _max_color = Color.YELLOW; + private Color _mean_color = Color.WHITE; + private int _width = VECTOR_DEFAULT_WIDTH; private static RenderableVector _instance = null; private RenderableVector() { @@ -167,18 +164,14 @@ public final class RenderableVector implements RenderablePhylogenyData { if ( _instance == null ) { _instance = new RenderableVector(); } - _instance._values = values; - if ( configuration != null ) { - _instance._min_color =configuration.getVectorDataMinColor(); + _instance._min_color = configuration.getVectorDataMinColor(); _instance._max_color = configuration.getVectorDataMaxColor(); _instance._mean_color = configuration.getVectorDataMeanColor(); _instance._width = configuration.getVectorDataWidth(); _instance._height = configuration.getVectorDataHeight(); } - - if ( stats.getN() > 0 ) { _instance._min = stats.getMin(); _instance._max = stats.getMax(); diff --git a/forester/java/src/org/forester/evoinference/distance/NeighborJoining.java b/forester/java/src/org/forester/evoinference/distance/NeighborJoining.java index 156d72e..1f06010 100644 --- a/forester/java/src/org/forester/evoinference/distance/NeighborJoining.java +++ b/forester/java/src/org/forester/evoinference/distance/NeighborJoining.java @@ -137,21 +137,21 @@ public final class NeighborJoining { final int m_i = _mappings[ i ]; if ( otu1 < i ) { if ( otu2 > i ) { - _d_values[ m_otu1 ][ m_i ] = ( _d_values[ m_otu1 ][ m_i ] + _d_values[ m_i ][ m_otu2 ] - d ) / 2; + _d_values[ m_otu1 ][ m_i ] = ( ( _d_values[ m_otu1 ][ m_i ] + _d_values[ m_i ][ m_otu2 ] ) - d ) / 2; //System.out.print( DF.format( _d_values[ m_otu1 ][ m_i ] ) ); } else { - _d_values[ m_otu1 ][ m_i ] = ( _d_values[ m_otu1 ][ m_i ] + _d_values[ m_otu2 ][ m_i ] - d ) / 2; + _d_values[ m_otu1 ][ m_i ] = ( ( _d_values[ m_otu1 ][ m_i ] + _d_values[ m_otu2 ][ m_i ] ) - d ) / 2; //System.out.print( DF.format( _d_values[ m_otu1 ][ m_i ] ) ); } } else { if ( otu2 > i ) { - _d_values[ m_i ][ m_otu1 ] = ( _d_values[ m_i ][ m_otu1 ] + _d_values[ m_i ][ m_otu2 ] - d ) / 2; + _d_values[ m_i ][ m_otu1 ] = ( ( _d_values[ m_i ][ m_otu1 ] + _d_values[ m_i ][ m_otu2 ] ) - d ) / 2; //System.out.print( DF.format( _d_values[ m_i ][ m_otu1 ] ) ); } else { - _d_values[ m_i ][ m_otu1 ] = ( _d_values[ m_i ][ m_otu1 ] + _d_values[ m_otu2 ][ m_i ] - d ) / 2; + _d_values[ m_i ][ m_otu1 ] = ( ( _d_values[ m_i ][ m_otu1 ] + _d_values[ m_otu2 ][ m_i ] ) - d ) / 2; // System.out.print( DF.format( _d_values[ m_otu1 ][ m_i ] ) ); } } diff --git a/forester/java/src/org/forester/evoinference/distance/NeighborJoiningF.java b/forester/java/src/org/forester/evoinference/distance/NeighborJoiningF.java index a696a38..ff35f4a 100644 --- a/forester/java/src/org/forester/evoinference/distance/NeighborJoiningF.java +++ b/forester/java/src/org/forester/evoinference/distance/NeighborJoiningF.java @@ -135,18 +135,18 @@ public final class NeighborJoiningF { final int m_i = _mappings[ i ]; if ( otu1 < i ) { if ( otu2 > i ) { - _d_values[ m_otu1 ][ m_i ] = ( _d_values[ m_otu1 ][ m_i ] + _d_values[ m_i ][ m_otu2 ] - d ) / 2; + _d_values[ m_otu1 ][ m_i ] = ( ( _d_values[ m_otu1 ][ m_i ] + _d_values[ m_i ][ m_otu2 ] ) - d ) / 2; } else { - _d_values[ m_otu1 ][ m_i ] = ( _d_values[ m_otu1 ][ m_i ] + _d_values[ m_otu2 ][ m_i ] - d ) / 2; + _d_values[ m_otu1 ][ m_i ] = ( ( _d_values[ m_otu1 ][ m_i ] + _d_values[ m_otu2 ][ m_i ] ) - d ) / 2; } } else { if ( otu2 > i ) { - _d_values[ m_i ][ m_otu1 ] = ( _d_values[ m_i ][ m_otu1 ] + _d_values[ m_i ][ m_otu2 ] - d ) / 2; + _d_values[ m_i ][ m_otu1 ] = ( ( _d_values[ m_i ][ m_otu1 ] + _d_values[ m_i ][ m_otu2 ] ) - d ) / 2; } else { - _d_values[ m_i ][ m_otu1 ] = ( _d_values[ m_i ][ m_otu1 ] + _d_values[ m_otu2 ][ m_i ] - d ) / 2; + _d_values[ m_i ][ m_otu1 ] = ( ( _d_values[ m_i ][ m_otu1 ] + _d_values[ m_otu2 ][ m_i ] ) - d ) / 2; } } } diff --git a/forester/java/src/org/forester/evoinference/distance/NeighborJoiningR.java b/forester/java/src/org/forester/evoinference/distance/NeighborJoiningR.java index be18018..081be11 100644 --- a/forester/java/src/org/forester/evoinference/distance/NeighborJoiningR.java +++ b/forester/java/src/org/forester/evoinference/distance/NeighborJoiningR.java @@ -183,12 +183,12 @@ public final class NeighborJoiningR { } double new_d; if ( otu1 < mj ) { - new_d = ( _d_values[ otu1 ][ mj ] + getDvalue( j, otu2 ) - d ) / 2; + new_d = ( ( _d_values[ otu1 ][ mj ] + getDvalue( j, otu2 ) ) - d ) / 2; _s.addPairing( new_d, otu1, mj ); _d_values[ otu1 ][ mj ] = new_d; } else { - new_d = ( _d_values[ mj ][ otu1 ] + getDvalue( j, otu2 ) - d ) / 2; + new_d = ( ( _d_values[ mj ][ otu1 ] + getDvalue( j, otu2 ) ) - d ) / 2; _s.addPairing( new_d, mj, otu1 ); _d_values[ mj ][ otu1 ] = new_d; } diff --git a/forester/java/src/org/forester/evoinference/distance/Sarray.java b/forester/java/src/org/forester/evoinference/distance/Sarray.java index b044015..6e30f5c 100644 --- a/forester/java/src/org/forester/evoinference/distance/Sarray.java +++ b/forester/java/src/org/forester/evoinference/distance/Sarray.java @@ -133,7 +133,7 @@ public final class Sarray { } else { final int[] x = new int[ m.get( key ).length + 1 ]; - for( int i = 0; i < x.length - 1; i++ ) { + for( int i = 0; i < ( x.length - 1 ); i++ ) { x[ i ] = m.get( key )[ i ]; } x[ x.length - 1 ] = value; diff --git a/forester/java/src/org/forester/go/BasicGoRelationship.java b/forester/java/src/org/forester/go/BasicGoRelationship.java index 690c5f1..270f31a 100644 --- a/forester/java/src/org/forester/go/BasicGoRelationship.java +++ b/forester/java/src/org/forester/go/BasicGoRelationship.java @@ -133,7 +133,7 @@ public class BasicGoRelationship implements GoRelationship { case HAS_PART: sb.append( HAS_PART_STR ); break; - case OCCURS_IN: + case OCCURS_IN: sb.append( OCCURS_IN_STR ); break; default: diff --git a/forester/java/src/org/forester/go/GoRelationship.java b/forester/java/src/org/forester/go/GoRelationship.java index f46dd50..a219ab0 100644 --- a/forester/java/src/org/forester/go/GoRelationship.java +++ b/forester/java/src/org/forester/go/GoRelationship.java @@ -32,7 +32,7 @@ public interface GoRelationship extends Comparable { public static final String NEGATIVELY_REGULATES_STR = "negatively_regulates"; public static final String POSITIVELY_REGULATES_STR = "positively_regulates"; public static final String HAS_PART_STR = "has_part"; - public static final String OCCURS_IN_STR ="occurs_in"; + public static final String OCCURS_IN_STR = "occurs_in"; public GoId getGoId(); diff --git a/forester/java/src/org/forester/msa/DeleteableMsa.java b/forester/java/src/org/forester/msa/DeleteableMsa.java index 172ce4d..fee7bd3 100644 --- a/forester/java/src/org/forester/msa/DeleteableMsa.java +++ b/forester/java/src/org/forester/msa/DeleteableMsa.java @@ -119,9 +119,9 @@ public final class DeleteableMsa extends BasicMsa { s = getSequence( row ); final char[] x = s.getMolecularSequence(); sb = new StringBuilder( x.length ); - for( int i = 0; i < x.length; ++i ) { - if ( x[ i ] != Sequence.GAP ) { - sb.append( x[ i ] ); + for( final char element : x ) { + if ( element != Sequence.GAP ) { + sb.append( element ); } } } @@ -200,7 +200,7 @@ public final class DeleteableMsa extends BasicMsa { final private void deleteColumn( final int col ) { checkColumn( col ); - for( int c = col; c < _length - 1; ++c ) { + for( int c = col; c < ( _length - 1 ); ++c ) { _mapped_col_positions[ c ] = _mapped_col_positions[ c + 1 ]; } --_length; @@ -208,7 +208,7 @@ public final class DeleteableMsa extends BasicMsa { final private void deleteRow( final int row ) { checkRow( row ); - for( int r = row; r < _seqs - 1; ++r ) { + for( int r = row; r < ( _seqs - 1 ); ++r ) { _mapped_row_positions[ r ] = _mapped_row_positions[ r + 1 ]; } --_seqs; diff --git a/forester/java/src/org/forester/phylogeny/PhylogenyMethods.java b/forester/java/src/org/forester/phylogeny/PhylogenyMethods.java index eba76de..9e0c782 100644 --- a/forester/java/src/org/forester/phylogeny/PhylogenyMethods.java +++ b/forester/java/src/org/forester/phylogeny/PhylogenyMethods.java @@ -277,7 +277,7 @@ public class PhylogenyMethods { } return max; } - + public static PhylogenyNode calculateNodeWithMaxDistanceToRoot( final Phylogeny phy ) { double max = 0.0; PhylogenyNode max_node = phy.getFirstExternalNode(); diff --git a/forester/java/src/org/forester/phylogeny/data/NodeData.java b/forester/java/src/org/forester/phylogeny/data/NodeData.java index add11c9..ab6f055 100644 --- a/forester/java/src/org/forester/phylogeny/data/NodeData.java +++ b/forester/java/src/org/forester/phylogeny/data/NodeData.java @@ -279,7 +279,7 @@ public class NodeData implements PhylogenyData { return ( getDate() != null ) && ( !ForesterUtil.isEmpty( getDate().getDesc() ) || !ForesterUtil.isNull( getDate().getMax() ) || !ForesterUtil.isNull( getDate().getMin() ) || !ForesterUtil.isNull( getDate().getValue() ) || !ForesterUtil - .isEmpty( getDate().getUnit() ) ); + .isEmpty( getDate().getUnit() ) ); } public boolean isHasDistribution() { diff --git a/forester/java/src/org/forester/phylogeny/data/Taxonomy.java b/forester/java/src/org/forester/phylogeny/data/Taxonomy.java index 2e15149..955e298 100644 --- a/forester/java/src/org/forester/phylogeny/data/Taxonomy.java +++ b/forester/java/src/org/forester/phylogeny/data/Taxonomy.java @@ -249,7 +249,7 @@ public class Taxonomy implements PhylogenyData, MultipleUris, Comparable { } } + @Override public int compareTo( final DomainSimilarity domain_similarity ) { if ( this == domain_similarity ) { return EQUAL; @@ -629,6 +630,7 @@ public class DomainSimilarity implements Comparable { _base = base; } + @Override public int compare( final String a, final String b ) { if ( _base.get( a ) >= _base.get( b ) ) { return -1; -- 1.7.10.2