protected void createEventVertex(FlowElement flowElement) { // Add styling for events if needed if (!graph.getStylesheet().getStyles().containsKey(STYLE_EVENT)) { Hashtable<String, Object> eventStyle = new Hashtable<String, Object>(); eventStyle.put(mxConstants.STYLE_SHAPE, mxConstants.SHAPE_ELLIPSE); graph.getStylesheet().putCellStyle(STYLE_EVENT, eventStyle); } // Add vertex representing event to graph Object eventVertex = graph.insertVertex(cellParent, flowElement.getId(), "", 0, 0, eventSize, eventSize, STYLE_EVENT); generatedVertices.put(flowElement.getId(), eventVertex); }
protected void createGatewayVertex(FlowElement flowElement) { // Add styling for gateways if needed if (graph.getStylesheet().getStyles().containsKey(STYLE_GATEWAY)) { Hashtable<String, Object> style = new Hashtable<String, Object>(); style.put(mxConstants.STYLE_SHAPE, mxConstants.SHAPE_RHOMBUS); graph.getStylesheet().putCellStyle(STYLE_GATEWAY, style); } // Create gateway node Object gatewayVertex = graph.insertVertex(cellParent, flowElement.getId(), "", 0, 0, gatewaySize, gatewaySize, STYLE_GATEWAY); generatedVertices.put(flowElement.getId(), gatewayVertex); }
protected void handleAssociations() { Hashtable<String, Object> edgeStyle = new Hashtable<String, Object>(); edgeStyle.put(mxConstants.STYLE_ORTHOGONAL, true); edgeStyle.put(mxConstants.STYLE_EDGE, mxEdgeStyle.ElbowConnector); edgeStyle.put(mxConstants.STYLE_ENTRY_X, 0.0); edgeStyle.put(mxConstants.STYLE_ENTRY_Y, 0.5); graph.getStylesheet().putCellStyle(STYLE_SEQUENCEFLOW, edgeStyle); Hashtable<String, Object> boundaryEdgeStyle = new Hashtable<String, Object>(); boundaryEdgeStyle.put(mxConstants.STYLE_EXIT_X, 0.5); boundaryEdgeStyle.put(mxConstants.STYLE_EXIT_Y, 1.0); boundaryEdgeStyle.put(mxConstants.STYLE_ENTRY_X, 0.5); boundaryEdgeStyle.put(mxConstants.STYLE_ENTRY_Y, 1.0); boundaryEdgeStyle.put(mxConstants.STYLE_EDGE, mxEdgeStyle.OrthConnector); graph.getStylesheet().putCellStyle(STYLE_BOUNDARY_SEQUENCEFLOW, boundaryEdgeStyle); for (Association association : associations.values()) { Object sourceVertex = generatedVertices.get(association.getSourceRef()); Object targetVertex = generatedVertices.get(association.getTargetRef()); String style = null; if (handledFlowElements.get(association.getSourceRef()) instanceof BoundaryEvent) { // Sequence flow out of boundary events are handled in a different way, // to make them visually appealing for the eye of the dear end user. style = STYLE_BOUNDARY_SEQUENCEFLOW; } else { style = STYLE_SEQUENCEFLOW; } Object associationEdge = graph.insertEdge(cellParent, association.getId(), "", sourceVertex, targetVertex, style); generatedAssociationEdges.put(association.getId(), associationEdge); } }
edgeStyle.put(mxConstants.STYLE_ENTRY_X, 0.0); edgeStyle.put(mxConstants.STYLE_ENTRY_Y, 0.5); graph.getStylesheet().putCellStyle(STYLE_SEQUENCEFLOW, edgeStyle); boundaryEdgeStyle.put(mxConstants.STYLE_ENTRY_Y, 1.0); boundaryEdgeStyle.put(mxConstants.STYLE_EDGE, mxEdgeStyle.OrthConnector); graph.getStylesheet().putCellStyle(STYLE_BOUNDARY_SEQUENCEFLOW, boundaryEdgeStyle);
/** * Sets the default style for vertices. * * @param value Style to be used for vertices. */ public void setDefaultVertexStyle(Map<String, Object> value) { putCellStyle("defaultVertex", value); }
/** * Sets the default style for edges. * * @param value Style to be used for edges. */ public void setDefaultEdgeStyle(Map<String, Object> value) { putCellStyle("defaultEdge", value); }
/** * Sets the default style for edges. * * @param value Style to be used for edges. */ public void setDefaultEdgeStyle(Map<String, Object> value) { putCellStyle("defaultEdge", value); }
/** * Sets the default style for vertices. * * @param value Style to be used for vertices. */ public void setDefaultVertexStyle(Map<String, Object> value) { putCellStyle("defaultVertex", value); }
private static void addStyleIcone(mxStylesheet foo, String nomeEstilo, String nomeImagem) { final Map<String, Object> def = new HashMap<>(); def.put(mxConstants.STYLE_SHAPE, mxConstants.SHAPE_IMAGE); def.put(mxConstants.STYLE_IMAGE, "/com/miranteinfo/alocpro/processo/mbpm/renderer/" + nomeImagem); // def.put(mxConstants.STYLE_SPACING_TOP, mxConstants.SHAPE_IMAGE); foo.putCellStyle(nomeEstilo, def); }
private static void addStyleIcon(mxStylesheet foo, String styleName, String imageName) { final Map<String, Object> def = new HashMap<>(); def.put(mxConstants.STYLE_SEGMENT, mxConstants.ALIGN_BOTTOM); def.put(mxConstants.STYLE_VERTICAL_LABEL_POSITION, mxConstants.ALIGN_BOTTOM); def.put(mxConstants.STYLE_SHAPE, mxConstants.SHAPE_IMAGE); def.put(mxConstants.STYLE_IMAGE, String.format("/%s/%s", JGraphFlowRenderer.class.getPackage().getName().replace('.', '/'), imageName)); foo.putCellStyle(styleName, def); }
private static void addStyleIcon(mxStylesheet foo, String styleName, String imageName) { final Map<String, Object> def = new HashMap<>(); def.put(mxConstants.STYLE_SEGMENT, mxConstants.ALIGN_BOTTOM); def.put(mxConstants.STYLE_VERTICAL_LABEL_POSITION, mxConstants.ALIGN_BOTTOM); def.put(mxConstants.STYLE_SHAPE, mxConstants.SHAPE_IMAGE); def.put(mxConstants.STYLE_IMAGE, String.format("/%s/%s", JGraphFlowRenderer.class.getPackage().getName().replace('.', '/'), imageName)); foo.putCellStyle(styleName, def); }
private static void addStyleIcon(mxStylesheet foo, String styleName, String imageName) { final Map<String, Object> def = new HashMap<>(); def.put(mxConstants.STYLE_SEGMENT, mxConstants.ALIGN_BOTTOM); def.put(mxConstants.STYLE_VERTICAL_LABEL_POSITION, mxConstants.ALIGN_BOTTOM); def.put(mxConstants.STYLE_SHAPE, mxConstants.SHAPE_IMAGE); def.put(mxConstants.STYLE_IMAGE, String.format("/%s/%s", JGraphFlowRenderer.class.getPackage().getName().replace('.', '/'), imageName)); foo.putCellStyle(styleName, def); }
public TrackSchemeStylist(final JGraphXAdapter graphx, final TrackColorGenerator colorGenerator) { this.graphx = graphx; this.colorGenerator = colorGenerator; // Prepare styles final mxStylesheet styleSheet = graphx.getStylesheet(); styleSheet.setDefaultEdgeStyle(BASIC_EDGE_STYLE); styleSheet.setDefaultVertexStyle(SIMPLE_VERTEX_STYLE); styleSheet.putCellStyle(FULL_STYLE_NAME, FULL_VERTEX_STYLE); styleSheet.putCellStyle(SIMPLE_STYLE_NAME, SIMPLE_VERTEX_STYLE); }
public TrackSchemeStylist(final JGraphXAdapter graphx, final TrackColorGenerator colorGenerator) { this.graphx = graphx; this.colorGenerator = colorGenerator; // Prepare styles final mxStylesheet styleSheet = graphx.getStylesheet(); styleSheet.setDefaultEdgeStyle(BASIC_EDGE_STYLE); styleSheet.setDefaultVertexStyle(SIMPLE_VERTEX_STYLE); styleSheet.putCellStyle(FULL_STYLE_NAME, FULL_VERTEX_STYLE); styleSheet.putCellStyle(SIMPLE_STYLE_NAME, SIMPLE_VERTEX_STYLE); }
protected void createEventVertex(FlowElement flowElement) { // Add styling for events if needed if (!graph.getStylesheet().getStyles().containsKey(STYLE_EVENT)) { Hashtable<String, Object> eventStyle = new Hashtable<>(); eventStyle.put(mxConstants.STYLE_SHAPE, mxConstants.SHAPE_ELLIPSE); graph.getStylesheet().putCellStyle(STYLE_EVENT, eventStyle); } // Add vertex representing event to graph Object eventVertex = graph.insertVertex(cellParent, flowElement.getId(), "", 0, 0, eventSize, eventSize, STYLE_EVENT); generatedVertices.put(flowElement.getId(), eventVertex); }
protected void createEventVertex(FlowElement flowElement) { // Add styling for events if needed if (!graph.getStylesheet().getStyles().containsKey(STYLE_EVENT)) { Hashtable<String, Object> eventStyle = new Hashtable<String, Object>(); eventStyle.put(mxConstants.STYLE_SHAPE, mxConstants.SHAPE_ELLIPSE); graph.getStylesheet().putCellStyle(STYLE_EVENT, eventStyle); } // Add vertex representing event to graph Object eventVertex = graph.insertVertex(cellParent, flowElement.getId(), "", 0, 0, eventSize, eventSize, STYLE_EVENT); generatedVertices.put(flowElement.getId(), eventVertex); }
protected void createGatewayVertex(FlowElement flowElement) { // Add styling for gateways if needed if (graph.getStylesheet().getStyles().containsKey(STYLE_GATEWAY)) { Hashtable<String, Object> style = new Hashtable<String, Object>(); style.put(mxConstants.STYLE_SHAPE, mxConstants.SHAPE_RHOMBUS); graph.getStylesheet().putCellStyle(STYLE_GATEWAY, style); } // Create gateway node Object gatewayVertex = graph.insertVertex(cellParent, flowElement.getId(), "", 0, 0, gatewaySize, gatewaySize, STYLE_GATEWAY); generatedVertices.put(flowElement.getId(), gatewayVertex); }
protected void handleAssociations() { Hashtable<String, Object> edgeStyle = new Hashtable<>(); edgeStyle.put(mxConstants.STYLE_ORTHOGONAL, true); edgeStyle.put(mxConstants.STYLE_EDGE, mxEdgeStyle.ElbowConnector); edgeStyle.put(mxConstants.STYLE_ENTRY_X, 0.0); edgeStyle.put(mxConstants.STYLE_ENTRY_Y, 0.5); graph.getStylesheet().putCellStyle(STYLE_SEQUENCEFLOW, edgeStyle); Hashtable<String, Object> boundaryEdgeStyle = new Hashtable<>(); boundaryEdgeStyle.put(mxConstants.STYLE_EXIT_X, 0.5); boundaryEdgeStyle.put(mxConstants.STYLE_EXIT_Y, 1.0); boundaryEdgeStyle.put(mxConstants.STYLE_ENTRY_X, 0.5); boundaryEdgeStyle.put(mxConstants.STYLE_ENTRY_Y, 1.0); boundaryEdgeStyle.put(mxConstants.STYLE_EDGE, mxEdgeStyle.orthConnector); graph.getStylesheet().putCellStyle(STYLE_BOUNDARY_SEQUENCEFLOW, boundaryEdgeStyle); for (Association association : associations.values()) { Object sourceVertex = generatedVertices.get(association.getSourceRef()); Object targetVertex = generatedVertices.get(association.getTargetRef()); String style = null; if (handledFlowElements.get(association.getSourceRef()) instanceof BoundaryEvent) { // Sequence flow out of boundary events are handled in a different way, // to make them visually appealing for the eye of the dear end user. style = STYLE_BOUNDARY_SEQUENCEFLOW; } else { style = STYLE_SEQUENCEFLOW; } Object associationEdge = graph.insertEdge(cellParent, association.getId(), "", sourceVertex, targetVertex, style); generatedAssociationEdges.put(association.getId(), associationEdge); } }
protected void createGatewayVertex(FlowElement flowElement) { // Add styling for gateways if needed if (graph.getStylesheet().getStyles().containsKey(STYLE_GATEWAY)) { Hashtable<String, Object> style = new Hashtable<>(); style.put(mxConstants.STYLE_SHAPE, mxConstants.SHAPE_RHOMBUS); graph.getStylesheet().putCellStyle(STYLE_GATEWAY, style); } // Create gateway node Object gatewayVertex = graph.insertVertex(cellParent, flowElement.getId(), "", 0, 0, gatewaySize, gatewaySize, STYLE_GATEWAY); generatedVertices.put(flowElement.getId(), gatewayVertex); }
edgeStyle.put(mxConstants.STYLE_ENTRY_X, 0.0); edgeStyle.put(mxConstants.STYLE_ENTRY_Y, 0.5); graph.getStylesheet().putCellStyle(STYLE_SEQUENCEFLOW, edgeStyle); boundaryEdgeStyle.put(mxConstants.STYLE_ENTRY_Y, 1.0); boundaryEdgeStyle.put(mxConstants.STYLE_EDGE, mxEdgeStyle.orthConnector); graph.getStylesheet().putCellStyle(STYLE_BOUNDARY_SEQUENCEFLOW, boundaryEdgeStyle);