JAL-3210 Barebones gradle/buildship/eclipse. See README
[jalview.git] / src / jalview / jbgui / GSplitFrame.java
index 0549f17..a75760d 100644 (file)
@@ -57,6 +57,7 @@ public class GSplitFrame extends JInternalFrame
    */
   public GSplitFrame(GAlignFrame top, GAlignFrame bottom)
   {
+    setName("jalview-splitframe");
     this.topFrame = top;
     this.bottomFrame = bottom;
 
@@ -79,24 +80,17 @@ public class GSplitFrame extends JInternalFrame
      * project
      */
     int topFrameHeight = topFrame.getHeight();
-    /**
-     * TODO SplitFrame.setDividerLocation
-     * 
-     * @j2sNative
-     */
+    splitPane.setDividerSize(DIVIDER_SIZE);
+    if (topFrameHeight == 0)
     {
-      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);
+      setRelativeDividerLocation(0.5d); // as a proportion
     }
+    else
+    {
+      int dividerPosition = topFrameHeight + DIVIDER_SIZE / 2;
+      splitPane.setDividerLocation(dividerPosition); // absolute position
+    }
+    splitPane.setResizeWeight(0.5d);
     add(splitPane);
   }
 
@@ -109,7 +103,7 @@ public class GSplitFrame extends JInternalFrame
    */
   protected void hideTitleBars()
   {
-    if (Platform.isAMac())
+    if (Platform.isAMacAndNotJS())
     {
       // this saves some space - but doesn't hide the title bar
       topFrame.putClientProperty("JInternalFrame.isPalette", true);
@@ -118,13 +112,8 @@ public class GSplitFrame extends JInternalFrame
     }
     else
     {
-      /**
-       * @j2sNative
-       */
-      {
-        ((BasicInternalFrameUI) topFrame.getUI()).setNorthPane(null);
-        ((BasicInternalFrameUI) bottomFrame.getUI()).setNorthPane(null);
-      }
+           ((BasicInternalFrameUI) topFrame.getUI()).setNorthPane(null);
+           ((BasicInternalFrameUI) bottomFrame.getUI()).setNorthPane(null);
     }
   }
 
@@ -212,12 +201,7 @@ public class GSplitFrame extends JInternalFrame
   public void setRelativeDividerLocation(double r)
   {
     this.dividerRatio = r;
-    /**
-     * @j2sNative
-     */
-    {
-      splitPane.setDividerLocation(r);
-    }
+    splitPane.setDividerLocation(r);
   }
 
   /**
@@ -227,12 +211,7 @@ public class GSplitFrame extends JInternalFrame
    */
   protected void setDividerLocation(int p)
   {
-    /**
-     * @j2sNative
-     */
-    {
-      splitPane.setDividerLocation(p);
-    }
+    splitPane.setDividerLocation(p);
   }
 
   /**