Merge branch 'merge/develop_JAL-1780_JAL-653_JAL-1892' into develop
[jalview.git] / src / jalview / gui / IdCanvas.java
index a7a4e34..fe42e1e 100755 (executable)
@@ -86,6 +86,8 @@ public class IdCanvas extends JPanel
    * 
    * @param gg
    *          DOCUMENT ME!
+   * @param hiddenRows
+   *          true - check and display hidden row marker if need be
    * @param s
    *          DOCUMENT ME!
    * @param i
@@ -95,7 +97,8 @@ public class IdCanvas extends JPanel
    * @param ypos
    *          DOCUMENT ME!
    */
-  public void drawIdString(Graphics2D gg, SequenceI s, int i, int starty,
+  public void drawIdString(Graphics2D gg, boolean hiddenRows, SequenceI s,
+          int i, int starty,
           int ypos)
   {
     int xPos = 0;
@@ -134,7 +137,7 @@ public class IdCanvas extends JPanel
     gg.drawString(s.getDisplayId(av.getShowJVSuffix()), xPos,
             (((i - starty + 1) * charHeight) + ypos) - (charHeight / 5));
 
-    if (av.hasHiddenRows() && av.getShowHiddenMarkers())
+    if (hiddenRows)
     {
       drawMarker(i, starty, ypos);
     }
@@ -274,6 +277,9 @@ public class IdCanvas extends JPanel
     Color currentColor = Color.white;
     Color currentTextColor = Color.black;
 
+    final boolean doHiddenCheck = av.isDisplayReferenceSeq()
+            || av.hasHiddenRows(), hiddenRows = av.hasHiddenRows();
+
     if (av.getWrapAlignment())
     {
       int maxwidth = av.getAlignment().getWidth();
@@ -317,7 +323,7 @@ public class IdCanvas extends JPanel
         for (int i = starty; i < alheight; i++)
         {
           SequenceI s = av.getAlignment().getSequenceAt(i);
-          if (av.isDisplayReferenceSeq() || av.hasHiddenRows())
+          if (doHiddenCheck)
           {
             setHiddenFont(s);
           }
@@ -326,7 +332,7 @@ public class IdCanvas extends JPanel
             gg.setFont(getIdfont());
           }
 
-          drawIdString(gg, s, i, 0, ypos);
+          drawIdString(gg, hiddenRows, s, i, 0, ypos);
         }
 
         if (labels != null && av.isShowAnnotation())
@@ -357,7 +363,7 @@ public class IdCanvas extends JPanel
           continue;
         }
 
-        if (av.isDisplayReferenceSeq() || av.hasHiddenRows())
+        if (doHiddenCheck)
         {
           setHiddenFont(sequence);
         }
@@ -399,7 +405,7 @@ public class IdCanvas extends JPanel
                 (((i - starty) * av.getCharHeight()) + av.getCharHeight())
                         - (av.getCharHeight() / 5));
 
-        if (av.hasHiddenRows() && av.getShowHiddenMarkers())
+        if (hiddenRows)
         {
           drawMarker(i, starty, 0);
         }