public boolean isHasBranchWidth() { return getBranchWidth() != null; }
/** * Convenience method */ public static double getBranchWidthValue( final PhylogenyNode node ) { if ( !node.getBranchData().isHasBranchWidth() ) { return BranchWidth.BRANCH_WIDTH_DEFAULT_VALUE; } return node.getBranchData().getBranchWidth().getValue(); }
counter ); String bw = "1"; 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() );
if ( ( phylogeny_node.getBranchData().getBranchWidth() != null ) && ( phylogeny_node.getBranchData().getBranchWidth().getValue() != BranchWidth.BRANCH_WIDTH_DEFAULT_VALUE ) ) { addSubelement( category, NODE_BRANCH_WIDTH, ForesterUtil.FORMATTER_3.format( phylogeny_node.getBranchData().getBranchWidth().getValue() ) );
@Override public void toPhyloXML( final Writer writer, final int level, final String indentation ) throws IOException { if ( isHasConfidences() ) { for( final Confidence confidence : getConfidences() ) { confidence.toPhyloXML( writer, level, indentation ); } } if ( isHasBranchWidth() ) { getBranchWidth().toPhyloXML( writer, level, indentation ); } if ( isHasBranchColor() ) { getBranchColor().toPhyloXML( writer, level, indentation ); } } }
@Override public PhylogenyData copy() { final BranchData new_bd = new BranchData(); if ( isHasBranchColor() ) { new_bd.setBranchColor( ( BranchColor ) getBranchColor().copy() ); } if ( isHasBranchWidth() ) { new_bd.setBranchWidth( ( BranchWidth ) getBranchWidth().copy() ); } if ( isHasConfidences() ) { for( final Confidence confidence : getConfidences() ) { new_bd.addConfidence( ( Confidence ) confidence.copy() ); } } return new_bd; }
case NODE_BRANCH_WIDTH: if ( ForesterUtil.isEmpty( value ) || value.equals( "1" ) ) { if ( getMyNode().getBranchData().getBranchWidth() != null ) { getMyNode().getBranchData().setBranchWidth( new BranchWidth() );