import org.forester.phylogeny.PhylogenyMethods;
import org.forester.phylogeny.PhylogenyMethods.DESCENDANT_SORT_PRIORITY;
import org.forester.phylogeny.PhylogenyNode;
+import org.forester.phylogeny.data.Confidence;
import org.forester.phylogeny.data.Taxonomy;
import org.forester.phylogeny.factories.ParserBasedPhylogenyFactory;
import org.forester.phylogeny.factories.PhylogenyFactory;
/**
* Returns true if at least one branch has a length larger than zero.
- *
- *
+ *
+ *
* @param phy
*/
final static public boolean isHasAtLeastOneBranchLengthLargerThanZero( final Phylogeny phy ) {
return false;
}
+ final static public boolean isHasAtLeastOneBranchWithSupportSD( final Phylogeny phy ) {
+ final PhylogenyNodeIterator it = phy.iteratorPostorder();
+ while ( it.hasNext() ) {
+ final PhylogenyNode n = it.next();
+ if ( n.getBranchData().isHasConfidences() ) {
+ final List<Confidence> c = n.getBranchData().getConfidences();
+ for( final Confidence confidence : c ) {
+ if ( confidence.getStandardDeviation() > 0 ) {
+ return true;
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+ final static public boolean isHasAtLeastOneNodeWithScientificName( final Phylogeny phy ) {
+ final PhylogenyNodeIterator it = phy.iteratorPostorder();
+ while ( it.hasNext() ) {
+ final PhylogenyNode n = it.next();
+ if ( n.getNodeData().isHasTaxonomy()
+ && !ForesterUtil.isEmpty( n.getNodeData().getTaxonomy().getScientificName() ) ) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ final static public boolean isHasAtLeastOneNodeWithSequenceAnnotation( final Phylogeny phy ) {
+ final PhylogenyNodeIterator it = phy.iteratorPostorder();
+ while ( it.hasNext() ) {
+ final PhylogenyNode n = it.next();
+ if ( n.getNodeData().isHasSequence()
+ && !ForesterUtil.isEmpty( n.getNodeData().getSequence().getAnnotations() ) ) {
+ return true;
+ }
+ }
+ return false;
+ }
+
final public static void launchWebBrowser( final URI uri,
final boolean is_applet,
final JApplet applet,
final ControlPanel ac,
final GraphicsExportType type,
final Options options ) throws IOException {
- tree_panel.calcParametersForPainting( width, height, true );
+ tree_panel.calcParametersForPainting( width, height );
tree_panel.resetPreferredSize();
tree_panel.repaint();
final RenderingHints rendering_hints = new RenderingHints( RenderingHints.KEY_RENDERING,
/**
* Exits with -1.
- *
- *
+ *
+ *
* @param message
* to message to be printed
*/
if ( options.isGraphicsExportVisibleOnly() ) {
throw new IllegalArgumentException( "cannot export visible rectangle only without exporting in actual size" );
}
- tree_panel.calcParametersForPainting( options.getPrintSizeX(), options.getPrintSizeY(), true );
+ tree_panel.calcParametersForPainting( options.getPrintSizeX(), options.getPrintSizeY() );
tree_panel.resetPreferredSize();
tree_panel.repaint();
}
if ( options.isGraphicsExportVisibleOnly() ) {
throw new IllegalArgumentException( "cannot export visible rectangle only without exporting in actual size" );
}
- tree_panel.calcParametersForPainting( options.getPrintSizeX(), options.getPrintSizeY(), true );
+ tree_panel.calcParametersForPainting( options.getPrintSizeX(), options.getPrintSizeY() );
tree_panel.resetPreferredSize();
tree_panel.repaint();
}