X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FAnnotationLabels.java;h=52a6066db16bd0b27de610615574664aa6938374;hb=b3fb6325a8bc315c5c938faf10ffd2e73d965f16;hp=c01a6f3d3aa35108b41bc60a16c5d5193f995fcd;hpb=c2e6335a319d61b641fb6fcbb0a4a5dc88a58014;p=jalview.git diff --git a/src/jalview/gui/AnnotationLabels.java b/src/jalview/gui/AnnotationLabels.java index c01a6f3..52a6066 100755 --- a/src/jalview/gui/AnnotationLabels.java +++ b/src/jalview/gui/AnnotationLabels.java @@ -428,9 +428,9 @@ public class AnnotationLabels extends JPanel { final PAEContactMatrix cm = (PAEContactMatrix) av .getContactMatrix(aa[selectedRow]); - if (cm.getNewickString()!=null && cm.getNewickString().length()>0) + if (cm!=null && cm.getNewick()!=null && cm.getNewick().length()>0) { - item = new JMenuItem("Show Matrix"); + item = new JMenuItem("Show Tree for Matrix"); item.addActionListener(new ActionListener() { @@ -1087,6 +1087,7 @@ public class AnnotationLabels extends JPanel g.translate(0, getScrollOffset()); g.setColor(Color.black); SequenceI lastSeqRef = null; + String lastLabel = null; AlignmentAnnotation[] aa = av.getAlignment().getAlignmentAnnotation(); int fontHeight = g.getFont().getSize(); int y = 0; @@ -1111,6 +1112,7 @@ public class AnnotationLabels extends JPanel { hasHiddenRows = false; int olY = 0; + int nexAA = 0; for (int i = 0; i < aa.length; i++) { visible = true; @@ -1120,6 +1122,9 @@ public class AnnotationLabels extends JPanel continue; } olY = y; + // look ahead to next annotation + for (nexAA=i+1; nexAA