X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=forester%2Fjava%2Fsrc%2Forg%2Fforester%2Fphylogeny%2Fdata%2FDistribution.java;h=0616f942e59ff5b454910c39a40d7b1b83812cd8;hb=4ca4ac162d7a3caa78a08c28213a0451968cd1ad;hp=92c219d5647f66a06e89720591397b87a81b9720;hpb=eee996a6476a1e3d84c07f8f690dcde3ff4b2ef5;p=jalview.git diff --git a/forester/java/src/org/forester/phylogeny/data/Distribution.java b/forester/java/src/org/forester/phylogeny/data/Distribution.java index 92c219d..0616f94 100644 --- a/forester/java/src/org/forester/phylogeny/data/Distribution.java +++ b/forester/java/src/org/forester/phylogeny/data/Distribution.java @@ -23,7 +23,7 @@ // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA // // Contact: phylosoft @ gmail . com -// WWW: www.phylosoft.org/forester +// WWW: https://sites.google.com/site/cmzmasek/home/software/forester package org.forester.phylogeny.data; @@ -61,6 +61,12 @@ public class Distribution implements PhylogenyData { } public boolean isEmpty() { + if ( ForesterUtil.isEmpty( _desc ) && ( ( getPoints() != null ) && ( getPoints().size() == 1 ) ) + && ForesterUtil.isEmpty( _polygons ) ) { + if ( Point.isSeemsEmpty( getPoints().get( 0 ) ) ) { + return true; + } + } return ForesterUtil.isEmpty( _desc ) && ForesterUtil.isEmpty( _points ) && ForesterUtil.isEmpty( _polygons ); } @@ -79,7 +85,7 @@ public class Distribution implements PhylogenyData { int i = 0; if ( getPoints() != null ) { for( final Point point : getPoints() ) { - if ( point != null ) { + if ( ( point != null ) && !Point.isSeemsEmpty( point ) ) { sb.append( ForesterUtil.LINE_SEPARATOR ); sb.append( " Point " + i + ": " ); sb.append( point.asSimpleText() ); @@ -162,12 +168,16 @@ public class Distribution implements PhylogenyData { final String ind = indentation + PhylogenyWriter.PHYLO_XML_INTENDATION_BASE; if ( getPoints() != null ) { for( final Point point : getPoints() ) { - point.toPhyloXML( writer, level, ind ); + if ( ( point != null ) && !Point.isSeemsEmpty( point ) ) { + point.toPhyloXML( writer, level, ind ); + } } } if ( getPolygons() != null ) { for( final Polygon polygon : getPolygons() ) { - polygon.toPhyloXML( writer, level, ind ); + if ( polygon != null ) { + polygon.toPhyloXML( writer, level, ind ); + } } } writer.write( ForesterUtil.LINE_SEPARATOR );