* Bug #13221 fixed - Default figure "visible" property was ignored when creating 78/15278/2
Vincent COUVERT [Fri, 26 Sep 2014 09:14:26 +0000 (11:14 +0200)]
                     a new figure.

Change-Id: If171f5cd15601fd849355d8c5d1f74ee8071e544

scilab/CHANGES_5.5.X
scilab/modules/graphics/tests/nonreg_tests/bug_13321.tst [new file with mode: 0644]
scilab/modules/gui/src/java/org/scilab/modules/gui/SwingView.java

index fb3bffa..8da2293 100644 (file)
@@ -84,6 +84,9 @@ Scilab Bug Fixes
 
 * Bug #13180 fixed - surf did not handle degenerate cases.
 
+* Bug #13221 fixed - Default figure "visible" property was ignored when creating
+                     a new figure.
+
 * Bug #13291 fixed - xmltojar([],[],'ja_JP') might lead to a crash when the
                      locale was not system-wide available.
 
diff --git a/scilab/modules/graphics/tests/nonreg_tests/bug_13321.tst b/scilab/modules/graphics/tests/nonreg_tests/bug_13321.tst
new file mode 100644 (file)
index 0000000..24a0087
--- /dev/null
@@ -0,0 +1,25 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2014 - Scilab Enterprises - Vincent COUVERT
+//
+//  This file is distributed under the same license as the Scilab package.
+// =============================================================================
+
+// <-- INTERACTIVE TEST -->
+
+// <-- Non-regression test for bug 13321 -->
+//
+// <-- Bugzilla URL -->
+// http://bugzilla.scilab.org/13321
+//
+// <-- Short Description -->
+// scf() did not create an invisible figure when the gdf.visible property was set to "off".
+
+f=gdf();
+f.visible="off";
+g=figure()
+// Check that the visible property of g is set to "off"
+// Check that no figure is visible
+
+g.visible="on";
+// Check that the figure is now visible
\ No newline at end of file
index 6fe3364..4b7f83d 100644 (file)
@@ -217,7 +217,7 @@ public final class SwingView implements GraphicView {
     public static int getSize() {
         return me.allObjects.size();
     }
-    
+
     private enum UielementType {
         Console, CheckBox, Edit, Spinner, Frame, Figure, Axes, Image, ListBox, PopupMenu, Progressbar, PushButton, RadioButton, Slider, Table, Text, Uimenu, UiParentMenu, UiChildMenu, UiCheckedMenu, UiContextMenu, Waitbar, Tab, Layer
     }
@@ -749,7 +749,8 @@ public final class SwingView implements GraphicView {
                 final Runnable r = new Runnable() {
                     @Override
                     public void run() {
-                        ((SwingScilabDockablePanel) registeredObject.getValue()).getParentWindow().setVisible(true);
+                        boolean figVis = (Boolean) GraphicController.getController().getProperty(id, __GO_VISIBLE__);
+                        ((SwingScilabDockablePanel) registeredObject.getValue()).getParentWindow().setVisible(figVis);
                         ((SwingScilabDockablePanel) registeredObject.getValue()).setVisible(true);
                         Integer[] figureSize = (Integer[]) GraphicController.getController().getProperty(id, __GO_SIZE__);
                         ((SwingScilabDockablePanel) registeredObject.getValue()).getParentWindow().setDims(new Size(figureSize[0], figureSize[1]));
@@ -828,33 +829,33 @@ public final class SwingView implements GraphicView {
             final Integer[] newChildren = (Integer[]) GraphicController.getController().getProperty(id, __GO_CHILDREN__);
 
             switch (type) {
-                    /*
-                     * FIGURE CHILDREN UPDATE
-                     */
+                /*
+                 * FIGURE CHILDREN UPDATE
+                 */
                 case __GO_FIGURE__:
                     updateFigureChildren(registeredObject, newChildren);
                     break;
-                    /*
-                     * CONSOLE CHILDREN UPDATE
-                     */
+                /*
+                 * CONSOLE CHILDREN UPDATE
+                 */
                 case __GO_CONSOLE__:
                     updateConsoleChildren(registeredObject, newChildren);
                     break;
-                    /*
-                     * MENU CHILDREN UPDATE
-                     */
+                /*
+                 * MENU CHILDREN UPDATE
+                 */
                 case __GO_UIMENU__:
                     updateMenuChildren(registeredObject, id, newChildren);
                     break;
-                    /*
-                     * CONTEXTMENU CHILDREN UPDATE
-                     */
+                /*
+                 * CONTEXTMENU CHILDREN UPDATE
+                 */
                 case __GO_UICONTEXTMENU__:
                     updateContextMenuChildren(registeredObject, newChildren);
                     break;
-                    /*
-                     * UICONTROL "FRAME" CHILDREN UPDATE
-                     */
+                /*
+                 * UICONTROL "FRAME" CHILDREN UPDATE
+                 */
                 case __GO_UICONTROL__:
 
                     int style = (Integer) GraphicController.getController().getProperty(id, __GO_STYLE__);