From: Mateusz Warowny Date: Fri, 24 Mar 2023 15:18:55 +0000 (+0100) Subject: JAL-4154 Update AlignmentPanelTest to use new forArch method X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=28097d59ccb2df917246680d5c6ab7be51116870;p=jalview.git JAL-4154 Update AlignmentPanelTest to use new forArch method --- diff --git a/test/jalview/gui/AlignmentPanelTest.java b/test/jalview/gui/AlignmentPanelTest.java index 3c749fd..69dd54e 100644 --- a/test/jalview/gui/AlignmentPanelTest.java +++ b/test/jalview/gui/AlignmentPanelTest.java @@ -211,7 +211,7 @@ public class AlignmentPanelTest av.setIdWidth(-1); // force recalculation d = af.alignPanel.calculateIdWidth(); - assertEquals(d.width, Platform.isWin() ? 172 : 166); // 4 + pixel width of "Q93Z60_ARATH/1-118" + assertEquals(d.width, Platform.forArch(166).forWin(172).value().intValue()); // 4 + pixel width of "Q93Z60_ARATH/1-118" assertEquals(d.height, 12); assertEquals(d.width, av.getIdWidth()); } @@ -233,7 +233,7 @@ public class AlignmentPanelTest * note 4 pixels 'padding' are added to the longest seq name/annotation label */ Dimension d = af.alignPanel.calculateIdWidth(2000); - assertEquals(d.width, Platform.isWin() ? 172 : 166); // 4 + pixel width of "Q93Z60_ARATH/1-118" + assertEquals(d.width, Platform.forArch(166).forWin(172).value().intValue()); // 4 + pixel width of "Q93Z60_ARATH/1-118" assertEquals(d.height, 12); // fixed value (not used?) assertEquals(av.getIdWidth(), 18); // not changed by this method @@ -245,7 +245,7 @@ public class AlignmentPanelTest String orig = seq.getName(); seq.setName(orig + "MMMMM"); d = af.alignPanel.calculateIdWidth(2000); - assertEquals(d.width, Platform.isWin() ? 219 : 211); // 4 + pixel width of "Q93Z60_ARATHMMMMM/1-118" + assertEquals(d.width, Platform.forArch(211).forWin(219).value().intValue()); // 4 + pixel width of "Q93Z60_ARATHMMMMM/1-118" assertEquals(d.height, 12); assertEquals(av.getIdWidth(), 18); // unchanged // for next test: @@ -284,7 +284,8 @@ public class AlignmentPanelTest */ int w = af.alignPanel.getVisibleIdWidth(true); assertEquals(w, af.alignPanel.getIdPanel().getWidth()); - assertEquals(w, Platform.isWin() ? 112 : 115); + assertEquals(w, Platform.forArch(115).forWin(112).forMac(115) + .forLinux(114).value().intValue()); /* * width for offscreen rendering is the same @@ -304,6 +305,8 @@ public class AlignmentPanelTest * preference for auto id width overrides fixed width */ Cache.setProperty("FIGURE_AUTOIDWIDTH", Boolean.TRUE.toString()); - assertEquals(Platform.isWin() ? 106 : 115, af.alignPanel.getVisibleIdWidth(false)); + assertEquals(af.alignPanel.getVisibleIdWidth(false), + Platform.forArch(115).forWin(106).forMac(115).forLinux(114) + .value().intValue()); } }