swing actions must be done in EDT 61/14061/2
Antoine ELIAS [Tue, 18 Mar 2014 13:43:11 +0000 (14:43 +0100)]
Change-Id: Ia17b939f59f39682c39d90015a1566214ead1541

scilab/modules/gui/src/java/org/scilab/modules/gui/SwingView.java

index d27b3d6..da8075e 100644 (file)
@@ -791,24 +791,21 @@ public final class SwingView implements GraphicView {
             return;
         }
 
-        //        if (SwingUtilities.isEventDispatchThread()) {
-        updateObjectOnEDT(registeredObject, id, property);
-        //        } else {
-        //            try {
-        //                SwingUtilities.invokeAndWait(new Runnable() {
-        //                    @Override
-        //                    public void run() {
-        //                        updateObjectOnEDT(registeredObject, id, property);
-        //                    }
-        //                });
-        //            } catch (InterruptedException e) {
-        //                // TODO Auto-generated catch block
-        //                e.printStackTrace();
-        //            } catch (InvocationTargetException e) {
-        //                // TODO Auto-generated catch block
-        //                e.printStackTrace();
-        //            }
-        //        }
+        if (SwingUtilities.isEventDispatchThread()) {
+            updateObjectOnEDT(registeredObject, id, property);
+        } else {
+            try {
+                SwingUtilities.invokeAndWait(new Runnable() {
+                    public void run() {
+                        updateObjectOnEDT(registeredObject, id, property);
+                    }
+                });
+            } catch (InterruptedException e) {
+                e.printStackTrace();
+            } catch (InvocationTargetException e) {
+                e.printStackTrace();
+            }
+        }
     }
 
     public void updateObjectOnEDT(TypedObject registeredObject, final Integer id, final int property) {