Xcos : fix context decoding after 5eb1b0af
[scilab.git] / scilab / modules / xcos / src / java / org / scilab / modules / xcos / io / sax / RawDataHandler.java
index ba51e0b..786925f 100644 (file)
@@ -33,7 +33,6 @@ import org.scilab.modules.xcos.ObjectProperties;
 import org.scilab.modules.xcos.VectorOfDouble;
 import org.scilab.modules.xcos.VectorOfString;
 import org.scilab.modules.xcos.graph.XcosDiagram;
-import org.scilab.modules.xcos.graph.model.ScicosObjectOwner;
 import org.scilab.modules.xcos.graph.model.XcosCell;
 import org.scilab.modules.xcos.io.HandledElement;
 import org.scilab.modules.xcos.io.ScilabTypeCoder;
@@ -100,13 +99,13 @@ class RawDataHandler implements ScilabHandler {
 
         switch (found) {
             case ScilabBoolean:
-                // no break on purpose
+            // no break on purpose
             case ScilabDouble:
-                // no break on purpose
+            // no break on purpose
             case ScilabInteger:
-                // no break on purpose
+            // no break on purpose
             case ScilabString:
-                // no break on purpose
+            // no break on purpose
             case Array: {
                 String as = atts.getValue("as");
 
@@ -309,25 +308,25 @@ class RawDataHandler implements ScilabHandler {
                     switch (ScilabIntegerTypeEnum.valueOf(v)) {
                         case sci_int8:
                             unsigned = false;
-                            // no break on purpose
+                        // no break on purpose
                         case sci_uint8:
                             container = new ScilabInteger(new byte[height][width], unsigned);
                             break;
                         case sci_int16:
                             unsigned = false;
-                            // no break on purpose
+                        // no break on purpose
                         case sci_uint16:
                             container = new ScilabInteger(new short[height][width], unsigned);
                             break;
                         case sci_int32:
                             unsigned = false;
-                            // no break on purpose
+                        // no break on purpose
                         case sci_uint32:
                             container = new ScilabInteger(new int[height][width], unsigned);
                             break;
                         case sci_int64:
                             unsigned = false;
-                            // no break on purpose
+                        // no break on purpose
                         case sci_uint64:
                             container = new ScilabInteger(new long[height][width], unsigned);
                             break;
@@ -361,13 +360,13 @@ class RawDataHandler implements ScilabHandler {
     public void endElement(HandledElement found) {
         switch (found) {
             case Array:
-                // no break on purpose
+            // no break on purpose
             case ScilabBoolean:
-                // no break on purpose
+            // no break on purpose
             case ScilabDouble:
-                // no break on purpose
+            // no break on purpose
             case ScilabInteger:
-                // no break on purpose
+            // no break on purpose
             case ScilabString: {
                 // defensive programming
                 if (!(saxHandler.parents.peek() instanceof RawDataDescriptor)) {
@@ -402,10 +401,10 @@ class RawDataHandler implements ScilabHandler {
                     }
                     case DIAGRAM_CONTEXT: {
                         // defensive programming
-                        if (!(parent instanceof ScicosObjectOwner)) {
+                        if (!(parent instanceof XcosCell)) {
                             return;
                         }
-                        ScicosObjectOwner diagram = (ScicosObjectOwner) parent;
+                        XcosCell diagramOrSuperBlockRoot = (XcosCell) parent;
 
                         @SuppressWarnings("unchecked")
                         ArrayList value = (ArrayList) fieldValue.value;
@@ -413,7 +412,7 @@ class RawDataHandler implements ScilabHandler {
                         for (int i = 0; i < value.size(); i++) {
                             ctx.set(i, (String) value.get(i));
                         }
-                        saxHandler.controller.setObjectProperty(diagram.getUID(), diagram.getKind(), ObjectProperties.DIAGRAM_CONTEXT, ctx);
+                        saxHandler.controller.setObjectProperty(diagramOrSuperBlockRoot.getUID(), diagramOrSuperBlockRoot.getKind(), ObjectProperties.DIAGRAM_CONTEXT, ctx);
                         break;
                     }
                     case STATE: