X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=forester%2Fjava%2Fsrc%2Forg%2Fforester%2Farchaeopteryx%2FAptxUtil.java;h=5b3dafaa1cbdedf0dc85d1e121e7386bbabf92a6;hb=a9e626aa67ff9cb1649c371f9d705eb04498cc33;hp=8f7963f15bcb98f696d4a25361138fb6bd5f44ff;hpb=fea4064e24c6cb362b0e033cf7047afd20f5f53f;p=jalview.git diff --git a/forester/java/src/org/forester/archaeopteryx/AptxUtil.java b/forester/java/src/org/forester/archaeopteryx/AptxUtil.java index 8f7963f..5b3dafa 100644 --- a/forester/java/src/org/forester/archaeopteryx/AptxUtil.java +++ b/forester/java/src/org/forester/archaeopteryx/AptxUtil.java @@ -766,18 +766,31 @@ public final class AptxUtil { } return false; } - + final static void lookAtRealBranchLengthsForAptxControlSettings( final Phylogeny t, + final ControlPanel cp ) { + if ( ( t != null ) && !t.isEmpty() ) { + final boolean has_bl = AptxUtil.isHasAtLeastOneBranchLengthLargerThanZero( t ); + if ( !has_bl ) { + cp.setDrawPhylogram( false ); + cp.setDrawPhylogramEnabled( false ); + } + else if ( cp.getDisplayAsPhylogramCb() != null ) { + cp.setDrawPhylogramEnabled( true ); + } + } + } final static void lookAtSomeTreePropertiesForAptxControlSettings( final Phylogeny t, final ControlPanel atv_control, final Configuration configuration ) { if ( ( t != null ) && !t.isEmpty() ) { - if ( !AptxUtil.isHasAtLeastOneBranchLengthLargerThanZero( t ) ) { + final boolean has_bl = AptxUtil.isHasAtLeastOneBranchLengthLargerThanZero( t ); + if ( !has_bl ) { atv_control.setDrawPhylogram( false ); atv_control.setDrawPhylogramEnabled( false ); } if ( configuration.doGuessCheckOption( Configuration.display_as_phylogram ) ) { if ( atv_control.getDisplayAsPhylogramCb() != null ) { - if ( AptxUtil.isHasAtLeastOneBranchLengthLargerThanZero( t ) ) { + if ( has_bl ) { atv_control.setDrawPhylogram( true ); atv_control.setDrawPhylogramEnabled( true ); }