package jalview.jbgui;
-import jalview.util.Platform;
-
import java.awt.Component;
import java.awt.MouseInfo;
import java.awt.Point;
import javax.swing.JSplitPane;
import javax.swing.plaf.basic.BasicInternalFrameUI;
+import jalview.util.Platform;
+
public class GSplitFrame extends JInternalFrame
{
private static final long serialVersionUID = 1L;
splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, topFrame,
bottomFrame);
splitPane.setVisible(true);
- splitPane.setDividerLocation(0.5d);
- splitPane.setResizeWeight(0.5d);
+ final double ratio = topFrame.getHeight()
+ / (double) (topFrame.getHeight() + bottomFrame.getHeight());
+ splitPane.setDividerLocation(ratio);
+ splitPane.setResizeWeight(ratio);
splitPane.setDividerSize(5);
add(splitPane);
}
if (show)
{
// SplitPane needs nudging to restore 50-50 split
+ // TODO save/restore other ratios
splitPane.setDividerLocation(0.5d);
}
validate();