Merge branch 'JAL-1139_proguard' into develop
[jalview.git] / src / jalview / gui / AnnotationLabels.java
index 6df2088..c7fd4fe 100755 (executable)
@@ -29,6 +29,7 @@ import javax.swing.*;
 
 import jalview.datamodel.*;
 import jalview.io.*;
+import jalview.util.MessageManager;
 
 /**
  * DOCUMENT ME!
@@ -831,6 +832,8 @@ public class AnnotationLabels extends JPanel implements MouseListener,
   {
     drawComponent(g, false, width);
   }
+
+  private final boolean debugRedraw = false;
   /**
    * Draw the full set of annotation Labels for the alignment at the given cursor
    * 
@@ -880,8 +883,6 @@ public class AnnotationLabels extends JPanel implements MouseListener,
       for (int i = 0; i < aa.length; i++)
       {
         visible = true;
-        g.setColor(Color.black);
-
         if (!aa[i].visible)
         {
           hasHiddenRows = true;
@@ -893,7 +894,9 @@ public class AnnotationLabels extends JPanel implements MouseListener,
         {
           if (!before)
           {
-          System.out.println("before vis: "+i);
+            if (debugRedraw) {
+              System.out.println("before vis: "+i);
+            }
           before=true;
           }
           // don't draw what isn't visible
@@ -904,12 +907,16 @@ public class AnnotationLabels extends JPanel implements MouseListener,
 
           if (!after)
           {
-          System.out.println("Scroll offset: "+sOffset+" after vis: "+i);
+            if (debugRedraw) {
+              System.out.println("Scroll offset: "+sOffset+" after vis: "+i);
+            }
           after=true;
           }
           // don't draw what isn't visible
           continue;
         }}
+        g.setColor(Color.black);
+
         offset = -aa[i].height / 2;
 
         if (aa[i].hasText)
@@ -925,6 +932,7 @@ public class AnnotationLabels extends JPanel implements MouseListener,
         if (aa[i].graphGroup > -1)
         {
           int groupSize = 0;
+          // TODO: JAL-1291 revise rendering model so the graphGroup map is computed efficiently for all visible labels
           for (int gg = 0; gg < aa.length; gg++)
           {
             if (aa[gg].graphGroup == aa[i].graphGroup)
@@ -1002,8 +1010,8 @@ public class AnnotationLabels extends JPanel implements MouseListener,
 
     if (!av.wrapAlignment && ((aa == null) || (aa.length < 1)))
     {
-      g.drawString("Right click", 2, 8);
-      g.drawString("to add annotation", 2, 18);
+      g.drawString(MessageManager.getString("label.right_click"), 2, 8);
+      g.drawString(MessageManager.getString("label.to_add_annotation"), 2, 18);
     }
   }
 }