xml gui : correctly save/restore menu/tool/info bars visibility 89/14289/2
Antoine ELIAS [Wed, 2 Apr 2014 08:24:59 +0000 (10:24 +0200)]
Change-Id: Ib2b8d05bab2d10f2979d8deb0c02e8fde184a56e

scilab/modules/graphic_objects/src/java/org/scilab/modules/graphic_objects/xmlloader/GOBuilder.java
scilab/modules/graphic_objects/src/java/org/scilab/modules/graphic_objects/xmlloader/XMLDomLoader.java

index a8c0aae..32a6c71 100644 (file)
@@ -8,10 +8,12 @@ import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProp
 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_HIDDEN__;
+import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_INFOBAR_VISIBLE__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_LAYOUT__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_LINE_THICKNESS__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_MARGINS__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_MENUBAR_VISIBLE__;
+import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_MENUBAR__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_NAME__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_POSITION__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_RESIZE__;
@@ -19,6 +21,8 @@ import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProp
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_STYLE__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_TAG__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_TITLE__;
+import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_TOOLBAR_VISIBLE__;
+import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_TOOLBAR__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_TYPE__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UIMENU__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_BACKGROUNDCOLOR__;
@@ -156,6 +160,15 @@ public class GOBuilder {
             controller.setProperty(fig, __GO_CLOSEREQUESTFCN__, item);
         }
 
+        //set default value for menu/info/tool bars and visibility
+        controller.setProperty(fig, __GO_MENUBAR__, 0);
+        controller.setProperty(fig, __GO_TOOLBAR__, 0);
+
+        controller.setProperty(fig, __GO_MENUBAR_VISIBLE__, false);
+        controller.setProperty(fig, __GO_TOOLBAR_VISIBLE__, false);
+        controller.setProperty(fig, __GO_INFOBAR_VISIBLE__, false);
+
+
         // visible
         XmlTools.setPropAsBoolean(fig, __GO_VISIBLE__, attributes.getValue("visible"));
 
index c447812..0f246f0 100644 (file)
@@ -699,6 +699,10 @@ public class XMLDomLoader {
             controller.setProperty(fig, GraphicObjectProperties.__GO_AXES_SIZE__, GraphicModel.getFigureModel().getAxesSize());
         }
 
+        controller.setProperty(fig, __GO_MENUBAR_VISIBLE__, !menubarVisisble);
+        controller.setProperty(fig, __GO_TOOLBAR_VISIBLE__, !toolbarVisisble);
+        controller.setProperty(fig, __GO_INFOBAR_VISIBLE__, !infobarVisisble);
+
         //set menubar, infobar, toolbar visibility
         controller.setProperty(fig, __GO_MENUBAR_VISIBLE__, menubarVisisble);
         controller.setProperty(fig, __GO_TOOLBAR_VISIBLE__, toolbarVisisble);