doesn't create an image for drawing, important for printing
[jalview.git] / src / jalview / gui / ScaleCanvas.java
index 4a0bd2a..7e4b617 100755 (executable)
@@ -5,11 +5,6 @@ import javax.swing.*;
 \r
 public class ScaleCanvas extends JPanel {\r
 \r
-  Image    img;\r
-  Graphics gg;\r
-\r
-  int      imgWidth;\r
-  int      imgHeight;\r
   int      xoffset;\r
 \r
   public static final int HEIGHT = 30;\r
@@ -28,34 +23,17 @@ public class ScaleCanvas extends JPanel {
   }\r
 \r
 // scalewidth will normally be screenwidth,\r
-  public void drawScale(Graphics g, int startx, int endx, int scaleWidth)\r
+  public void drawScale(Graphics gg, int startx, int endx, int scaleWidth)\r
   {\r
 \r
     double charWidth  = av.getCharWidth();\r
 \r
-    if (img == null ||\r
-        imgWidth  != scaleWidth  ||\r
-        imgHeight != getHeight() ||\r
-        paintFlag == true) {\r
-\r
-      imgWidth  = scaleWidth;\r
-      imgHeight = getHeight();\r
-      img       = createImage(imgWidth,imgHeight);\r
-\r
-      gg = img.getGraphics();\r
-      gg.setColor(Color.white);\r
-      gg.fillRect(0,0,imgWidth,imgHeight);\r
-\r
-\r
-\r
-      paintFlag = false;\r
-    }\r
     gg.setFont(av.getFont());\r
 \r
     //Fill in the background\r
 \r
     gg.setColor(Color.white);\r
-    gg.fillRect(0,0,imgWidth,imgHeight);\r
+    gg.fillRect(0,0,scaleWidth, HEIGHT);\r
 \r
     int resWidth = endx - startx + 1;\r
 \r
@@ -116,8 +94,6 @@ public class ScaleCanvas extends JPanel {
     }\r
 \r
 \r
-    g.drawImage(img,0,0,this);\r
-\r
   }\r
 \r
   public Dimension getMinimumSize() {\r