From 68e84e5637f13e4cee4c8cd1696640aa9863f25c Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Tue, 3 Jul 2018 17:35:51 +0100 Subject: [PATCH] JAL-3026 workarounds and TODOs for JSplitPane setDividerLocation in SwingJS for CDS/Protein split view --- src/jalview/jbgui/GSplitFrame.java | 48 ++++++++++++++++++++++++++---------- 1 file changed, 35 insertions(+), 13 deletions(-) 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); + } } /** -- 1.7.10.2