- final double ratio = bottomFrame.getHeight() == 0 ? 0.5d : topFrame
- .getHeight()
- / (double) (topFrame.getHeight() + bottomFrame.getHeight());
- splitPane.setDividerLocation(ratio);
- splitPane.setResizeWeight(ratio);
- splitPane.setDividerSize(5);
+
+ /*
+ * set divider split at 50:50, or restore saved split if loading from
+ * project
+ */
+ int topFrameHeight = topFrame.getHeight();
+ /**
+ * TODO SplitFrame.setDividerLocation
+ *
+ * @j2sNative
+ */
+ {
+ 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);
+ }