From 4c091bec21e4aec8e1784d757d9d466382e61e25 Mon Sep 17 00:00:00 2001 From: hansonr Date: Mon, 21 Jan 2019 10:57:25 -0600 Subject: [PATCH] minor Platform.isAMac() clean up removes secondary references "MAC" changes unnecessary instance creation new Platform().isAMac() --- src/jalview/appletgui/AnnotationPanel.java | 4 ++-- src/jalview/appletgui/EmbmenuFrame.java | 4 +++- src/jalview/jbgui/GSplitFrame.java | 2 +- src/jalview/renderer/AnnotationRenderer.java | 4 ++-- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/jalview/appletgui/AnnotationPanel.java b/src/jalview/appletgui/AnnotationPanel.java index 50bc184..26d3a3b 100755 --- a/src/jalview/appletgui/AnnotationPanel.java +++ b/src/jalview/appletgui/AnnotationPanel.java @@ -99,14 +99,14 @@ public class AnnotationPanel extends Panel public static int GRAPH_HEIGHT = 40; - boolean MAC = false; +// boolean MAC = false; public final AnnotationRenderer renderer; public AnnotationPanel(AlignmentPanel ap) { new jalview.util.Platform(); - MAC = Platform.isAMac(); +// MAC = Platform.isAMac(); this.ap = ap; av = ap.av; setLayout(null); diff --git a/src/jalview/appletgui/EmbmenuFrame.java b/src/jalview/appletgui/EmbmenuFrame.java index 53782c0..b99bc93 100644 --- a/src/jalview/appletgui/EmbmenuFrame.java +++ b/src/jalview/appletgui/EmbmenuFrame.java @@ -20,6 +20,8 @@ */ package jalview.appletgui; +import jalview.util.Platform; + import java.awt.BorderLayout; import java.awt.Color; import java.awt.FlowLayout; @@ -95,7 +97,7 @@ public class EmbmenuFrame extends Frame implements MouseListener return false; } // DEBUG Hint: can test embedded menus by inserting true here. - if (new jalview.util.Platform().isAMac()) + if (Platform.isAMac()) { // Build the embedded menu panel, allowing override with system font embeddedMenu = makeEmbeddedPopupMenu(topMenuBar, true, false); diff --git a/src/jalview/jbgui/GSplitFrame.java b/src/jalview/jbgui/GSplitFrame.java index 4b15050..0549f17 100644 --- a/src/jalview/jbgui/GSplitFrame.java +++ b/src/jalview/jbgui/GSplitFrame.java @@ -109,7 +109,7 @@ public class GSplitFrame extends JInternalFrame */ protected void hideTitleBars() { - if (new Platform().isAMac()) + if (Platform.isAMac()) { // this saves some space - but doesn't hide the title bar topFrame.putClientProperty("JInternalFrame.isPalette", true); diff --git a/src/jalview/renderer/AnnotationRenderer.java b/src/jalview/renderer/AnnotationRenderer.java index 102b3ee..68dbe4f 100644 --- a/src/jalview/renderer/AnnotationRenderer.java +++ b/src/jalview/renderer/AnnotationRenderer.java @@ -68,7 +68,7 @@ public class AnnotationRenderer private FontMetrics fm; - private final boolean MAC = Platform.isAMac(); + private final boolean USE_FILL_ROUND_RECT = Platform.isAMac(); boolean av_renderHistogram = true, av_renderProfile = true, av_normaliseProfile = false; @@ -1169,7 +1169,7 @@ public class AnnotationRenderer int x1 = lastSSX; int x2 = (x * charWidth); - if (MAC) + if (USE_FILL_ROUND_RECT) { int ofs = charWidth / 2; // Off by 1 offset when drawing rects and ovals -- 1.7.10.2