@Override public PhylogenyData copy() { return new BranchWidth( getValue() ); }
@Override public StringBuffer asText() { return asSimpleText(); }
@Override public String toString() { return asText().toString(); } }
@Override public PhylogenyData parse( final XmlElement element ) throws PhyloXmlDataFormatException { return new BranchWidth( element.getValueAsDouble() ); }
@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; }
@Override public StringBuffer asSimpleText() { return new StringBuffer( getValue() + "" ); }
/** * Convenience method */ public static void setBranchWidthValue( final PhylogenyNode node, final double branch_width_value ) { node.getBranchData().setBranchWidth( new BranchWidth( branch_width_value ) ); }
@Override public void toPhyloXML( final Writer w, final int level, final String indentation ) throws IOException { w.write( ForesterUtil.LINE_SEPARATOR ); w.write( indentation ); PhylogenyDataUtil.appendElement( w, PhyloXmlMapping.WIDTH, getValue() + "" ); }
n.getBranchData().setBranchColor( new BranchColor( colors.get( n.getName() ) ) ); n.getBranchData().setBranchWidth( new BranchWidth( 4 ) );
/** * Convenience method */ public static double getBranchWidthValue( final PhylogenyNode node ) { if ( !node.getBranchData().isHasBranchWidth() ) { return BranchWidth.BRANCH_WIDTH_DEFAULT_VALUE; } return node.getBranchData().getBranchWidth().getValue(); }
if ( ForesterUtil.isEmpty( value ) || value.equals( "1" ) ) { if ( getMyNode().getBranchData().getBranchWidth() != null ) { getMyNode().getBranchData().setBranchWidth( new BranchWidth() ); final double bw = ForesterUtil.parseDouble( value ); if ( bw >= 0 ) { getMyNode().getBranchData().setBranchWidth( new BranchWidth( bw ) );