X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FAnnotationPanel.java;h=0f6901d018a510e3ae4909f71daa407de87f297a;hb=dd74fc4938723fe5ec48d4e5fdcfbe58ac42a48d;hp=1ebabfe55e3e763a68a59ffe52004429f9691eec;hpb=36c7b21df9a667ede49034e5274516d258590dd9;p=jalview.git diff --git a/src/jalview/gui/AnnotationPanel.java b/src/jalview/gui/AnnotationPanel.java index 1ebabfe..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(); @@ -546,12 +559,16 @@ public class AnnotationPanel extends JPanel implements MouseListener, 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); } /**