Xcos GUI: avoid a ClassCastException when something goes wrong 99/17499/2
Clément DAVID [Mon, 23 Nov 2015 08:54:59 +0000 (09:54 +0100)]
Change-Id: Id43d719dcb80e64f4bdb885cb97d477c2f7315f8

scilab/modules/xcos/src/java/org/scilab/modules/xcos/graph/swing/handler/ConnectionHandler.java

index 5306135..318723c 100644 (file)
@@ -18,7 +18,6 @@ import java.util.ArrayList;
 import java.util.List;
 
 import org.scilab.modules.xcos.block.BasicBlock;
-import org.scilab.modules.xcos.graph.model.XcosCell;
 import org.scilab.modules.xcos.graph.swing.GraphComponent;
 
 import com.mxgraph.model.mxICell;
@@ -214,7 +213,7 @@ public class ConnectionHandler extends mxConnectionHandler {
 
                 // We are ending a link creation on an valid port,
                 // so sync the points coordinates with the model
-                XcosCell cell = (XcosCell) connectPreview.getPreviewState().getCell();
+                mxICell cell = (mxICell) connectPreview.getPreviewState().getCell();
                 cell.setGeometry(cell.getGeometry());
             }