Merge develop to Release_2_8_3_Branch
[jalview.git] / src / jalview / gui / IdCanvas.java
index 011edf3..a7a4e34 100755 (executable)
  */
 package jalview.gui;
 
-import java.awt.*;
-import java.awt.image.*;
+import jalview.datamodel.SequenceI;
+
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.Font;
+import java.awt.FontMetrics;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.RenderingHints;
+import java.awt.image.BufferedImage;
 import java.util.List;
 
-import javax.swing.*;
-
-import jalview.datamodel.*;
+import javax.swing.JPanel;
 
 /**
  * DOCUMENT ME!
@@ -94,7 +100,7 @@ public class IdCanvas extends JPanel
   {
     int xPos = 0;
     int panelWidth = getWidth();
-    int charHeight = av.charHeight;
+    int charHeight = av.getCharHeight();
 
     if ((searchResults != null) && searchResults.contains(s))
     {
@@ -128,7 +134,7 @@ public class IdCanvas extends JPanel
     gg.drawString(s.getDisplayId(av.getShowJVSuffix()), xPos,
             (((i - starty + 1) * charHeight) + ypos) - (charHeight / 5));
 
-    if (av.hasHiddenRows() && av.showHiddenMarkers)
+    if (av.hasHiddenRows() && av.getShowHiddenMarkers())
     {
       drawMarker(i, starty, ypos);
     }
@@ -150,7 +156,8 @@ public class IdCanvas extends JPanel
       return;
     }
 
-    gg.copyArea(0, 0, getWidth(), imgHeight, 0, -vertical * av.charHeight);
+    gg.copyArea(0, 0, getWidth(), imgHeight, 0,
+            -vertical * av.getCharHeight());
 
     int ss = av.startSeq;
     int es = av.endSeq;
@@ -166,7 +173,7 @@ public class IdCanvas extends JPanel
       }
       else
       {
-        transY = imgHeight - (vertical * av.charHeight);
+        transY = imgHeight - (vertical * av.getCharHeight());
       }
     }
     else if (vertical < 0)
@@ -211,7 +218,7 @@ public class IdCanvas extends JPanel
     int oldHeight = imgHeight;
 
     imgHeight = getHeight();
-    imgHeight -= (imgHeight % av.charHeight);
+    imgHeight -= (imgHeight % av.getCharHeight());
 
     if (imgHeight < 1)
     {
@@ -245,7 +252,7 @@ public class IdCanvas extends JPanel
    */
   void drawIds(int starty, int endy)
   {
-    if (av.seqNameItalics)
+    if (av.isSeqNameItalics())
     {
       setIdfont(new Font(av.getFont().getName(), Font.ITALIC, av.getFont()
               .getSize()));
@@ -293,13 +300,13 @@ public class IdCanvas extends JPanel
         }
       }
 
-      int hgap = av.charHeight;
-      if (av.scaleAboveWrapped)
+      int hgap = av.getCharHeight();
+      if (av.getScaleAboveWrapped())
       {
-        hgap += av.charHeight;
+        hgap += av.getCharHeight();
       }
 
-      int cHeight = alheight * av.charHeight + hgap + annotationHeight;
+      int cHeight = alheight * av.getCharHeight() + hgap + annotationHeight;
 
       int rowSize = av.getEndRes() - av.getStartRes();
 
@@ -324,9 +331,9 @@ public class IdCanvas extends JPanel
 
         if (labels != null && av.isShowAnnotation())
         {
-          gg.translate(0, ypos + (alheight * av.charHeight));
+          gg.translate(0, ypos + (alheight * av.getCharHeight()));
           labels.drawComponent(gg, getWidth());
-          gg.translate(0, -ypos - (alheight * av.charHeight));
+          gg.translate(0, -ypos - (alheight * av.getCharHeight()));
         }
       }
     }
@@ -376,8 +383,8 @@ public class IdCanvas extends JPanel
 
         gg.setColor(currentColor);
 
-        gg.fillRect(0, (i - starty) * av.charHeight, getWidth(),
-                av.charHeight);
+        gg.fillRect(0, (i - starty) * av.getCharHeight(), getWidth(),
+                av.getCharHeight());
 
         gg.setColor(currentTextColor);
 
@@ -389,10 +396,10 @@ public class IdCanvas extends JPanel
         }
 
         gg.drawString(string, xPos,
-                (((i - starty) * av.charHeight) + av.charHeight)
-                        - (av.charHeight / 5));
+                (((i - starty) * av.getCharHeight()) + av.getCharHeight())
+                        - (av.getCharHeight() / 5));
 
-        if (av.hasHiddenRows() && av.showHiddenMarkers)
+        if (av.hasHiddenRows() && av.getShowHiddenMarkers())
         {
           drawMarker(i, starty, 0);
         }
@@ -441,24 +448,27 @@ public class IdCanvas extends JPanel
     {
       gg.fillPolygon(
               new int[]
-              { getWidth() - av.charHeight, getWidth() - av.charHeight,
+              { getWidth() - av.getCharHeight(),
+                  getWidth() - av.getCharHeight(),
                   getWidth() }, new int[]
               {
-                  (i - starty) * av.charHeight + yoffset,
-                  (i - starty) * av.charHeight + yoffset + av.charHeight
-                          / 4, (i - starty) * av.charHeight + yoffset }, 3);
+                  (i - starty) * av.getCharHeight() + yoffset,
+                  (i - starty) * av.getCharHeight() + yoffset
+                          + av.getCharHeight() / 4,
+                  (i - starty) * av.getCharHeight() + yoffset }, 3);
     }
     if (above)
     {
       gg.fillPolygon(
               new int[]
-              { getWidth() - av.charHeight, getWidth() - av.charHeight,
+              { getWidth() - av.getCharHeight(),
+                  getWidth() - av.getCharHeight(),
                   getWidth() }, new int[]
               {
-                  (i - starty + 1) * av.charHeight + yoffset,
-                  (i - starty + 1) * av.charHeight + yoffset
-                          - av.charHeight / 4,
-                  (i - starty + 1) * av.charHeight + yoffset }, 3);
+                  (i - starty + 1) * av.getCharHeight() + yoffset,
+                  (i - starty + 1) * av.getCharHeight() + yoffset
+                          - av.getCharHeight() / 4,
+                  (i - starty + 1) * av.getCharHeight() + yoffset }, 3);
 
     }
   }