JAL-4273 release notes for visible adjuster marks, and patch so they are not rendered...
[jalview.git] / src / jalview / gui / AnnotationLabels.java
index 20e1b1b..d9d6b9f 100755 (executable)
@@ -1168,7 +1168,7 @@ public class AnnotationLabels extends JPanel
               RenderingHints.VALUE_ANTIALIAS_ON);
     }
 
-    drawComponent(g2, true, width);
+    drawComponent(g2, true, width, true);
   }
 
   /**
@@ -1183,7 +1183,7 @@ public class AnnotationLabels extends JPanel
    */
   public void drawComponent(Graphics g, int width)
   {
-    drawComponent(g, false, width);
+    drawComponent(g, false, width, true);
   }
 
   /**
@@ -1198,7 +1198,7 @@ public class AnnotationLabels extends JPanel
    * @param width
    *          Width for scaling labels
    */
-  public void drawComponent(Graphics g, boolean clip, int givenWidth)
+  public void drawComponent(Graphics g, boolean clip, int givenWidth, boolean forGUI)
   {
     int width = givenWidth;
     IdwidthAdjuster iwa = null;
@@ -1210,7 +1210,7 @@ public class AnnotationLabels extends JPanel
       {
         Graphics2D g2d = (Graphics2D) g;
         Graphics dummy = g2d.create();
-        int newAnnotationIdWidth = drawLabels(dummy, clip, width, false,
+        int newAnnotationIdWidth = drawLabels(dummy, clip, width, false, forGUI,
                 null);
         dummy.dispose();
         Dimension d = ap.calculateDefaultAlignmentIdWidth();
@@ -1245,10 +1245,10 @@ public class AnnotationLabels extends JPanel
     }
     else
     {
-      int newAnnotationIdWidth = drawLabels(g, clip, width, false, null);
+      int newAnnotationIdWidth = drawLabels(g, clip, width, false, forGUI, null);
       width = Math.max(newAnnotationIdWidth, givenWidth);
     }
-    drawLabels(g, clip, width, true, null);
+    drawLabels(g, clip, width, true, forGUI, null);
   }
 
   /**
@@ -1260,17 +1260,19 @@ public class AnnotationLabels extends JPanel
    * Returns the width of the annotation labels.
    * 
    * @param g
-   *          Graphics2D instance (needed for font scaling)
+   *          Graphics2D instance (used for rendering and font scaling if no fmetrics supplied) 
    * @param clip
    *          - true indicates that only current visible area needs to be
    *          rendered
    * @param width
    *          Width for scaling labels
+   * @param actuallyDraw - when false, no graphics are rendered to g0
+   * @param forGUI - when false, GUI relevant marks like indicators for dragging annotation panel height are not rendered
    * @param fmetrics
    *          FontMetrics if Graphics object g is null
    */
   public int drawLabels(Graphics g0, boolean clip, int width,
-          boolean actuallyDraw, FontMetrics fmetrics)
+          boolean actuallyDraw, boolean forGUI, FontMetrics fmetrics)
   {
     if (clip)
     {
@@ -1312,7 +1314,7 @@ public class AnnotationLabels extends JPanel
       g.fillRect(0, 0, getWidth(), getHeight());
 
       if (!Cache.getDefault(RESIZE_MARGINS_MARK_PREF, false)
-              && !av.getWrapAlignment())
+              && !av.getWrapAlignment() && forGUI)
       {
         g.setColor(Color.LIGHT_GRAY);
         g.drawLine(0, HEIGHT_ADJUSTER_HEIGHT / 4, HEIGHT_ADJUSTER_WIDTH / 4,
@@ -1587,4 +1589,9 @@ public class AnnotationLabels extends JPanel
   public void mouseEntered(MouseEvent e)
   {
   }
+
+  public void drawComponentNotGUI(Graphics idGraphics, int idWidth)
+  {
+    drawComponent(idGraphics, false, idWidth, false);
+  }
 }