From c7d01f83f2f62a875b343502bad8cc6fe5701577 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Wed, 21 Mar 2018 17:13:04 +0000 Subject: [PATCH] =?utf8?q?JAL-2754=20don=E2=80=99t=20use=20deprecated=20api=20?= =?utf8?q?for=20getting=20font=20metrics?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- test/jalview/gui/SeqCanvasTest.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/test/jalview/gui/SeqCanvasTest.java b/test/jalview/gui/SeqCanvasTest.java index a27bc3f..fb48fdb 100644 --- a/test/jalview/gui/SeqCanvasTest.java +++ b/test/jalview/gui/SeqCanvasTest.java @@ -9,11 +9,9 @@ import jalview.io.FileLoader; import java.awt.Font; import java.awt.FontMetrics; -import junit.extensions.PA; - import org.testng.annotations.Test; -import sun.swing.SwingUtilities2; +import junit.extensions.PA; public class SeqCanvasTest { @@ -48,7 +46,7 @@ public class SeqCanvasTest av.setScaleAboveWrapped(true); av.setScaleLeftWrapped(true); av.setScaleRightWrapped(true); - FontMetrics fm = SwingUtilities2.getFontMetrics(testee, av.getFont()); + FontMetrics fm = testee.getFontMetrics(av.getFont()); int labelWidth = fm.stringWidth("000") + charWidth; assertEquals(labelWidth, 39); // 3 x 9 + charWidth @@ -218,7 +216,7 @@ public class SeqCanvasTest av.setScaleAboveWrapped(true); av.setScaleLeftWrapped(true); av.setScaleRightWrapped(true); - FontMetrics fm = SwingUtilities2.getFontMetrics(testee, av.getFont()); + FontMetrics fm = testee.getFontMetrics(av.getFont()); int labelWidth = fm.stringWidth("000") + charWidth; assertEquals(labelWidth, 39); // 3 x 9 + charWidth int annotationHeight = testee.getAnnotationHeight(); -- 1.7.10.2