in progress
authorcmzmasek@gmail.com <cmzmasek@gmail.com@ca865154-3058-d1c3-3e42-d8f55a55bdbd>
Sat, 17 Sep 2011 03:19:09 +0000 (03:19 +0000)
committercmzmasek@gmail.com <cmzmasek@gmail.com@ca865154-3058-d1c3-3e42-d8f55a55bdbd>
Sat, 17 Sep 2011 03:19:09 +0000 (03:19 +0000)
forester/java/src/org/forester/analysis/AncestralTaxonomyInference.java
forester/java/src/org/forester/application/simple_node_processor.java
forester/java/src/org/forester/archaeopteryx/MainFrameApplication.java
forester/java/src/org/forester/archaeopteryx/NodeEditPanel.java
forester/java/src/org/forester/archaeopteryx/NodePanel.java
forester/java/src/org/forester/archaeopteryx/TreePanel.java
forester/java/src/org/forester/archaeopteryx/tools/TaxonomyDataObtainer.java
forester/java/src/org/forester/phylogeny/PhylogenyNode.java
forester/java/src/org/forester/ws/uniprot/UniProtTaxonomy.java

index fb34a14..e422508 100644 (file)
@@ -203,11 +203,11 @@ public final class AncestralTaxonomyInference {
                     node = "[" + desc.getId() + "]";
                 }
                 msg = "Node " + node + " has no or inappropriate taxonomic information";
-                List<PhylogenyNode> e = desc.getAllExternalDescendants();
+                final List<PhylogenyNode> e = desc.getAllExternalDescendants();
                 //TODO remove me!
                 System.out.println();
                 int x = 0;
-                for( PhylogenyNode object : e ) {
+                for( final PhylogenyNode object : e ) {
                     System.out.println( x + ":" );
                     System.out.println( object.getName() + "  " );
                     x++;
@@ -232,10 +232,10 @@ public final class AncestralTaxonomyInference {
         if ( last_common_lineage == null ) {
             System.out.println( "No common lineage for:" );
             int counter = 0;
-            for( String[] strings : lineages ) {
+            for( final String[] strings : lineages ) {
                 System.out.print( counter + ": " );
                 ++counter;
-                for( String string : strings ) {
+                for( final String string : strings ) {
                     System.out.print( string + " " );
                 }
                 System.out.println();
@@ -328,7 +328,7 @@ public final class AncestralTaxonomyInference {
             }
         }
         if ( delete ) {
-            for( PhylogenyNode node : not_found_external_nodes ) {
+            for( final PhylogenyNode node : not_found_external_nodes ) {
                 phy.deleteSubtree( node, false );
             }
             phy.recalculateNumberOfExternalDescendants( true );
index c7e495a..5fc4180 100644 (file)
@@ -43,22 +43,22 @@ public class simple_node_processor {
         File in = null;
         File out = null;
         if ( ( args.length != 2 ) ) {
-           // System.exit( -1 );
+            // System.exit( -1 );
             if ( ( args.length == 0 ) ) {
-                in = new File("C:\\Users\\zma\\dollo.xml");
+                in = new File( "C:\\Users\\zma\\dollo.xml" );
                 out = null;
             }
         }
         try {
-            System.out.println( "...");
+            System.out.println( "..." );
             CommandLineArguments cla = null;
             cla = new CommandLineArguments( args );
-           // in = cla.getFile( 0 );
-           // out = cla.getFile( 1 );
-           // if ( out.exists() ) {
-          //      System.out.println( out + " already exists" );
-          //      System.exit( -1 );
-          //  }
+            // in = cla.getFile( 0 );
+            // out = cla.getFile( 1 );
+            // if ( out.exists() ) {
+            //      System.out.println( out + " already exists" );
+            //      System.exit( -1 );
+            //  }
             final PhylogenyFactory factory = ParserBasedPhylogenyFactory.getInstance();
             final PhyloXmlParser xml_parser = new PhyloXmlParser();
             final Phylogeny[] phylogenies_0 = factory.create( in, xml_parser );
index 97a7a7a..5c4d546 100644 (file)
@@ -245,7 +245,7 @@ public final class MainFrameApplication extends MainFrame {
                                 MainFrameApplication.class );
                     UIManager.setLookAndFeel( synth );
                 }
-                catch ( Exception ex ) {
+                catch ( final Exception ex ) {
                     synth_exception = true;
                     ForesterUtil.printWarningMessage( Constants.PRG_NAME,
                                                       "could not create synth look and feel: "
index a485376..f4bbca8 100644 (file)
@@ -185,14 +185,11 @@ class NodeEditPanel extends JPanel {
                                PHYLOXML_TAG.CONFIDENCE_TYPE,
                                counter );
         String bw = "1";
-        if ( phylogeny_node.getBranchData().getBranchWidth() != null
-                && phylogeny_node.getBranchData().getBranchWidth().getValue() != BranchWidth.BRANCH_WIDTH_DEFAULT_VALUE
-        )
-        {
+        if ( ( phylogeny_node.getBranchData().getBranchWidth() != null )
+                && ( phylogeny_node.getBranchData().getBranchWidth().getValue() != BranchWidth.BRANCH_WIDTH_DEFAULT_VALUE ) ) {
             bw = ForesterUtil.FORMATTER_3.format( phylogeny_node.getBranchData().getBranchWidth().getValue() );
         }
         addSubelementEditable( category, NodePanel.NODE_BRANCH_WIDTH, bw, PHYLOXML_TAG.NODE_BRANCH_WIDTH );
-        
     }
 
     //    private void addAnnotation( final DefaultMutableTreeNode top, final Annotation ann, final String name ) {
@@ -679,7 +676,7 @@ class NodeEditPanel extends JPanel {
                     try {
                         final double bw = ForesterUtil.parseDouble( value );
                         if ( bw >= 0 ) {
-                            getMyNode().getBranchData().setBranchWidth( new BranchWidth(bw ) );
+                            getMyNode().getBranchData().setBranchWidth( new BranchWidth( bw ) );
                         }
                     }
                     catch ( final ParseException e ) {
@@ -690,7 +687,7 @@ class NodeEditPanel extends JPanel {
                         mtn.setUserObject( "" );
                     }
                 }
-                break;    
+                break;
             case CONFIDENCE_VALUE:
                 double confidence = Confidence.CONFIDENCE_DEFAULT_VALUE;
                 if ( !ForesterUtil.isEmpty( value ) ) {
index 7646342..0cc491c 100644 (file)
@@ -226,7 +226,6 @@ class NodePanel extends JPanel implements TreeSelectionListener {
                 addSubelement( category, CONFIDENCE, conf.asText().toString() );
             }
         }
-       
         if ( !phylogeny_node.isExternal() ) {
             addSubelement( category, "Children", String.valueOf( phylogeny_node.getNumberOfDescendants() ) );
             addSubelement( category,
@@ -261,10 +260,8 @@ class NodePanel extends JPanel implements TreeSelectionListener {
                            ForesterUtil.FORMATTER_3.format( phylogeny_node.getBranchData().getBranchWidth().getValue() ) );
         }
         if ( ( phylogeny_node.getBranchData().getBranchColor() != null ) ) {
-            Color c = phylogeny_node.getBranchData().getBranchColor().getValue();
-            addSubelement( category,
-                           NODE_BRANCH_COLOR,
-                            c.getRed() + ", " + c.getGreen() + ", "+ c.getBlue() );
+            final Color c = phylogeny_node.getBranchData().getBranchColor().getValue();
+            addSubelement( category, NODE_BRANCH_COLOR, c.getRed() + ", " + c.getGreen() + ", " + c.getBlue() );
         }
     }
 
index 086fb1a..9680205 100644 (file)
@@ -2436,7 +2436,7 @@ public final class TreePanel extends JPanel implements ActionListener, MouseWhee
                               final boolean to_pdf,
                               final boolean to_graphics_file ) {
         final int circ_num_ext_nodes = phy.getNumberOfExternalNodes() - _collapsed_external_nodeid_set.size();
-        System.out.println( "# collapsed external = " +  _collapsed_external_nodeid_set.size() );
+        System.out.println( "# collapsed external = " + _collapsed_external_nodeid_set.size() );
         _root = phy.getRoot();
         _root.setXcoord( center_x );
         _root.setYcoord( center_y );
index 952d3fa..3101295 100644 (file)
@@ -48,7 +48,7 @@ public class TaxonomyDataObtainer implements Runnable {
     public TaxonomyDataObtainer( final MainFrameApplication mf,
                                  final TreePanel treepanel,
                                  final Phylogeny phy,
-                                 boolean delete ) {
+                                 final boolean delete ) {
         _phy = phy;
         _mf = mf;
         _treepanel = treepanel;
index dd3dba0..7c272e6 100644 (file)
 
 package org.forester.phylogeny;
 
-import java.io.IOException;
 import java.util.ArrayList;
 import java.util.List;
 
-import org.forester.archaeopteryx.Archaeopteryx;
 import org.forester.io.parsers.nhx.NHXFormatException;
 import org.forester.io.parsers.nhx.NHXParser;
 import org.forester.phylogeny.data.BranchData;
 import org.forester.phylogeny.data.NodeData;
-import org.forester.phylogeny.factories.ParserBasedPhylogenyFactory;
-import org.forester.phylogeny.factories.PhylogenyFactory;
 import org.forester.phylogeny.iterators.ChildNodeIteratorForward;
 import org.forester.phylogeny.iterators.PhylogenyNodeIterator;
 import org.forester.phylogeny.iterators.PreorderTreeIterator;
@@ -457,10 +453,7 @@ public class PhylogenyNode implements PhylogenyNodeI, Comparable<PhylogenyNode>
         }
         return current_node;
     }
-    
-  
-    
-    
+
     public final NodeData getNodeData() {
         if ( _node_data == null ) {
             _node_data = new NodeData();
index 5e9053a..57a483e 100644 (file)
@@ -100,7 +100,7 @@ public final class UniProtTaxonomy {
                 }
             }
             for( int i = 0; i < temp.size(); ++i ) {
-                if ( i == 0
+                if ( ( i == 0 )
                         && ( temp.get( i ).equalsIgnoreCase( EUKARYOTA ) || temp.get( i ).equalsIgnoreCase( BACTERIA ) || temp
                                 .get( i ).equalsIgnoreCase( ARCHAEA ) ) ) {
                     _lineage.add( CELLULAR_ORGANISMS );
@@ -144,7 +144,7 @@ public final class UniProtTaxonomy {
                             final String rank,
                             final String id ) {
         _lineage = new ArrayList<String>();
-        for( String l : lineage ) {
+        for( final String l : lineage ) {
             _lineage.add( l );
         }
         _code = code;
@@ -187,9 +187,9 @@ public final class UniProtTaxonomy {
     }
 
     public String[] getLineageAsArray() {
-        String[] str = new String[ _lineage.size() ];
+        final String[] str = new String[ _lineage.size() ];
         int i = 0;
-        for( String l : _lineage ) {
+        for( final String l : _lineage ) {
             str[ i++ ] = l;
         }
         return str;