JAL-629 Add --renderer arg/subval for vector output and fixed annotation renderer...
[jalview.git] / src / jalview / gui / AnnotationPanel.java
index eeda585..f1a8af7 100755 (executable)
@@ -605,7 +605,8 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI,
     }
     else
     {
-      // no row (or row that can be adjusted) was pressed. Simulate a ruler click
+      // no row (or row that can be adjusted) was pressed. Simulate a ruler
+      // click
       ap.getScalePanel().mousePressed(evt);
     }
   }
@@ -752,6 +753,7 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI,
     av.sendSelection();
     return true;
   }
+
   /**
    * Construct and display a context menu at the right-click position
    * 
@@ -1016,7 +1018,8 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI,
     }
     if (rowIndex[0] != toRowIndex[0])
     {
-      jalview.bin.Console.trace("Drag went to another row. needs to be clipped");
+      jalview.bin.Console
+              .trace("Drag went to another row. needs to be clipped");
     }
 
     // rectangular selection on matrix style annotation
@@ -1043,9 +1046,9 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI,
               rowIndex[1] - deltaY);
 
       // mark rectangular region formed by drag
-      jalview.bin.Console.trace("Matrix Selection from last(" + fromXc + ",["
-              + lastXci.cStart + "," + lastXci.cEnd + "]) to cur(" + toXc
-              + ",[" + cXci.cStart + "," + cXci.cEnd + "])");
+      jalview.bin.Console.trace("Matrix Selection from last(" + fromXc
+              + ",[" + lastXci.cStart + "," + lastXci.cEnd + "]) to cur("
+              + toXc + ",[" + cXci.cStart + "," + cXci.cEnd + "])");
       int fr, to;
       fr = Math.min(lastXci.cStart, lastXci.cEnd);
       to = Math.max(lastXci.cStart, lastXci.cEnd);
@@ -1404,8 +1407,7 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI,
         return;
       }
     }
-    imgWidth = (av.getRanges().getEndRes() - av.getRanges().getStartRes()
-            + 1) * av.getCharWidth();
+    updateFadedImageWidth();
     if (imgWidth < 1)
     {
       return;
@@ -1473,6 +1475,13 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI,
     g.drawImage(image, 0, 0, this);
   }
 
+  public void updateFadedImageWidth()
+  {
+    imgWidth = (av.getRanges().getEndRes() - av.getRanges().getStartRes()
+            + 1) * av.getCharWidth();
+
+  }
+
   /**
    * set true to enable redraw timing debug output on stderr
    */
@@ -1648,6 +1657,7 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI,
   @Override
   public int getFadedImageWidth()
   {
+    updateFadedImageWidth();
     return imgWidth;
   }