本文整理了Java中com.mxgraph.view.mxGraph.getStylesheet()
方法的一些代码示例,展示了mxGraph.getStylesheet()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。mxGraph.getStylesheet()
方法的具体详情如下:
包路径:com.mxgraph.view.mxGraph
类名称:mxGraph
方法名:getStylesheet
[英]Returns the stylesheet that provides the style.
[中]返回提供样式的样式表。
代码示例来源:origin: Activiti/Activiti
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);
}
代码示例来源:origin: Activiti/Activiti
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);
}
代码示例来源:origin: Activiti/Activiti
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);
}
}
代码示例来源:origin: Activiti/Activiti
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);
代码示例来源:origin: stackoverflow.com
mxGraph graph = new mxGraph();
Map<String, Object> style = graph.getStylesheet().getDefaultEdgeStyle();
style.put(mxConstants.STYLE_ROUNDED, true);
style.put(mxConstants.STYLE_EDGE, mxConstants.EDGESTYLE_ENTITY_RELATION);
代码示例来源:origin: org.flowable/flowable-bpmn-layout
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);
}
代码示例来源:origin: com.bbossgroups.activiti/activiti-bpmn-layout
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);
}
代码示例来源:origin: com.bbossgroups.activiti/activiti-bpmn-layout
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);
}
代码示例来源:origin: org.flowable/flowable-bpmn-layout
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);
}
代码示例来源:origin: org.flowable/flowable-bpmn-layout
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);
}
}
代码示例来源:origin: org.flowable/flowable-bpmn-layout
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);
代码示例来源:origin: com.bbossgroups.activiti/activiti-bpmn-layout
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);
内容来源于网络,如有侵权,请联系作者删除!