From: Jim Procter Date: Wed, 21 Mar 2018 17:13:04 +0000 (+0000) Subject: JAL-2754 don’t use deprecated api for getting font metrics X-Git-Tag: Release_2_10_4~37^2 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=c7d01f83f2f62a875b343502bad8cc6fe5701577;p=jalview.git JAL-2754 don’t use deprecated api for getting font metrics --- 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();