Xcos: fix update of empty value for IOBlocks
[scilab.git] / scilab / modules / xcos / src / java / org / scilab / modules / xcos / block / BasicBlock.java
index c18f9da..c40f754 100644 (file)
@@ -90,6 +90,7 @@ import org.scilab.modules.xcos.utils.XcosEvent;
 import org.scilab.modules.xcos.utils.XcosMessages;
 
 import com.mxgraph.model.mxGeometry;
+import com.mxgraph.model.mxICell;
 import com.mxgraph.util.mxEventObject;
 import com.mxgraph.util.mxUtils;
 
@@ -1324,4 +1325,25 @@ public class BasicBlock extends ScilabGraphUniqueObject implements Serializable
                
                return clone;
        }
+       
+       /**
+        * Overriden to correct jgraphx bug fixed in 1.4.0.4
+        * 
+        * @param child the child to insert
+        * @return the previous child
+        * @see com.mxgraph.model.mxCell#insert(com.mxgraph.model.mxICell)
+        * @see http://www.jgraphsupport.co.uk/bugzilla/show_bug.cgi?id=39
+        * @deprecated Will be left after the switch to jgraphx >= 1.4.0.4
+        */
+       @Deprecated
+       @Override
+       public mxICell insert(mxICell child) {
+               int index = getChildCount();
+               
+               if (child.getParent() == this) {
+                       index--;
+               }
+               
+               return insert(child, index);
+       }
 }