dif is never used
[jalview.git] / src / jalview / gui / AnnotationLabels.java
index e7e3970..a4be664 100755 (executable)
@@ -147,7 +147,6 @@ public class AnnotationLabels
    */
   public void actionPerformed(ActionEvent evt)
   {
-    int dif = 0;
     AlignmentAnnotation[] aa = ap.av.alignment.getAlignmentAnnotation();
 
     if (evt.getActionCommand().equals(ADDNEW))
@@ -163,10 +162,6 @@ public class AnnotationLabels
 
       ap.av.alignment.addAnnotation(newAnnotation);
       ap.av.alignment.setAnnotationIndex(newAnnotation, 0);
-      if (aa != null)
-      {
-        dif = aa[aa.length - 1].height;
-      }
     }
     else if (evt.getActionCommand().equals(EDITNAME))
     {
@@ -181,21 +176,17 @@ public class AnnotationLabels
       {
         ap.av.quality = null;
       }
-
-      dif = aa[selectedRow].height * -1;
     }
     else if (evt.getActionCommand().equals(DELETE))
     {
       ap.av.alignment.deleteAnnotation(aa[selectedRow]);
-      dif = aa[selectedRow].height * -1;
     }
     else if (evt.getActionCommand().equals(SHOWALL))
     {
       for (int i = 0; i < aa.length; i++)
       {
-        if (!aa[i].visible)
+        if (!aa[i].visible && aa[i].annotations!=null)
         {
-          dif += aa[i].height;
           aa[i].visible = true;
         }
       }
@@ -206,7 +197,7 @@ public class AnnotationLabels
           ap,
           new AlignmentAnnotation[]
           {aa[selectedRow]},
-          null
+          null, null
           );
     }
     else if (evt.getActionCommand().equals(COPYCONS_SEQ))
@@ -367,17 +358,31 @@ public class AnnotationLabels
 
     getSelectedRow(evt.getY() - scrollOffset);
 
+
     if (selectedRow > -1
         && ap.av.alignment.getAlignmentAnnotation().length > selectedRow)
     {
-      String desc = ap.av.alignment.
-          getAlignmentAnnotation()[selectedRow].description;
+      AlignmentAnnotation aa = ap.av.alignment.
+          getAlignmentAnnotation()[selectedRow];
+
+      StringBuffer desc = new StringBuffer("<html>");
+
+      if (aa.description != null && !aa.description.equals("New description"))
+      {
+        desc.append(aa.description+"<br>");
+      }
+      if(aa.hasScore())
+      {
+        desc.append("Score: "+aa.score);
+      }
 
-      if (desc != null && !desc.equals("New description"))
+      if(desc.length()!=6)
       {
-        setToolTipText(ap.av.alignment.
-                       getAlignmentAnnotation()[selectedRow].description);
+        desc.append("</html>");
+        this.setToolTipText(desc.toString());
       }
+      else
+        this.setToolTipText(null);
     }
 
   }