JAL-3026 workarounds and TODOs for JSplitPane setDividerLocation in SwingJS for CDS...
authorJim Procter <jprocter@issues.jalview.org>
Tue, 3 Jul 2018 16:35:51 +0000 (17:35 +0100)
committerJim Procter <jprocter@issues.jalview.org>
Tue, 3 Jul 2018 16:35:51 +0000 (17:35 +0100)
src/jalview/jbgui/GSplitFrame.java

index 2c618ba..4b15050 100644 (file)
@@ -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);
   }
 
@@ -111,8 +118,13 @@ public class GSplitFrame extends JInternalFrame
     }
     else
     {
-      ((BasicInternalFrameUI) topFrame.getUI()).setNorthPane(null);
-      ((BasicInternalFrameUI) bottomFrame.getUI()).setNorthPane(null);
+      /**
+       * @j2sNative
+       */
+      {
+        ((BasicInternalFrameUI) topFrame.getUI()).setNorthPane(null);
+        ((BasicInternalFrameUI) bottomFrame.getUI()).setNorthPane(null);
+      }
     }
   }
 
@@ -200,7 +212,12 @@ public class GSplitFrame extends JInternalFrame
   public void setRelativeDividerLocation(double r)
   {
     this.dividerRatio = r;
-    splitPane.setDividerLocation(r);
+    /**
+     * @j2sNative
+     */
+    {
+      splitPane.setDividerLocation(r);
+    }
   }
 
   /**
@@ -210,7 +227,12 @@ public class GSplitFrame extends JInternalFrame
    */
   protected void setDividerLocation(int p)
   {
-    splitPane.setDividerLocation(p);
+    /**
+     * @j2sNative
+     */
+    {
+      splitPane.setDividerLocation(p);
+    }
   }
 
   /**