本文整理了Java中com.mxgraph.view.mxGraph.insertVertex()
方法的一些代码示例,展示了mxGraph.insertVertex()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。mxGraph.insertVertex()
方法的具体详情如下:
包路径:com.mxgraph.view.mxGraph
类名称:mxGraph
方法名:insertVertex
[英]Creates and adds a new vertex with an empty style.
[中]创建并添加带有空样式的新顶点。
代码示例来源:origin: Activiti/Activiti
protected void handleActivity(FlowElement flowElement) {
Object activityVertex = graph.insertVertex(cellParent, flowElement.getId(), "", 0, 0, taskWidth, taskHeight);
generatedVertices.put(flowElement.getId(), activityVertex);
}
代码示例来源: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 handleSubProcess(FlowElement flowElement) {
BpmnAutoLayout bpmnAutoLayout = new BpmnAutoLayout(bpmnModel);
bpmnAutoLayout.layout((SubProcess) flowElement);
double subProcessWidth = bpmnAutoLayout.getGraph().getView().getGraphBounds().getWidth();
double subProcessHeight = bpmnAutoLayout.getGraph().getView().getGraphBounds().getHeight();
Object subProcessVertex = graph.insertVertex(cellParent, flowElement.getId(), "", 0, 0, subProcessWidth + 2 * subProcessMargin, subProcessHeight + 2 * subProcessMargin);
generatedVertices.put(flowElement.getId(), subProcessVertex);
}
代码示例来源:origin: org.tinyjee.jgraphx/jgraphx
/**
* Creates and adds a new vertex with an empty style.
*/
public Object insertVertex(Object parent, String id, Object value,
double x, double y, double width, double height)
{
return insertVertex(parent, id, value, x, y, width, height, null);
}
代码示例来源:origin: com.github.vlsi.mxgraph/jgraphx
/**
* Creates and adds a new vertex with an empty style.
*/
public Object insertVertex(Object parent, String id, Object value,
double x, double y, double width, double height)
{
return insertVertex(parent, id, value, x, y, width, height, null);
}
代码示例来源:origin: stackoverflow.com
public GraphEditor(String appTitle, mxGraphComponent component)
{
super(appTitle, component);
final mxGraph graph = graphComponent.getGraph();
graph.insertVertex(graph.getDefaultParent(), null, "Test", 100, 100, 200, 100);
...
}
代码示例来源:origin: org.flowable/flowable-bpmn-layout
protected void handleActivity(FlowElement flowElement) {
Object activityVertex = graph.insertVertex(cellParent, flowElement.getId(), "", 0, 0, taskWidth, taskHeight);
generatedVertices.put(flowElement.getId(), activityVertex);
}
代码示例来源: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 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: 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.opensingular/singular-server-commons
private static void addStartTransition(mxGraph graph, STask<?> taskInicial, Map<String, Object> mapaVertice) {
final Object v = graph.insertVertex(graph.getDefaultParent(), null, null, 20, 20, 20, 20);
setStyle(v, "START");
final Object destiny = mapaVertice.get(taskInicial.getAbbreviation());
graph.insertEdge(graph.getDefaultParent(), null, null, v, destiny);
}
代码示例来源:origin: org.opensingular/server-commons
private static void addStartTransition(mxGraph graph, MTask<?> taskInicial, Map<String, Object> mapaVertice) {
final Object v = graph.insertVertex(graph.getDefaultParent(), null, null, 20, 20, 20, 20);
setStyle(v, "START");
final Object destino = mapaVertice.get(taskInicial.getAbbreviation());
graph.insertEdge(graph.getDefaultParent(), null, null, v, destino);
}
代码示例来源:origin: org.opensingular/singular-requirement-commons
private static void addStartTransition(mxGraph graph, STask<?> taskInicial, Map<String, Object> mapaVertice) {
final Object v = graph.insertVertex(graph.getDefaultParent(), null, null, 20, 20, 20, 20);
setStyle(v, "START");
final Object destiny = mapaVertice.get(taskInicial.getAbbreviation());
graph.insertEdge(graph.getDefaultParent(), null, null, v, destiny);
}
代码示例来源:origin: org.opensingular/singular-requirement-module
private static void addStartTransition(mxGraph graph, STask<?> taskInicial, Map<String, Object> mapaVertice) {
final Object v = graph.insertVertex(graph.getDefaultParent(), null, null, 20, 20, 20, 20);
setStyle(v, "START");
final Object destiny = mapaVertice.get(taskInicial.getAbbreviation());
graph.insertEdge(graph.getDefaultParent(), null, null, v, destiny);
}
代码示例来源:origin: com.github.vlsi.mxgraph/jgraphx
/**
*
*/
public Object insertCell(mxRectangle bounds)
{
// FIXME: Clone prototype cell for insert
return graphComponent.getGraph().insertVertex(null, null, "",
bounds.getX(), bounds.getY(), bounds.getWidth(),
bounds.getHeight(), style);
}
代码示例来源:origin: org.tinyjee.jgraphx/jgraphx
/**
*
*/
public Object insertCell(mxRectangle bounds)
{
// FIXME: Clone prototype cell for insert
return graphComponent.getGraph().insertVertex(null, null, "",
bounds.getX(), bounds.getY(), bounds.getWidth(),
bounds.getHeight(), style);
}
代码示例来源:origin: org.flowable/flowable-bpmn-layout
protected void handleSubProcess(FlowElement flowElement) {
BpmnAutoLayout bpmnAutoLayout = new BpmnAutoLayout(bpmnModel);
bpmnAutoLayout.layout((SubProcess) flowElement);
double subProcessWidth = bpmnAutoLayout.getGraph().getView().getGraphBounds().getWidth();
double subProcessHeight = bpmnAutoLayout.getGraph().getView().getGraphBounds().getHeight();
Object subProcessVertex = graph.insertVertex(cellParent, flowElement.getId(), "", 0, 0, subProcessWidth + 2 * subProcessMargin, subProcessHeight + 2 * subProcessMargin);
generatedVertices.put(flowElement.getId(), subProcessVertex);
}
代码示例来源:origin: com.bbossgroups.activiti/activiti-bpmn-layout
protected void handleSubProcess(FlowElement flowElement) {
BpmnAutoLayout bpmnAutoLayout = new BpmnAutoLayout(bpmnModel);
bpmnAutoLayout.layout((SubProcess) flowElement);
double subProcessWidth = bpmnAutoLayout.getGraph().getView().getGraphBounds().getWidth();
double subProcessHeight = bpmnAutoLayout.getGraph().getView().getGraphBounds().getHeight();
Object subProcessVertex = graph.insertVertex(cellParent, flowElement.getId(), "", 0, 0,
subProcessWidth + 2 * subProcessMargin, subProcessHeight + 2 * subProcessMargin);
generatedVertices.put(flowElement.getId(), subProcessVertex);
}
内容来源于网络,如有侵权,请联系作者删除!