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); } }
/** * Adds the cell to the default parent. This is a shortcut method. * * @param cell Cell to be inserted. * @return Returns the cell that was added. */ public Object addCell(Object cell) { return addCell(cell, null); }
/** * Adds the cell to the parent. This is a shortcut method. * * @param cell Cell tobe inserted. * @param parent Object that represents the new parent. If no parent is * given then the default parent is used. * @return Returns the cell that was added. */ public Object addCell(Object cell, Object parent) { return addCell(cell, parent, null, null, null); }
/** * Adds the cell to the parent. This is a shortcut method. * * @param cell Cell tobe inserted. * @param parent Object that represents the new parent. If no parent is * given then the default parent is used. * @return Returns the cell that was added. */ public Object addCell(Object cell, Object parent) { return addCell(cell, parent, null, null, null); }
/** * Adds the cell to the default parent. This is a shortcut method. * * @param cell Cell to be inserted. * @return Returns the cell that was added. */ public Object addCell(Object cell) { return addCell(cell, null); }
/** * Adds the edge to the parent and connects it to the given source and * target terminals. This is a shortcut method. * * @param edge Edge to be inserted into the given parent. * @param parent Object that represents the new parent. If no parent is * given then the default parent is used. * @param source Optional cell that represents the source terminal. * @param target Optional cell that represents the target terminal. * @param index Optional index to insert the cells at. Default is to append. * @return Returns the edge that was added. */ public Object addEdge(Object edge, Object parent, Object source, Object target, Integer index) { return addCell(edge, parent, index, source, target); }
/** * Adds the edge to the parent and connects it to the given source and * target terminals. This is a shortcut method. * * @param edge Edge to be inserted into the given parent. * @param parent Object that represents the new parent. If no parent is * given then the default parent is used. * @param source Optional cell that represents the source terminal. * @param target Optional cell that represents the target terminal. * @param index Optional index to insert the cells at. Default is to append. * @return Returns the edge that was added. */ public Object addEdge(Object edge, Object parent, Object source, Object target, Integer index) { return addCell(edge, parent, index, source, target); }
/** * Adds a new vertex into the given parent using value as the user object * and the given coordinates as the geometry of the new vertex. The id and * style are used for the respective properties of the new cell, which is * returned. * * @param parent Cell that specifies the parent of the new vertex. * @param id Optional string that defines the Id of the new vertex. * @param value Object to be used as the user object. * @param x Integer that defines the x coordinate of the vertex. * @param y Integer that defines the y coordinate of the vertex. * @param width Integer that defines the width of the vertex. * @param height Integer that defines the height of the vertex. * @param style Optional string that defines the cell style. * @param relative Specifies if the geometry should be relative. * @return Returns the new vertex that has been inserted. */ public Object insertVertex(Object parent, String id, Object value, double x, double y, double width, double height, String style, boolean relative) { Object vertex = createVertex(parent, id, value, x, y, width, height, style, relative); return addCell(vertex, parent); }
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<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; }
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> 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 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 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; }
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); } }
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;perimeter=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); } }