Merge remote-tracking branch 'origin/develop' into features/JAL-2388OverviewWindow
[jalview.git] / src / jalview / gui / IdCanvas.java
index fe42e1e..c753cae 100755 (executable)
@@ -98,8 +98,7 @@ public class IdCanvas extends JPanel
    *          DOCUMENT ME!
    */
   public void drawIdString(Graphics2D gg, boolean hiddenRows, SequenceI s,
-          int i, int starty,
-          int ypos)
+          int i, int starty, int ypos)
   {
     int xPos = 0;
     int panelWidth = getWidth();
@@ -162,17 +161,17 @@ public class IdCanvas extends JPanel
     gg.copyArea(0, 0, getWidth(), imgHeight, 0,
             -vertical * av.getCharHeight());
 
-    int ss = av.startSeq;
-    int es = av.endSeq;
+    int ss = av.getStartSeq();
+    int es = av.getEndSeq();
     int transY = 0;
 
     if (vertical > 0) // scroll down
     {
       ss = es - vertical;
 
-      if (ss < av.startSeq)
+      if (ss < av.getStartSeq())
       { // ie scrolling too fast, more than a page at a time
-        ss = av.startSeq;
+        ss = av.getStartSeq();
       }
       else
       {
@@ -183,9 +182,9 @@ public class IdCanvas extends JPanel
     {
       es = ss - vertical;
 
-      if (es > av.endSeq)
+      if (es > av.getEndSeq())
       {
-        es = av.endSeq;
+        es = av.getEndSeq();
       }
     }
 
@@ -205,6 +204,7 @@ public class IdCanvas extends JPanel
    * @param g
    *          DOCUMENT ME!
    */
+  @Override
   public void paintComponent(Graphics g)
   {
     g.setColor(Color.white);
@@ -240,7 +240,7 @@ public class IdCanvas extends JPanel
     gg.setColor(Color.white);
     gg.fillRect(0, 0, getWidth(), imgHeight);
 
-    drawIds(av.getStartSeq(), av.endSeq);
+    drawIds(av.getStartSeq(), av.getEndSeq());
 
     g.drawImage(image, 0, 0, this);
   }
@@ -317,7 +317,7 @@ public class IdCanvas extends JPanel
       int rowSize = av.getEndRes() - av.getStartRes();
 
       // Draw the rest of the panels
-      for (int ypos = hgap, row = av.startRes; (ypos <= getHeight())
+      for (int ypos = hgap, row = av.getStartRes(); (ypos <= getHeight())
               && (row < maxwidth); ypos += cHeight, row += rowSize)
       {
         for (int i = starty; i < alheight; i++)
@@ -453,11 +453,9 @@ public class IdCanvas extends JPanel
     if (below)
     {
       gg.fillPolygon(
-              new int[]
-              { getWidth() - av.getCharHeight(),
-                  getWidth() - av.getCharHeight(),
-                  getWidth() }, new int[]
-              {
+              new int[] { getWidth() - av.getCharHeight(),
+                  getWidth() - av.getCharHeight(), getWidth() },
+              new int[] {
                   (i - starty) * av.getCharHeight() + yoffset,
                   (i - starty) * av.getCharHeight() + yoffset
                           + av.getCharHeight() / 4,
@@ -466,11 +464,9 @@ public class IdCanvas extends JPanel
     if (above)
     {
       gg.fillPolygon(
-              new int[]
-              { getWidth() - av.getCharHeight(),
-                  getWidth() - av.getCharHeight(),
-                  getWidth() }, new int[]
-              {
+              new int[] { getWidth() - av.getCharHeight(),
+                  getWidth() - av.getCharHeight(), getWidth() },
+              new int[] {
                   (i - starty + 1) * av.getCharHeight() + yoffset,
                   (i - starty + 1) * av.getCharHeight() + yoffset
                           - av.getCharHeight() / 4,
@@ -484,7 +480,7 @@ public class IdCanvas extends JPanel
     Font bold = new Font(av.getFont().getName(), Font.BOLD, av.getFont()
             .getSize());
 
-    if (av.isHiddenRepSequence(seq))
+    if (av.isReferenceSeq(seq) || av.isHiddenRepSequence(seq))
     {
       gg.setFont(bold);
     }