do not try to cancel jobs that cannot be cancelled
[jalview.git] / src / jalview / gui / AnnotationLabels.java
index a4be664..c0b8022 100755 (executable)
@@ -369,7 +369,9 @@ public class AnnotationLabels
 
       if (aa.description != null && !aa.description.equals("New description"))
       {
-        desc.append(aa.description+"<br>");
+        desc.append(aa.description);
+        if(aa.hasScore)
+          desc.append("<br>");
       }
       if(aa.hasScore())
       {
@@ -401,20 +403,19 @@ public class AnnotationLabels
 
     AlignmentAnnotation[] aa = ap.av.alignment.getAlignmentAnnotation();
 
+    JPopupMenu pop = new JPopupMenu("Annotations");
+    JMenuItem item = new JMenuItem(ADDNEW);
+    item.addActionListener(this);
+
     if ( (aa == null) || (aa.length == 0))
     {
-      JPopupMenu pop = new JPopupMenu("Annotations");
-      JMenuItem item = new JMenuItem(ADDNEW);
+      item = new JMenuItem(SHOWALL);
       item.addActionListener(this);
       pop.add(item);
       pop.show(this, evt.getX(), evt.getY());
-
       return;
     }
 
-    JPopupMenu pop = new JPopupMenu("Annotations");
-    JMenuItem item = new JMenuItem(ADDNEW);
-    item.addActionListener(this);
     pop.add(item);
     item = new JMenuItem(EDITNAME);
     item.addActionListener(this);
@@ -432,7 +433,7 @@ public class AnnotationLabels
     item.addActionListener(this);
     pop.add(item);
     // annotation object should be typed
-    if (aa[selectedRow] == ap.av.consensus)
+    if (selectedRow<aa.length && aa[selectedRow] == ap.av.consensus)
     {
       pop.addSeparator();
       final JCheckBoxMenuItem cbmi = new JCheckBoxMenuItem(