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++;
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();
}
}
if ( delete ) {
- for( PhylogenyNode node : not_found_external_nodes ) {
+ for( final PhylogenyNode node : not_found_external_nodes ) {
phy.deleteSubtree( node, false );
}
phy.recalculateNumberOfExternalDescendants( true );
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 );
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: "
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 ) {
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 ) {
mtn.setUserObject( "" );
}
}
- break;
+ break;
case CONFIDENCE_VALUE:
double confidence = Confidence.CONFIDENCE_DEFAULT_VALUE;
if ( !ForesterUtil.isEmpty( value ) ) {
addSubelement( category, CONFIDENCE, conf.asText().toString() );
}
}
-
if ( !phylogeny_node.isExternal() ) {
addSubelement( category, "Children", String.valueOf( phylogeny_node.getNumberOfDescendants() ) );
addSubelement( category,
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() );
}
}
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 );
public TaxonomyDataObtainer( final MainFrameApplication mf,
final TreePanel treepanel,
final Phylogeny phy,
- boolean delete ) {
+ final boolean delete ) {
_phy = phy;
_mf = mf;
_treepanel = treepanel;
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;
}
return current_node;
}
-
-
-
-
+
public final NodeData getNodeData() {
if ( _node_data == null ) {
_node_data = new NodeData();
}
}
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 );
final String rank,
final String id ) {
_lineage = new ArrayList<String>();
- for( String l : lineage ) {
+ for( final String l : lineage ) {
_lineage.add( l );
}
_code = code;
}
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;