fix reload of axes tag 55/13955/1
Antoine ELIAS [Fri, 7 Mar 2014 16:19:40 +0000 (17:19 +0100)]
Change-Id: I7222203aecfa27c79bf71db2fbca2e66e7cd4aba

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

index c6d4d20..786f04a 100644 (file)
@@ -295,7 +295,7 @@ public class XMLDomLoader {
                     }
 
                     case __GO_AXES__ : {
-                        child = Builder.createSubWin(parent);
+                        child = createAxes(parent, childNode);
                         break;
                     }
 
@@ -357,6 +357,20 @@ public class XMLDomLoader {
         }
     }
 
+    private Integer createAxes(Integer parent, Node node) {
+        GraphicController controller = GraphicController.getController();
+        Integer axes = Builder.createSubWin(parent);
+
+        NamedNodeMap attr = node.getAttributes();
+        Node tagNode = attr.getNamedItem("tag");
+        if (tagNode != null) {
+            controller.setProperty(axes, __GO_TAG__, tagNode.getNodeValue());
+            attr.removeNamedItem("tag");
+        }
+
+        return axes;
+    }
+
     private Integer createBorder(Node node) {
         GraphicController controller = GraphicController.getController();
         Integer uib = controller.askObject(GraphicObject.getTypeFromName(__GO_UI_FRAME_BORDER__));