children frames may not be uicontrol 21/13921/2
Antoine ELIAS [Wed, 5 Mar 2014 17:03:37 +0000 (18:03 +0100)]
Change-Id: I68dc8484752a2be1be214e6f3244eb03c2835c0b

scilab/modules/gui/src/java/org/scilab/modules/gui/bridge/frame/SwingScilabFrame.java
scilab/modules/gui/src/java/org/scilab/modules/gui/bridge/frame/SwingScilabScrollableFrame.java

index 26a1659..cd8ceb9 100644 (file)
 package org.scilab.modules.gui.bridge.frame;
 
 
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_BORDER_OPT_PADDING__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_CHILDREN__;
+import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UICONTROL__;
+import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_TYPE__;
+import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_BORDER_OPT_PADDING__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_GRID_OPT_GRID__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_GRID_OPT_PADDING__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_LAYOUT__;
@@ -908,8 +910,11 @@ public class SwingScilabFrame extends JPanel implements SwingViewObject, SimpleF
             // Enable its children according to their __GO_UI_ENABLE__ property
             Integer[] children = (Integer[]) GraphicController.getController().getProperty(uid, __GO_CHILDREN__);
             for (int kChild = 0; kChild < children.length; kChild++) {
-                Boolean childStatus = (Boolean) GraphicController.getController().getProperty(children[kChild], __GO_UI_ENABLE__);
-                SwingView.getFromId(children[kChild]).update(__GO_UI_ENABLE__, childStatus);
+                Integer type = (Integer)GraphicController.getController().getProperty(children[kChild], __GO_TYPE__);
+                if (type == __GO_UICONTROL__) {
+                    Boolean childStatus = (Boolean) GraphicController.getController().getProperty(children[kChild], __GO_UI_ENABLE__);
+                    SwingView.getFromId(children[kChild]).update(__GO_UI_ENABLE__, childStatus);
+                }
             }
         } else {
             // Disable the frame
index 3e81e15..800afe1 100644 (file)
@@ -19,6 +19,8 @@ import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProp
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_GRID_OPT_PADDING__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_LAYOUT__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_TAG__;
+import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_TYPE__;
+import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UICONTROL__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_ENABLE__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_FRAME_BORDER__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_STRING__;
@@ -529,8 +531,11 @@ public class SwingScilabScrollableFrame extends JScrollPane implements SwingView
             // Enable its children according to their __GO_UI_ENABLE__ property
             Integer[] children = (Integer[]) GraphicController.getController().getProperty(uid, __GO_CHILDREN__);
             for (int kChild = 0; kChild < children.length; kChild++) {
-                Boolean childStatus = (Boolean) GraphicController.getController().getProperty(children[kChild], __GO_UI_ENABLE__);
-                SwingView.getFromId(children[kChild]).update(__GO_UI_ENABLE__, childStatus);
+                Integer type = (Integer)GraphicController.getController().getProperty(children[kChild], __GO_TYPE__);
+                if (type == __GO_UICONTROL__) {
+                    Boolean childStatus = (Boolean) GraphicController.getController().getProperty(children[kChild], __GO_UI_ENABLE__);
+                    SwingView.getFromId(children[kChild]).update(__GO_UI_ENABLE__, childStatus);
+                }
             }
         } else {
             // Disable the frame