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); } }
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; }
/** * 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 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; }
/** * 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 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 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; }
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 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; }
public mxCell addJGraphTVertex( final Spot vertex ) { if ( vertexToCellMap.containsKey( vertex ) ) { // cell for Spot already existed, skip creation and return original // cell. return vertexToCellMap.get( vertex ); } mxCell cell = null; getModel().beginUpdate(); try { cell = new mxCell( vertex, new mxGeometry(), "" ); cell.setVertex( true ); cell.setId( null ); cell.setValue( vertex.getName() ); addCell( cell, defaultParent ); vertexToCellMap.put( vertex, cell ); cellToVertexMap.put( cell, vertex ); } finally { getModel().endUpdate(); } return cell; }
/** * Hook method that creates the new vertex for insertVertex. * * @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 to be inserted. */ public Object createVertex(Object parent, String id, Object value, double x, double y, double width, double height, String style, boolean relative) { mxGeometry geometry = new mxGeometry(x, y, width, height); geometry.setRelative(relative); mxCell vertex = new mxCell(value, geometry, style); vertex.setId(id); vertex.setVertex(true); vertex.setConnectable(true); 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); } }
/** * Hook method that creates the new vertex for insertVertex. * * @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 to be inserted. */ public Object createVertex(Object parent, String id, Object value, double x, double y, double width, double height, String style, boolean relative) { mxGeometry geometry = new mxGeometry(x, y, width, height); geometry.setRelative(relative); mxCell vertex = new mxCell(value, geometry, style); vertex.setId(id); vertex.setVertex(true); vertex.setConnectable(true); 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;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); } }
/** * Returns a clone of the cell. */ public Object clone() throws CloneNotSupportedException { mxCell clone = (mxCell) super.clone(); clone.setValue(cloneValue()); clone.setStyle(getStyle()); clone.setCollapsed(isCollapsed()); clone.setConnectable(isConnectable()); clone.setEdge(isEdge()); clone.setVertex(isVertex()); clone.setVisible(isVisible()); clone.setParent(null); clone.setSource(null); clone.setTarget(null); clone.children = null; clone.edges = null; mxGeometry geometry = getGeometry(); if (geometry != null) { clone.setGeometry((mxGeometry) geometry.clone()); } return clone; }
/** * Returns a clone of the cell. */ public Object clone() throws CloneNotSupportedException { mxCell clone = (mxCell) super.clone(); clone.setValue(cloneValue()); clone.setStyle(getStyle()); clone.setCollapsed(isCollapsed()); clone.setConnectable(isConnectable()); clone.setEdge(isEdge()); clone.setVertex(isVertex()); clone.setVisible(isVisible()); clone.setParent(null); clone.setSource(null); clone.setTarget(null); clone.children = null; clone.edges = null; mxGeometry geometry = getGeometry(); if (geometry != null) { clone.setGeometry((mxGeometry) geometry.clone()); } return clone; }