JAL-3032 J2S variant for painting JTable
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Mon, 19 Nov 2018 15:14:34 +0000 (15:14 +0000)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Mon, 19 Nov 2018 15:14:34 +0000 (15:14 +0000)
src/jalview/gui/FeatureSettings.java

index 6046a2e..3cd6c21 100644 (file)
@@ -22,6 +22,7 @@ package jalview.gui;
 
 import jalview.api.FeatureColourI;
 import jalview.api.FeatureSettingsControllerI;
+import jalview.bin.Jalview;
 import jalview.datamodel.AlignmentI;
 import jalview.datamodel.SequenceI;
 import jalview.datamodel.features.FeatureMatcher;
@@ -1144,26 +1145,28 @@ public class FeatureSettings extends JPanel
     repaintTable();
   }
 
-
-       private void repaintTable() {
-               // BH 2018
-               // Here is a needed intervention
-               // because generally we don't "repaint"
-               // the table. We re-create the HTML divs
-               // that is associated with it. A better
-               // way to do this would be to fire a property change.
-
-               @SuppressWarnings("unused")
-               TableUI ui = table.getUI();
-               /**
-                * @j2sNative ui.repaintTable$();
-                */
-               {
-                       table.repaint();
-               }
+  /**
+   * Repaints the table using alternative code for Java and J2S
+   */
+  private void repaintTable() 
+  {
+       // BH 2018
+       // Here is a needed intervention
+       // because generally we don't "repaint"
+       // the table. We re-create the HTML divs
+       // that is associated with it. A better
+       // way to do this would be to fire a property change.
+       @SuppressWarnings("unused")
+       TableUI ui = table.getUI();
+       /**
+        * @j2sNative ui.repaintTable$();
+        */
+       {
+         table.repaint();
        }
+  }
 
-public void close()
+  public void close()
   {
     try
     {
@@ -1752,9 +1755,7 @@ public void close()
            * variable colour and filters dialog
            */
           chooser = new FeatureTypeSettings(me.fr, type);
-          /**
-           * @j2sNative
-           */
+          if (!Jalview.isJS())
           {
             chooser.setRequestFocusEnabled(true);
             chooser.requestFocus();