protected void handleBoundaryEvents() { for (BoundaryEvent boundaryEvent : boundaryEvents) { mxGeometry geometry = new mxGeometry(0.8, 1.0, eventSize, eventSize); geometry.setOffset(new mxPoint(-(eventSize / 2), -(eventSize / 2))); geometry.setRelative(true); mxCell boundaryPort = new mxCell(null, geometry, "shape=ellipse;perimter=ellipsePerimeter"); boundaryPort.setId("boundary-event-" + boundaryEvent.getId()); boundaryPort.setVertex(true); Object portParent = null; if (boundaryEvent.getAttachedToRefId() != null) { portParent = generatedVertices.get(boundaryEvent.getAttachedToRefId()); } else if (boundaryEvent.getAttachedToRef() != null) { portParent = generatedVertices.get(boundaryEvent.getAttachedToRef().getId()); } else { throw new RuntimeException("Could not generate DI: boundaryEvent '" + boundaryEvent.getId() + "' has no attachedToRef"); } graph.addCell(boundaryPort, portParent); generatedVertices.put(boundaryEvent.getId(), boundaryPort); } }
mxCell cell = new mxCell(component, new mxGeometry(), "");
/** * Creates a new element. * * @param graph The graph where this element is used. * @param geometry Initial element geometry. * @param style Initial style. */ public VElement(mxGraph graph, String style) { super(null, new mxGeometry(), style); this.graph = graph; setStyle(style); }
/** * Creates a new element. * * @param graph The graph where this element is used. * @param geometry Initial element geometry. * @param style Initial style. */ public BreakpointMarker(mxGraph graph) { super(null, new mxGeometry(), BreakpointMarker.class.getSimpleName()); this.graph = graph; setVertex(true); setVisible(true); }
/** * Hook for creating the group cell to hold the given array of <mxCells> if * no group cell was given to the <group> function. The children are just * for informational purpose, they will be added to the returned group * later. Note that the returned group should have a geometry. The * coordinates of which are later overridden. * * @param cells * @return Returns a new group cell. */ public Object createGroupCell(Object[] cells) { mxCell group = new mxCell("", new mxGeometry(), null); group.setVertex(true); group.setConnectable(false); return group; }
/** * Hook for creating the group cell to hold the given array of <mxCells> if * no group cell was given to the <group> function. The children are just * for informational purpose, they will be added to the returned group * later. Note that the returned group should have a geometry. The * coordinates of which are later overridden. * * @param cells * @return Returns a new group cell. */ public Object createGroupCell(Object[] cells) { mxCell group = new mxCell("", new mxGeometry(), null); group.setVertex(true); group.setConnectable(false); return group; }
private final mxCell createFilter(final MIFilter plugin, final int c) { final mxCell vertex = new mxCell("<<Filter>>\n" + plugin.getName() + " : " + KaxVizFrame.getShortClassName(plugin), new mxGeometry(FILTER_SPACE, FILTER_SPACE + (c * (FILTER_HEIGHT + FILTER_SPACE)), FILTER_WIDTH, FILTER_HEIGHT), STYLE_FILTER); vertex.setVertex(true); this.graph.addCell(vertex); return vertex; }
private final mxCell createRepository(final MIRepository repository, final int c) { final mxCell vertex = new mxCell("<<Repository>>\n" + repository.getName() + " : " + KaxVizFrame.getShortClassName(repository), new mxGeometry(FILTER_SPACE, FILTER_SPACE + (c * (FILTER_HEIGHT + FILTER_SPACE)), FILTER_WIDTH, FILTER_HEIGHT), STYLE_REPOSITORY); vertex.setVertex(true); this.graph.addCell(vertex); return vertex; }
private final mxCell createReader(final MIReader reader, final int c) { final mxCell vertex = new mxCell("<<Reader>>\n" + reader.getName() + " : " + KaxVizFrame.getShortClassName(reader), new mxGeometry(FILTER_SPACE, FILTER_SPACE + (c * (FILTER_HEIGHT + FILTER_SPACE)), FILTER_WIDTH, FILTER_HEIGHT), STYLE_READER); vertex.setVertex(true); this.graph.addCell(vertex); return vertex; }
private final mxCell createReader(final MIReader reader, final int c) { final mxCell vertex = new mxCell("<<Reader>>\n" + reader.getName() + " : " + KaxVizFrame.getShortClassName(reader), new mxGeometry(FILTER_SPACE, FILTER_SPACE + (c * (FILTER_HEIGHT + FILTER_SPACE)), FILTER_WIDTH, FILTER_HEIGHT), STYLE_READER); vertex.setVertex(true); this.graph.addCell(vertex); return vertex; }
private final mxCell createFilter(final MIFilter plugin, final int c) { final mxCell vertex = new mxCell("<<Filter>>\n" + plugin.getName() + " : " + KaxVizFrame.getShortClassName(plugin), new mxGeometry(FILTER_SPACE, FILTER_SPACE + (c * (FILTER_HEIGHT + FILTER_SPACE)), FILTER_WIDTH, FILTER_HEIGHT), STYLE_FILTER); vertex.setVertex(true); this.graph.addCell(vertex); return vertex; }
private final mxCell createRepository(final MIRepository repository, final int c) { final mxCell vertex = new mxCell("<<Repository>>\n" + repository.getName() + " : " + KaxVizFrame.getShortClassName(repository), new mxGeometry(FILTER_SPACE, FILTER_SPACE + (c * (FILTER_HEIGHT + FILTER_SPACE)), FILTER_WIDTH, FILTER_HEIGHT), STYLE_REPOSITORY); vertex.setVertex(true); this.graph.addCell(vertex); return vertex; }
public void setActivityGeometry(VActivity vactivity) { MActivity mactivity = (MActivity) vactivity.getBpmnElement(); Dimension ds = BpmnStylesheetColor.DEFAULT_ACTIVITY_SIZES.containsKey(mactivity.getActivityType()) ? BpmnStylesheetColor.DEFAULT_ACTIVITY_SIZES.get(mactivity.getActivityType()) : BpmnStylesheetColor.DEFAULT_ACTIVITY_SIZES.get(vactivity.getStyle()); mxGeometry geo = new mxGeometry(0, 0, ds.width, ds.height); vactivity.setGeometry(geo); if (BpmnStylesheetColor.COLLAPSED_SIZES.containsKey(vactivity.getStyle()) || BpmnStylesheetColor.COLLAPSED_SIZES.containsKey(mactivity.getActivityType())) { Dimension ads = (Dimension) (BpmnStylesheetColor.COLLAPSED_SIZES.get(vactivity.getStyle()) != null? BpmnStylesheetColor.COLLAPSED_SIZES.get(vactivity.getStyle()) : BpmnStylesheetColor.COLLAPSED_SIZES.get(mactivity.getActivityType())); vactivity.getGeometry().setAlternateBounds(new mxGeometry(0, 0, ads.width, ads.height)); } } }
/** * Hook method that creates the new edge for insertEdge. This * implementation does not set the source and target of the edge, these * are set when the edge is added to the model. * * @param parent Cell that specifies the parent of the new edge. * @param id Optional string that defines the Id of the new edge. * @param value Object to be used as the user object. * @param source Cell that defines the source of the edge. * @param target Cell that defines the target of the edge. * @param style Optional string that defines the cell style. * @return Returns the new edge to be inserted. */ public Object createEdge(Object parent, String id, Object value, Object source, Object target, String style) { mxCell edge = new mxCell(value, new mxGeometry(), style); edge.setId(id); edge.setEdge(true); edge.getGeometry().setRelative(true); return edge; }
/** * Hook method that creates the new edge for insertEdge. This * implementation does not set the source and target of the edge, these * are set when the edge is added to the model. * * @param parent Cell that specifies the parent of the new edge. * @param id Optional string that defines the Id of the new edge. * @param value Object to be used as the user object. * @param source Cell that defines the source of the edge. * @param target Cell that defines the target of the edge. * @param style Optional string that defines the cell style. * @return Returns the new edge to be inserted. */ public Object createEdge(Object parent, String id, Object value, Object source, Object target, String style) { mxCell edge = new mxCell(value, new mxGeometry(), style); edge.setId(id); edge.setEdge(true); edge.getGeometry().setRelative(true); return edge; }
private final Map<String, mxCell> createOutputPorts(final MIPlugin plugin, final mxCell vertex, final boolean reader) { final Map<String, mxCell> port2graph = new HashMap<>(); // NOPMD (no concurrent access) final String[] portNames = KaxVizFrame.getAllOutputPortNames(plugin); for (int i = 0; i < portNames.length; i++) { final mxGeometry portGeometry = new mxGeometry((i + 1d) / (portNames.length + 1), 1.06, 10, 10); portGeometry.setOffset(new mxPoint(0, -10)); portGeometry.setRelative(true); final String fillcolor = reader ? STYLE_READER_COLOR : STYLE_FILTER_COLOR; // NOPMD NOCS (?:) final mxCell port = new mxCell(portNames[i], portGeometry, STYLE_PORT + "verticalLabelPosition=top;portConstraint=south;" + fillcolor); port.setVertex(true); this.graph.addCell(port, vertex); port2graph.put(portNames[i], port); } return port2graph; }
private final Map<String, mxCell> createOutputPorts(final MIPlugin plugin, final mxCell vertex, final boolean reader) { final Map<String, mxCell> port2graph = new HashMap<String, mxCell>(); // NOPMD (no concurrent access) final String[] portNames = KaxVizFrame.getAllOutputPortNames(plugin); for (int i = 0; i < portNames.length; i++) { final mxGeometry portGeometry = new mxGeometry((i + 1d) / (portNames.length + 1), 1.06, 10, 10); portGeometry.setOffset(new mxPoint(0, -10)); portGeometry.setRelative(true); final String fillcolor = reader ? STYLE_READER_COLOR : STYLE_FILTER_COLOR; // NOPMD NOCS (?:) final mxCell port = new mxCell(portNames[i], portGeometry, STYLE_PORT + "verticalLabelPosition=top;portConstraint=south;" + fillcolor); port.setVertex(true); this.graph.addCell(port, vertex); port2graph.put(portNames[i], port); } return port2graph; }
private final Map<String, mxCell> createInputPorts(final MIFilter plugin, final mxCell vertex) { final Map<String, mxCell> port2graph = new HashMap<>(); // NOPMD (no concurrent access) final String[] portNames = KaxVizFrame.getAllInputPortNames(plugin); for (int i = 0; i < portNames.length; i++) { final mxGeometry portGeometry = new mxGeometry((i + 1d) / (portNames.length + 1), -0.06, 10, 10); portGeometry.setOffset(new mxPoint(0, 0)); portGeometry.setRelative(true); final mxCell port = new mxCell( portNames[i], portGeometry, STYLE_PORT + "spacingTop=3;verticalLabelPosition=bottom;portConstraint=north;" + STYLE_FILTER_COLOR); port.setVertex(true); this.graph.addCell(port, vertex); port2graph.put(portNames[i], port); } return port2graph; }
private final Map<String, mxCell> createInputPorts(final MIFilter plugin, final mxCell vertex) { final Map<String, mxCell> port2graph = new HashMap<String, mxCell>(); // NOPMD (no concurrent access) final String[] portNames = KaxVizFrame.getAllInputPortNames(plugin); for (int i = 0; i < portNames.length; i++) { final mxGeometry portGeometry = new mxGeometry((i + 1d) / (portNames.length + 1), -0.06, 10, 10); portGeometry.setOffset(new mxPoint(0, 0)); portGeometry.setRelative(true); final mxCell port = new mxCell( portNames[i], portGeometry, STYLE_PORT + "spacingTop=3;verticalLabelPosition=bottom;portConstraint=north;" + STYLE_FILTER_COLOR); port.setVertex(true); this.graph.addCell(port, vertex); port2graph.put(portNames[i], port); } return port2graph; }
protected void handleBoundaryEvents() { for (BoundaryEvent boundaryEvent : boundaryEvents) { mxGeometry geometry = new mxGeometry(0.8, 1.0, eventSize, eventSize); geometry.setOffset(new mxPoint(-(eventSize/2), -(eventSize/2))); geometry.setRelative(true); mxCell boundaryPort = new mxCell(null, geometry, "shape=ellipse;perimter=ellipsePerimeter"); boundaryPort.setId("boundary-event-" + boundaryEvent.getId()); boundaryPort.setVertex(true); Object portParent = null; if (boundaryEvent.getAttachedToRefId() != null) { portParent = generatedVertices.get(boundaryEvent.getAttachedToRefId()); } else if (boundaryEvent.getAttachedToRef() != null) { portParent = generatedVertices.get(boundaryEvent.getAttachedToRef().getId()); } else { throw new RuntimeException("Could not generate DI: boundaryEvent '" + boundaryEvent.getId() + "' has no attachedToRef"); } graph.addCell(boundaryPort, portParent); generatedVertices.put(boundaryEvent.getId(), boundaryPort); } }