X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fjbgui%2FGSplitFrame.java;h=fd25116949b6eed2ab1d930fdc57dd18e490fbf6;hb=ab1e250269dfb5b63393b0645ae7e9ba42ee7887;hp=f06d8f0b4f329c97a4a9d39a9c80423a20705296;hpb=dc1ad37588e94cbc9ebbfaab2e9e49407f464310;p=jalview.git diff --git a/src/jalview/jbgui/GSplitFrame.java b/src/jalview/jbgui/GSplitFrame.java index f06d8f0..fd25116 100644 --- a/src/jalview/jbgui/GSplitFrame.java +++ b/src/jalview/jbgui/GSplitFrame.java @@ -1,6 +1,6 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9) - * Copyright (C) 2015 The Jalview Authors + * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) + * Copyright (C) $$Year-Rel$$ The Jalview Authors * * This file is part of Jalview. * @@ -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); } @@ -102,7 +109,7 @@ public class GSplitFrame extends JInternalFrame */ protected void hideTitleBars() { - if (new Platform().isAMac()) + if (Platform.isAMacAndNotJS()) { // this saves some space - but doesn't hide the title bar topFrame.putClientProperty("JInternalFrame.isPalette", true); @@ -111,8 +118,8 @@ public class GSplitFrame extends JInternalFrame } else { - ((BasicInternalFrameUI) topFrame.getUI()).setNorthPane(null); - ((BasicInternalFrameUI) bottomFrame.getUI()).setNorthPane(null); + ((BasicInternalFrameUI) topFrame.getUI()).setNorthPane(null); + ((BasicInternalFrameUI) bottomFrame.getUI()).setNorthPane(null); } } @@ -153,7 +160,8 @@ public class GSplitFrame extends JInternalFrame return false; } Point p = comp.getLocationOnScreen(); - Rectangle r = new Rectangle(p.x, p.y, comp.getWidth(), comp.getHeight()); + Rectangle r = new Rectangle(p.x, p.y, comp.getWidth(), + comp.getHeight()); return r.contains(loc); } @@ -173,8 +181,8 @@ public class GSplitFrame extends JInternalFrame else { this.dividerRatio = splitPane.getDividerLocation() - / (double) (splitPane.getHeight() - splitPane - .getDividerSize()); + / (double) (splitPane.getHeight() + - splitPane.getDividerSize()); } if (alignFrame == this.topFrame) @@ -199,7 +207,12 @@ public class GSplitFrame extends JInternalFrame public void setRelativeDividerLocation(double r) { this.dividerRatio = r; - splitPane.setDividerLocation(r); + /** + * @j2sNative + */ + { + splitPane.setDividerLocation(r); + } } /** @@ -209,7 +222,12 @@ public class GSplitFrame extends JInternalFrame */ protected void setDividerLocation(int p) { - splitPane.setDividerLocation(p); + /** + * @j2sNative + */ + { + splitPane.setDividerLocation(p); + } } /**