From: Jim Procter Date: Tue, 3 Jul 2018 16:35:51 +0000 (+0100) Subject: JAL-3026 workarounds and TODOs for JSplitPane setDividerLocation in SwingJS for CDS... X-Git-Tag: Develop-2_11_2_0-d20201215~24^2~68^2~595^2 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;ds=sidebyside;h=68e84e5637f13e4cee4c8cd1696640aa9863f25c;p=jalview.git JAL-3026 workarounds and TODOs for JSplitPane setDividerLocation in SwingJS for CDS/Protein split view --- diff --git a/src/jalview/jbgui/GSplitFrame.java b/src/jalview/jbgui/GSplitFrame.java index 2c618ba..4b15050 100644 --- a/src/jalview/jbgui/GSplitFrame.java +++ b/src/jalview/jbgui/GSplitFrame.java @@ -79,17 +79,24 @@ public class GSplitFrame extends JInternalFrame * project */ int topFrameHeight = topFrame.getHeight(); - splitPane.setDividerSize(DIVIDER_SIZE); - if (topFrameHeight == 0) - { - setRelativeDividerLocation(0.5d); // as a proportion - } - else + /** + * TODO SplitFrame.setDividerLocation + * + * @j2sNative + */ { - int dividerPosition = topFrameHeight + DIVIDER_SIZE / 2; - splitPane.setDividerLocation(dividerPosition); // absolute position + splitPane.setDividerSize(DIVIDER_SIZE); + if (topFrameHeight == 0) + { + setRelativeDividerLocation(0.5d); // as a proportion + } + else + { + int dividerPosition = topFrameHeight + DIVIDER_SIZE / 2; + splitPane.setDividerLocation(dividerPosition); // absolute position + } + splitPane.setResizeWeight(0.5d); } - splitPane.setResizeWeight(0.5d); add(splitPane); } @@ -111,8 +118,13 @@ public class GSplitFrame extends JInternalFrame } else { - ((BasicInternalFrameUI) topFrame.getUI()).setNorthPane(null); - ((BasicInternalFrameUI) bottomFrame.getUI()).setNorthPane(null); + /** + * @j2sNative + */ + { + ((BasicInternalFrameUI) topFrame.getUI()).setNorthPane(null); + ((BasicInternalFrameUI) bottomFrame.getUI()).setNorthPane(null); + } } } @@ -200,7 +212,12 @@ public class GSplitFrame extends JInternalFrame public void setRelativeDividerLocation(double r) { this.dividerRatio = r; - splitPane.setDividerLocation(r); + /** + * @j2sNative + */ + { + splitPane.setDividerLocation(r); + } } /** @@ -210,7 +227,12 @@ public class GSplitFrame extends JInternalFrame */ protected void setDividerLocation(int p) { - splitPane.setDividerLocation(p); + /** + * @j2sNative + */ + { + splitPane.setDividerLocation(p); + } } /**