* Bug #12966 fixed - Rotation, tool tip and other Xcos plot actions were 88/13388/2
Clément DAVID [Fri, 20 Dec 2013 16:50:29 +0000 (17:50 +0100)]
                     disabled by default.

This is enable out of EDT issue which will be fixed by this commit. This

Change-Id: I94b7d2ac7d9c92fd75ad6b7f72935bfdd4e3fc79

scilab/CHANGES_5.5.X
scilab/modules/gui/src/java/org/scilab/modules/gui/SwingView.java
scilab/modules/xcos/src/java/org/scilab/modules/xcos/Xcos.java

index e6fd176..df687f3 100644 (file)
@@ -209,6 +209,9 @@ Scilab Bug Fixes
 
 * Bug #12963 fixed - drawaxis did not place the axis correctly.
 
+* Bug #12966 fixed - Rotation, tool tip and other Xcos plot actions were
+                     disabled by default.
+
 * Bug #12968 fixed - Cannot save variable named 'temp'.
 
 * Bug #12971 fixed - getURL downloaded file name was wrong.
index 0cc39a6..7267b2b 100644 (file)
@@ -639,10 +639,21 @@ public final class SwingView implements GraphicView {
                 property == __GO_VALID__ &&
                 ((Boolean) GraphicController.getController().getProperty(id, __GO_VALID__))) {
             if (registeredObject.getValue() instanceof SwingScilabTab) {
-                ((SwingScilabTab) registeredObject.getValue()).getParentWindow().setVisible(true);
-                ((SwingScilabTab) registeredObject.getValue()).setVisible(true);
-                Integer[] figureSize = (Integer[]) GraphicController.getController().getProperty(id, __GO_SIZE__);
-                ((SwingScilabTab) registeredObject.getValue()).getParentWindow().setDims(new Size(figureSize[0], figureSize[1]));
+                final Runnable r = new Runnable() {
+                    @Override
+                    public void run() {
+                        ((SwingScilabTab) registeredObject.getValue()).getParentWindow().setVisible(true);
+                        ((SwingScilabTab) registeredObject.getValue()).setVisible(true);
+                        Integer[] figureSize = (Integer[]) GraphicController.getController().getProperty(id, __GO_SIZE__);
+                        ((SwingScilabTab) registeredObject.getValue()).getParentWindow().setDims(new Size(figureSize[0], figureSize[1]));
+                    }
+                };
+
+                if (SwingUtilities.isEventDispatchThread()) {
+                    r.run();
+                } else {
+                    SwingUtilities.invokeLater(r);
+                }
             }
         }
 
index a3600e7..664e3bf 100644 (file)
@@ -1138,7 +1138,12 @@ public final class Xcos {
      */
     @ScilabExported(module = "xcos", filename = "Xcos.giws.xml")
     public static void xcosSimulationStarted() {
-        GraphActionManager.setEnable(StopAction.class, true);
+        SwingUtilities.invokeLater(new Runnable() {
+            @Override
+            public void run() {
+                GraphActionManager.setEnable(StopAction.class, true);
+            }
+        });
     }
 
     /**