X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fjbgui%2FGSplitFrame.java;h=2eefde8a7c765a5977fc79d9f04b8e3866663963;hb=6e514532a128c47d099985375d6126111ef548cb;hp=b2ecaebab04ee04c4dfb9a2abd55ef2b37b3b540;hpb=d10280f7592e21f1ed4d1030d3ece3e95f3b385b;p=jalview.git diff --git a/src/jalview/jbgui/GSplitFrame.java b/src/jalview/jbgui/GSplitFrame.java index b2ecaeb..2eefde8 100644 --- a/src/jalview/jbgui/GSplitFrame.java +++ b/src/jalview/jbgui/GSplitFrame.java @@ -106,9 +106,34 @@ public class GSplitFrame extends JInternalFrame private boolean isIn(Point loc, Component comp) { + if (!comp.isVisible()) + { + return false; + } Point p = comp.getLocationOnScreen(); Rectangle r = new Rectangle(p.x, p.y, comp.getWidth(), comp.getHeight()); return r.contains(loc); } + /** + * Make the complement of the specified split component visible or hidden, + * adjusting the position of the split divide. + */ + public void setComplementVisible(Object alignFrame, boolean show) + { + if (alignFrame == this.topFrame) + { + this.bottomFrame.setVisible(show); + } + else if (alignFrame == this.bottomFrame) + { + this.topFrame.setVisible(show); + } + if (show) + { + // SplitPane needs nudging to restore 50-50 split + splitPane.setDividerLocation(0.5d); + } + validate(); + } }