final public static void ensurePresenceOfDistribution( final PhylogenyNode node ) { if ( !node.getNodeData().isHasDistribution() ) { node.getNodeData().setDistribution( new Distribution( "" ) ); } }
private List<Point> obtainPoints() { ForesterUtil.ensurePresenceOfDistribution( getMyNode() ); Distribution d = getMyNode().getNodeData().getDistribution(); if ( d.getPoints() == null ) { d = new Distribution( d.getDesc(), new ArrayList<Point>(), d.getPolygons() ); getMyNode().getNodeData().setDistribution( d ); } final List<Point> ps = d.getPoints(); if ( ps.isEmpty() ) { ps.add( new Point() ); } else if ( ps.get( 0 ) == null ) { ps.set( 0, new Point() ); } return ps; }
ForesterUtil.ensurePresenceOfDistribution( getMyNode() ); final Distribution d = getMyNode().getNodeData().getDistribution(); getMyNode().getNodeData().setDistribution( new Distribution( value, d.getPoints(), d.getPolygons() ) ); break;