Xcos: fix compilation with JGraphX 2.5 63/13963/1
Clément DAVID [Mon, 10 Mar 2014 13:55:13 +0000 (14:55 +0100)]
Perform a model modification to hand-made redraw. As some pseudo-internals has been removed using a high-level modification avoid compatibility handling.

Change-Id: I36c5917f6f1d4aac20e9b33b0cd165eb046eeb40

scilab/modules/xcos/src/java/org/scilab/modules/xcos/block/AfficheBlock.java

index a9cea17..24898c1 100644 (file)
@@ -34,6 +34,7 @@ import org.scilab.modules.xcos.Xcos;
 import org.scilab.modules.xcos.graph.XcosDiagram;
 import org.scilab.modules.xcos.io.scicos.AbstractElement;
 
+import com.mxgraph.model.mxGeometry;
 import com.mxgraph.util.mxConstants;
 import com.mxgraph.util.mxRectangle;
 import com.mxgraph.view.mxCellState;
@@ -187,15 +188,8 @@ public final class AfficheBlock extends BasicBlock {
             if (src.getParentDiagram() != null) {
                 final XcosDiagram parent = src.getParentDiagram();
                 final mxRectangle rect = parent.getPreferredSizeForCell(src);
-                rect.setX(src.getGeometry().getX());
-                rect.setY(src.getGeometry().getY());
-                parent.resizeCell(src, rect);
 
-                final mxGraphView view = parent.getView();
-                final mxCellState parentState = view.getState(src.getParent());
-
-                view.validateBounds(parentState, src);
-                parent.repaint(view.validatePoints(parentState, src));
+                parent.getModel().setGeometry(src, new mxGeometry(src.getGeometry().getX(), src.getGeometry().getY(), rect.getWidth(), rect.getHeight()));
             }
         }