X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjalview%2Fgui%2FAnnotationPanel.java;h=0f6901d018a510e3ae4909f71daa407de87f297a;hb=dd74fc4938723fe5ec48d4e5fdcfbe58ac42a48d;hp=e0b36d37a8530646f29a7ebb78d882f6bc8176b3;hpb=a2497c9a753e13eeb17d33f73a697b4ad7ebdbc3;p=jalview.git diff --git a/src/jalview/gui/AnnotationPanel.java b/src/jalview/gui/AnnotationPanel.java index e0b36d3..0f6901d 100755 --- a/src/jalview/gui/AnnotationPanel.java +++ b/src/jalview/gui/AnnotationPanel.java @@ -167,6 +167,15 @@ public class AnnotationPanel extends JPanel implements MouseListener, AlignmentAnnotation[] aa = av.alignment.getAlignmentAnnotation(); Annotation[] anot = aa[activeRow].annotations; + if (anot.length < av.getColumnSelection().getMax()) + { + Annotation[] temp = new Annotation[av.getColumnSelection().getMax()+2 ]; + System.arraycopy(anot, 0, temp, 0, anot.length); + anot = temp; + aa[activeRow].annotations = anot; + } + + if (evt.getActionCommand().equals(REMOVE)) { for (int i = 0; i < av.getColumnSelection().size(); i++) @@ -492,6 +501,7 @@ public class AnnotationPanel extends JPanel implements MouseListener, if (aa == null) { + this.setToolTipText(null); return; } @@ -514,7 +524,10 @@ public class AnnotationPanel extends JPanel implements MouseListener, } if(row==-1) - return; + { + this.setToolTipText(null); + return; + } int res = (evt.getX() / av.getCharWidth()) + av.getStartRes(); @@ -539,18 +552,23 @@ public class AnnotationPanel extends JPanel implements MouseListener, this.setToolTipText(tip.toString() + ""); } } - else if(aa[row].annotations[res] != null) + else if(aa[row].annotations[res] != null + && aa[row].annotations[res].description!=null) this.setToolTipText(aa[row].annotations[res].description); if(aa[row].annotations[res]!=null) { StringBuffer text = new StringBuffer("Sequence position " + - (res + 1) + " " + - aa[row].annotations[res].description); + (res + 1)); + + if (aa[row].annotations[res].description != null) + text.append(" " + aa[row].annotations[res].description); ap.alignFrame.statusBar.setText(text.toString()); } } + else + this.setToolTipText(null); } /**