model.setGeometry(parent, g);
/** * Resets the control points of the given edge. */ public Object resetEdge(Object edge) { mxGeometry geo = model.getGeometry(edge); if (geo != null) { // Resets the control points List<mxPoint> points = geo.getPoints(); if (points != null && !points.isEmpty()) { geo = (mxGeometry) geo.clone(); geo.setPoints(null); model.setGeometry(edge, geo); } } return edge; }
/** * Resets the control points of the given edge. */ public Object resetEdge(Object edge) { mxGeometry geo = model.getGeometry(edge); if (geo != null) { // Resets the control points List<mxPoint> points = geo.getPoints(); if (points != null && !points.isEmpty()) { geo = (mxGeometry) geo.clone(); geo.setPoints(null); model.setGeometry(edge, geo); } } return edge; }
/** * Swaps the alternate and the actual bounds in the geometry of the given * cell invoking updateAlternateBounds before carrying out the swap. * * @param cell Cell for which the bounds should be swapped. * @param willCollapse Boolean indicating if the cell is going to be collapsed. */ public void swapBounds(Object cell, boolean willCollapse) { if (cell != null) { mxGeometry geo = model.getGeometry(cell); if (geo != null) { geo = (mxGeometry) geo.clone(); updateAlternateBounds(cell, geo, willCollapse); geo.swap(); model.setGeometry(cell, geo); } } }
/** * Swaps the alternate and the actual bounds in the geometry of the given * cell invoking updateAlternateBounds before carrying out the swap. * * @param cell Cell for which the bounds should be swapped. * @param willCollapse Boolean indicating if the cell is going to be collapsed. */ public void swapBounds(Object cell, boolean willCollapse) { if (cell != null) { mxGeometry geo = model.getGeometry(cell); if (geo != null) { geo = (mxGeometry) geo.clone(); updateAlternateBounds(cell, geo, willCollapse); geo.swap(); model.setGeometry(cell, geo); } } }
model.setGeometry(edge, geometry);
model.setGeometry(edge.getCell(), g);
model.setGeometry(edge.getCell(), g);
graph.getModel().setGeometry(state.getCell(), geometry);
graph.getModel().setGeometry(state.getCell(), geometry);
model.setGeometry(cell, geo);
model.setGeometry(cell, geo);
/** * Moves the label to the given position. */ protected void moveLabelTo(mxCellState edgeState, double x, double y) { mxGraph graph = graphComponent.getGraph(); mxIGraphModel model = graph.getModel(); mxGeometry geometry = model.getGeometry(state.getCell()); if (geometry != null) { geometry = (mxGeometry) geometry.clone(); // Resets the relative location stored inside the geometry mxPoint pt = graph.getView().getRelativePoint(edgeState, x, y); geometry.setX(pt.getX()); geometry.setY(pt.getY()); // Resets the offset inside the geometry to find the offset // from the resulting point double scale = graph.getView().getScale(); geometry.setOffset(new mxPoint(0, 0)); pt = graph.getView().getPoint(edgeState, geometry); geometry.setOffset(new mxPoint(Math.round((x - pt.getX()) / scale), Math.round((y - pt.getY()) / scale))); model.setGeometry(edgeState.getCell(), geometry); } }
/** * Moves the label to the given position. */ protected void moveLabelTo(mxCellState edgeState, double x, double y) { mxGraph graph = graphComponent.getGraph(); mxIGraphModel model = graph.getModel(); mxGeometry geometry = model.getGeometry(state.getCell()); if (geometry != null) { geometry = (mxGeometry) geometry.clone(); // Resets the relative location stored inside the geometry mxPoint pt = graph.getView().getRelativePoint(edgeState, x, y); geometry.setX(pt.getX()); geometry.setY(pt.getY()); // Resets the offset inside the geometry to find the offset // from the resulting point double scale = graph.getView().getScale(); geometry.setOffset(new mxPoint(0, 0)); pt = graph.getView().getPoint(edgeState, geometry); geometry.setOffset(new mxPoint(Math.round((x - pt.getX()) / scale), Math.round((y - pt.getY()) / scale))); model.setGeometry(edgeState.getCell(), geometry); } }
model.setGeometry(edge, geometry);
model.setGeometry(edge, geometry);
graph.getModel().setGeometry(cell, geometry);
graph.getModel().setGeometry(cell, geometry);
model.setGeometry(swimlane, geo);
geometry.setWidth(bounds.getWidth() + 2 * border + left); geometry.setHeight(bounds.getHeight() + 2 * border + top); graph.getModel().setGeometry(group, geometry); graph.moveCells(children, border + left - bounds.getX(), border + top - bounds.getY());