protected void generateAssociationDiagramInterchangeElements() { for (String associationId : generatedAssociationEdges.keySet()) { Object edge = generatedAssociationEdges.get(associationId); List<mxPoint> points = graph.getView().getState(edge).getAbsolutePoints(); createDiagramInterchangeInformation(handledArtifacts.get(associationId), optimizeEdgePoints(points)); } }
protected void generateActivityDiagramInterchangeElements() { for (String flowElementId : generatedVertices.keySet()) { Object vertex = generatedVertices.get(flowElementId); mxCellState cellState = graph.getView().getState(vertex); GraphicInfo subProcessGraphicInfo = createDiagramInterchangeInformation(handledFlowElements.get(flowElementId), (int) cellState.getX(), (int) cellState.getY(), (int) cellState.getWidth(), (int) cellState.getHeight()); // The DI for the elements of a subprocess are generated without // knowledge of the rest of the graph // So we must translate all it's elements with the x and y of the // subprocess itself if (handledFlowElements.get(flowElementId) instanceof SubProcess) { // Always expanded when auto layouting subProcessGraphicInfo.setExpanded(true); } } }
protected void generateSequenceFlowDiagramInterchangeElements() { for (String sequenceFlowId : generatedSequenceFlowEdges.keySet()) { Object edge = generatedSequenceFlowEdges.get(sequenceFlowId); List<mxPoint> points = graph.getView().getState(edge).getAbsolutePoints(); mxPoint startPoint = points.get(0); Object gatewayVertex = generatedVertices.get(sourceElement.getId()); mxCellState gatewayState = graph.getView().getState(gatewayVertex);
/** * Returns the state for the given cell or null if no state is defined for * the cell. * * @param cell * Cell whose state should be returned. * @return Returns the state for the given cell. */ public mxCellState getState(Object cell) { return getState(cell, false); }
/** * Returns the state for the given cell or null if no state is defined for * the cell. * * @param cell * Cell whose state should be returned. * @return Returns the state for the given cell. */ public mxCellState getState(Object cell) { return getState(cell, false); }
protected void generateAssociationDiagramInterchangeElements() { for (String associationId : generatedAssociationEdges.keySet()) { Object edge = generatedAssociationEdges.get(associationId); List<mxPoint> points = graph.getView().getState(edge).getAbsolutePoints(); createDiagramInterchangeInformation(handledArtifacts.get(associationId), optimizeEdgePoints(points)); } }
/** * */ public boolean filter(Object cell) { return view.getState(cell) != null && model.getChildCount(cell) == 0 && ((model.isVertex(cell) && vertices) || (model .isEdge(cell) && edges)); }
/** * */ public boolean filter(Object cell) { return view.getState(cell) != null && model.getChildCount(cell) == 0 && ((model.isVertex(cell) && vertices) || (model .isEdge(cell) && edges)); }
protected void generateActivityDiagramInterchangeElements() { for (String flowElementId : generatedVertices.keySet()) { Object vertex = generatedVertices.get(flowElementId); mxCellState cellState = graph.getView().getState(vertex); GraphicInfo subProcessGraphicInfo = createDiagramInterchangeInformation(handledFlowElements.get(flowElementId), (int) cellState.getX(), (int) cellState.getY(), (int) cellState.getWidth(), (int) cellState.getHeight()); // The DI for the elements of a subprocess are generated without knowledge of the rest of the graph // So we must translate all it's elements with the x and y of the subprocess itself if (handledFlowElements.get(flowElementId) instanceof SubProcess) { // Always expanded when auto layouting subProcessGraphicInfo.setExpanded(true); } } }
/** * Returns true if the given cells should be removed from the parent for the specified * mousereleased event. */ protected boolean shouldRemoveCellFromParent(Object parent, Object[] cells, MouseEvent e) { if (graphComponent.getGraph().getModel().isVertex(parent)) { mxCellState pState = graphComponent.getGraph().getView() .getState(parent); return pState != null && !pState.contains(e.getX(), e.getY()); } return false; }
/** * Returns the constant true. This does not use the cloneable field to * return a value for a given cell, it is simply a hook for subclassers * to disallow cloning of individual cells. */ public boolean isCellCloneable(Object cell) { mxCellState state = view.getState(cell); Map<String, Object> style = (state != null) ? state.getStyle() : getCellStyle(cell); return isCellsCloneable() && mxUtils.isTrue(style, mxConstants.STYLE_CLONEABLE, true); }
/** * Returns the constant true. This does not use the cloneable field to * return a value for a given cell, it is simply a hook for subclassers * to disallow cloning of individual cells. */ public boolean isCellCloneable(Object cell) { mxCellState state = view.getState(cell); Map<String, Object> style = (state != null) ? state.getStyle() : getCellStyle(cell); return isCellsCloneable() && mxUtils.isTrue(style, mxConstants.STYLE_CLONEABLE, true); }
/** * Uses getCell, getMarkedState and intersects to return the state for * the given event. */ protected mxCellState getState(MouseEvent e) { Object cell = getCell(e); mxGraphView view = graphComponent.getGraph().getView(); mxCellState state = getStateToMark(view.getState(cell)); return (state != null && intersects(state, e)) ? state : null; }
/** * Uses getCell, getMarkedState and intersects to return the state for * the given event. */ protected mxCellState getState(MouseEvent e) { Object cell = getCell(e); mxGraphView view = graphComponent.getGraph().getView(); mxCellState state = getStateToMark(view.getState(cell)); return (state != null && intersects(state, e)) ? state : null; }
/** * Returns true if the given cell is movable. This implementation returns editable. * * @param cell Cell whose editable state should be returned. * @return Returns true if the cell is editable. */ public boolean isCellEditable(Object cell) { mxCellState state = view.getState(cell); Map<String, Object> style = (state != null) ? state.getStyle() : getCellStyle(cell); return isCellsEditable() && !isCellLocked(cell) && mxUtils.isTrue(style, mxConstants.STYLE_EDITABLE, true); }
/** * Returns true if the given cell is movable. This implementation returns editable. * * @param cell Cell whose editable state should be returned. * @return Returns true if the cell is editable. */ public boolean isCellEditable(Object cell) { mxCellState state = view.getState(cell); Map<String, Object> style = (state != null) ? state.getStyle() : getCellStyle(cell); return isCellsEditable() && !isCellLocked(cell) && mxUtils.isTrue(style, mxConstants.STYLE_EDITABLE, true); }
/** * Returns true if the given cell is movable. This implementation * returns movable. * * @param cell Cell whose movable state should be returned. * @return Returns true if the cell is movable. */ public boolean isCellMovable(Object cell) { mxCellState state = view.getState(cell); Map<String, Object> style = (state != null) ? state.getStyle() : getCellStyle(cell); return isCellsMovable() && !isCellLocked(cell) && mxUtils.isTrue(style, mxConstants.STYLE_MOVABLE, true); }
/** * Returns true if the given cell is horizontal. If the given cell is not a * swimlane, then the <horizontal> value is returned. */ protected boolean isCellHorizontal(Object cell) { if (graph.isSwimlane(cell)) { mxCellState state = graph.getView().getState(cell); Map<String, Object> style = (state != null) ? state.getStyle() : graph.getCellStyle(cell); return mxUtils.isTrue(style, mxConstants.STYLE_HORIZONTAL, true); } return !isHorizontal(); }
/** * Returns true if the given cell is horizontal. If the given cell is not a * swimlane, then the <horizontal> value is returned. */ protected boolean isCellHorizontal(Object cell) { if (graph.isSwimlane(cell)) { mxCellState state = graph.getView().getState(cell); Map<String, Object> style = (state != null) ? state.getStyle() : graph.getCellStyle(cell); return mxUtils.isTrue(style, mxConstants.STYLE_HORIZONTAL, true); } return !isHorizontal(); }
/** * Updates the style of the edge preview from the incoming edge */ public void start(MouseEvent e, mxCellState startState, String style) { mxGraph graph = graphComponent.getGraph(); sourceState = startState; startPoint = transformScreenPoint(startState.getCenterX(), startState.getCenterY()); Object cell = createCell(startState, style); graph.getView().validateCell(cell); previewState = graph.getView().getState(cell); fireEvent(new mxEventObject(mxEvent.START, "event", e, "state", previewState)); }