double sw = strokewidth.equals("inherit") ? mxUtils.getDouble( state.getStyle(), mxConstants.STYLE_STROKEWIDTH, 1) * state.getView().getScale() : Double .parseDouble(strokewidth) * minScale; lastMoveX = 0;
public double getCost(mxCellState state) { //assumed future parameters if (state == null || state.getView() == null || state.getView().getGraph() == null) { return 1.0; } mxGraph graph = state.getView().getGraph(); Object cell = state.getCell(); Double edgeWeight = null; if(graph.getModel().getValue(cell) == null || graph.getModel().getValue(cell) == "") { return 1.0; } else if (graph.getModel().getValue(cell) instanceof String) { edgeWeight = Double.parseDouble((String) graph.getModel().getValue(cell)); } else { edgeWeight = (Double) graph.getModel().getValue(cell); } return edgeWeight; }; };
public double getCost(mxCellState state) { //assumed future parameters if (state == null || state.getView() == null || state.getView().getGraph() == null) { return 1.0; } mxGraph graph = state.getView().getGraph(); Object cell = state.getCell(); Double edgeWeight = null; if(graph.getModel().getValue(cell) == null || graph.getModel().getValue(cell) == "") { return 1.0; } else if (graph.getModel().getValue(cell) instanceof String) { edgeWeight = Double.parseDouble((String) graph.getModel().getValue(cell)); } else { edgeWeight = (Double) graph.getModel().getValue(cell); } return edgeWeight; }; };
mxIGraphModel model = state.getView().getGraph().getModel(); Rectangle bounds = null;
mxIGraphModel model = state.getView().getGraph().getModel(); Rectangle bounds = null;
+ target.getHeight()); pt = state.getView().transformControlPoint(state, pt);
+ target.getHeight()); pt = state.getView().transformControlPoint(state, pt);
/** * Returns true if the label bounds of the state should be used for the * editor. */ protected boolean useLabelBounds(mxCellState state) { mxIGraphModel model = state.getView().getGraph().getModel(); mxGeometry geometry = model.getGeometry(state.getCell()); return ((geometry != null && geometry.getOffset() != null && !geometry.isRelative() && (geometry.getOffset().getX() != 0 || geometry .getOffset().getY() != 0)) || model.isEdge(state.getCell())); }
/** * Returns true if the label bounds of the state should be used for the * editor. */ protected boolean useLabelBounds(mxCellState state) { mxIGraphModel model = state.getView().getGraph().getModel(); mxGeometry geometry = model.getGeometry(state.getCell()); return ((geometry != null && geometry.getOffset() != null && !geometry.isRelative() && (geometry.getOffset().getX() != 0 || geometry .getOffset().getY() != 0)) || model.isEdge(state.getCell())); }
public void apply(mxCellState state, mxCellState source, mxCellState target, List<mxPoint> points, List<mxPoint> result) mxGraphView view = state.getView(); mxPoint pt = ((points != null && points.size() > 0) ? points.get(0) : null);
state.getView().updateCellState(state); mxGeometry geo = graph.getCellGeometry(cell);
state.getView().updateCellState(state); mxGeometry geo = graph.getCellGeometry(cell);