JAL-1759 changed to non-deprecated Viewer.renderScreenImage()
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Fri, 26 Jun 2015 14:44:20 +0000 (15:44 +0100)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Fri, 26 Jun 2015 14:44:20 +0000 (15:44 +0100)
src/jalview/appletgui/AppletJmol.java
src/jalview/gui/AppJmol.java

index f54717d..b48070c 100644 (file)
  */
 package jalview.appletgui;
 
+import jalview.datamodel.AlignmentI;
+import jalview.datamodel.PDBEntry;
+import jalview.datamodel.SequenceI;
+import jalview.io.AppletFormatAdapter;
+import jalview.io.FileParse;
+import jalview.schemes.BuriedColourScheme;
+import jalview.schemes.HelixColourScheme;
+import jalview.schemes.HydrophobicColourScheme;
+import jalview.schemes.PurinePyrimidineColourScheme;
+import jalview.schemes.StrandColourScheme;
+import jalview.schemes.TaylorColourScheme;
+import jalview.schemes.TurnColourScheme;
+import jalview.schemes.UserColourScheme;
+import jalview.schemes.ZappoColourScheme;
+import jalview.structure.StructureSelectionManager;
+import jalview.util.MessageManager;
+
 import java.awt.BorderLayout;
 import java.awt.CheckboxMenuItem;
 import java.awt.Color;
@@ -31,7 +48,6 @@ import java.awt.Menu;
 import java.awt.MenuBar;
 import java.awt.MenuItem;
 import java.awt.Panel;
-import java.awt.Rectangle;
 import java.awt.TextArea;
 import java.awt.TextField;
 import java.awt.event.ActionEvent;
@@ -46,23 +62,6 @@ import java.util.ArrayList;
 import java.util.Hashtable;
 import java.util.Vector;
 
-import jalview.datamodel.AlignmentI;
-import jalview.datamodel.PDBEntry;
-import jalview.datamodel.SequenceI;
-import jalview.io.AppletFormatAdapter;
-import jalview.io.FileParse;
-import jalview.schemes.BuriedColourScheme;
-import jalview.schemes.HelixColourScheme;
-import jalview.schemes.HydrophobicColourScheme;
-import jalview.schemes.PurinePyrimidineColourScheme;
-import jalview.schemes.StrandColourScheme;
-import jalview.schemes.TaylorColourScheme;
-import jalview.schemes.TurnColourScheme;
-import jalview.schemes.UserColourScheme;
-import jalview.schemes.ZappoColourScheme;
-import jalview.structure.StructureSelectionManager;
-import jalview.util.MessageManager;
-
 public class AppletJmol extends EmbmenuFrame implements
 // StructureListener,
         KeyListener, ActionListener, ItemListener
@@ -643,8 +642,6 @@ public class AppletJmol extends EmbmenuFrame implements
   {
     Dimension currentSize = new Dimension();
 
-    Rectangle rectClip = new Rectangle();
-
     public void update(Graphics g)
     {
       paint(g);
@@ -653,7 +650,6 @@ public class AppletJmol extends EmbmenuFrame implements
     public void paint(Graphics g)
     {
       currentSize = this.getSize();
-      rectClip = g.getClipBounds();
 
       if (jmb.viewer == null)
       {
@@ -666,7 +662,8 @@ public class AppletJmol extends EmbmenuFrame implements
       }
       else
       {
-        jmb.viewer.renderScreenImage(g, currentSize, rectClip);
+        jmb.viewer.renderScreenImage(g, currentSize.width,
+                currentSize.height);
       }
     }
   }
index 57b9220..f05a7d4 100644 (file)
@@ -901,8 +901,7 @@ public class AppJmol extends StructureViewerBase
 
     if (im.getGraphics() != null)
     {
-      Rectangle rect = new Rectangle(width, height);
-      jmb.viewer.renderScreenImage(im.getGraphics(), rect.getSize(), rect);
+      jmb.viewer.renderScreenImage(im.getGraphics(), width, height);
       im.writeImage();
     }
   }
@@ -1079,13 +1078,10 @@ public class AppJmol extends StructureViewerBase
   {
     final Dimension currentSize = new Dimension();
 
-    final Rectangle rectClip = new Rectangle();
-
     @Override
     public void paintComponent(Graphics g)
     {
       getSize(currentSize);
-      g.getClipBounds(rectClip);
 
       if (jmb != null && jmb.fileLoadingError != null)
       {
@@ -1124,7 +1120,8 @@ public class AppJmol extends StructureViewerBase
       }
       else
       {
-        jmb.viewer.renderScreenImage(g, currentSize, rectClip);
+        jmb.viewer.renderScreenImage(g, currentSize.width,
+                currentSize.height);
       }
     }
   }