j2sNative clean-up. Fixes problem with second try of sequence fetching
[jalview.git] / src / jalview / jbgui / GSplitFrame.java
index 2c618ba..353c494 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,17 +80,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 +110,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 +119,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);
     }
   }
 
@@ -200,7 +208,15 @@ public class GSplitFrame extends JInternalFrame
   public void setRelativeDividerLocation(double r)
   {
     this.dividerRatio = r;
-    splitPane.setDividerLocation(r);
+    /**
+     * 
+     * BH need for this? - NOT setting the location?
+     * 
+     * @j2sNative
+     */
+    {
+      splitPane.setDividerLocation(r);
+    }
   }
 
   /**
@@ -210,7 +226,14 @@ public class GSplitFrame extends JInternalFrame
    */
   protected void setDividerLocation(int p)
   {
-    splitPane.setDividerLocation(p);
+    /**
+     * BH: Why are we not setting the location?
+     * 
+     * @j2sNative
+     */
+    {
+      splitPane.setDividerLocation(p);
+    }
   }
 
   /**