Force parent to doLayout when changing child visible state. 37/14037/2
Bruno JOFRET [Fri, 14 Mar 2014 18:56:56 +0000 (19:56 +0100)]
Change-Id: Ifed8bf6273df473298e394f52c699b814a13daab

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

index 093c821..1719df8 100644 (file)
@@ -34,6 +34,7 @@ import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProp
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_VISIBLE__;
 
 import java.awt.Color;
+import java.awt.Component;
 import java.awt.Font;
 
 import org.scilab.modules.graphic_objects.graphicController.GraphicController;
@@ -259,6 +260,10 @@ public final class SwingViewWidget {
             }
             case __GO_VISIBLE__ : {
                 uiControl.setVisible(((Boolean) value).booleanValue());
+                if (((Component) uiControl) != null && ((Component) uiControl).getParent() != null) {
+                    ((Component) uiControl).getParent().invalidate();
+                    ((Component) uiControl).getParent().doLayout();
+                }
                 break;
             }
             case __GO_PARENT__: