From 085ba959f7f625a937aea10d75099a54cd05fc9f Mon Sep 17 00:00:00 2001 From: gmungoc Date: Fri, 26 Jun 2015 15:44:20 +0100 Subject: [PATCH] JAL-1759 changed to non-deprecated Viewer.renderScreenImage() --- src/jalview/appletgui/AppletJmol.java | 41 +++++++++++++++------------------ src/jalview/gui/AppJmol.java | 9 +++----- 2 files changed, 22 insertions(+), 28 deletions(-) diff --git a/src/jalview/appletgui/AppletJmol.java b/src/jalview/appletgui/AppletJmol.java index f54717d..b48070c 100644 --- a/src/jalview/appletgui/AppletJmol.java +++ b/src/jalview/appletgui/AppletJmol.java @@ -20,6 +20,23 @@ */ 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); } } } diff --git a/src/jalview/gui/AppJmol.java b/src/jalview/gui/AppJmol.java index 57b9220..f05a7d4 100644 --- a/src/jalview/gui/AppJmol.java +++ b/src/jalview/gui/AppJmol.java @@ -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); } } } -- 1.7.10.2