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 handleSubProcess(FlowElement flowElement) { BpmnAutoLayout bpmnAutoLayout = new BpmnAutoLayout(bpmnModel); bpmnAutoLayout.layout((SubProcess) flowElement); double subProcessWidth = bpmnAutoLayout.getGraph().getView().getGraphBounds().getWidth(); double subProcessHeight = bpmnAutoLayout.getGraph().getView().getGraphBounds().getHeight(); Object subProcessVertex = graph.insertVertex(cellParent, flowElement.getId(), "", 0, 0, subProcessWidth + 2 * subProcessMargin, subProcessHeight + 2 * subProcessMargin); generatedVertices.put(flowElement.getId(), subProcessVertex); }
Object target = graph.getView().getVisibleTerminal(edge, invert); TreeNode tmp = dfs(target, parent, visited);
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);
@Override public void paint( final Graphics g ) { final double scale = graph.getView().getScale(); final double xcs = TrackScheme.X_COLUMN_SIZE * Math.min( 1d, scale ); final double ycs = TrackScheme.Y_COLUMN_SIZE * Math.min( 1d, scale ); g.setColor( BACKGROUND_COLOR_1 ); g.fillRect( 0, 0, ( int ) xcs, ( int ) ycs ); g.setColor( LINE_COLOR ); g.drawLine( 0, ( int ) ycs, ( int ) xcs, ( int ) ycs ); g.drawLine( ( int ) xcs, 0, ( int ) xcs, ( int ) ycs ); }
@Override public String getToolTipText( final MouseEvent event ) { final Point point = event.getPoint(); final double scale = graph.getView().getScale(); final int frame = ( int ) ( point.y / ( TrackScheme.Y_COLUMN_SIZE * scale ) ); return "frame " + frame; }
@Override public Dimension getPreferredSize() { final double scale = Math.min( 1, graph.getView().getScale() ); final double xcs = TrackScheme.X_COLUMN_SIZE * scale + 1; return new Dimension( ( int ) xcs, ( int ) viewport.getPreferredSize().getHeight() ); }
@Override public Dimension getPreferredSize() { final double scale = Math.min( 1, graph.getView().getScale() ); final double ycs = TrackScheme.Y_COLUMN_SIZE * scale + 1; final int width = getViewport().getView().getSize().width; return new Dimension( width, ( int ) ycs ); }
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 mxRectangle getPlaceholderBounds(mxCellState startState) { mxGraph graph = graphComponent.getGraph(); return graph.getView().getBounds(graph.getSelectionCells()); }
/** * Returns true if the given cell is not the current root or the root in * the model. This can be overridden to not render certain cells in the * graph display. */ protected boolean isCellDisplayable(Object cell) { return cell != graph.getView().getCurrentRoot() && cell != graph.getModel().getRoot(); }
/** * */ protected mxRectangle getPlaceholderBounds(mxCellState startState) { mxGraph graph = graphComponent.getGraph(); return graph.getView().getBounds(graph.getSelectionCells()); }
/** * Returns true if the given cell is not the current root or the root in * the model. This can be overridden to not render certain cells in the * graph display. */ protected boolean isCellDisplayable(Object cell) { return cell != graph.getView().getCurrentRoot() && cell != graph.getModel().getRoot(); }
protected void handleSubProcess(FlowElement flowElement) { BpmnAutoLayout bpmnAutoLayout = new BpmnAutoLayout(bpmnModel); bpmnAutoLayout.layout((SubProcess) flowElement); double subProcessWidth = bpmnAutoLayout.getGraph().getView().getGraphBounds().getWidth(); double subProcessHeight = bpmnAutoLayout.getGraph().getView().getGraphBounds().getHeight(); Object subProcessVertex = graph.insertVertex(cellParent, flowElement.getId(), "", 0, 0, subProcessWidth + 2 * subProcessMargin, subProcessHeight + 2 * subProcessMargin); generatedVertices.put(flowElement.getId(), subProcessVertex); }
protected void handleSubProcess(FlowElement flowElement) { BpmnAutoLayout bpmnAutoLayout = new BpmnAutoLayout(bpmnModel); bpmnAutoLayout.layout((SubProcess) flowElement); double subProcessWidth = bpmnAutoLayout.getGraph().getView().getGraphBounds().getWidth(); double subProcessHeight = bpmnAutoLayout.getGraph().getView().getGraphBounds().getHeight(); Object subProcessVertex = graph.insertVertex(cellParent, flowElement.getId(), "", 0, 0, subProcessWidth + 2 * subProcessMargin, subProcessHeight + 2 * subProcessMargin); generatedVertices.put(flowElement.getId(), subProcessVertex); }
/** * 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; }