com.mxgraph.view.mxGraph.insertVertex()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(9.1k)|赞(0)|评价(0)|浏览(228)

本文整理了Java中com.mxgraph.view.mxGraph.insertVertex()方法的一些代码示例,展示了mxGraph.insertVertex()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。mxGraph.insertVertex()方法的具体详情如下:
包路径:com.mxgraph.view.mxGraph
类名称:mxGraph
方法名:insertVertex

mxGraph.insertVertex介绍

[英]Creates and adds a new vertex with an empty style.
[中]创建并添加带有空样式的新顶点。

代码示例

代码示例来源:origin: Activiti/Activiti

  1. protected void handleActivity(FlowElement flowElement) {
  2. Object activityVertex = graph.insertVertex(cellParent, flowElement.getId(), "", 0, 0, taskWidth, taskHeight);
  3. generatedVertices.put(flowElement.getId(), activityVertex);
  4. }

代码示例来源:origin: Activiti/Activiti

  1. protected void createEventVertex(FlowElement flowElement) {
  2. // Add styling for events if needed
  3. if (!graph.getStylesheet().getStyles().containsKey(STYLE_EVENT)) {
  4. Hashtable<String, Object> eventStyle = new Hashtable<String, Object>();
  5. eventStyle.put(mxConstants.STYLE_SHAPE, mxConstants.SHAPE_ELLIPSE);
  6. graph.getStylesheet().putCellStyle(STYLE_EVENT, eventStyle);
  7. }
  8. // Add vertex representing event to graph
  9. Object eventVertex = graph.insertVertex(cellParent, flowElement.getId(), "", 0, 0, eventSize, eventSize, STYLE_EVENT);
  10. generatedVertices.put(flowElement.getId(), eventVertex);
  11. }

代码示例来源:origin: Activiti/Activiti

  1. protected void createGatewayVertex(FlowElement flowElement) {
  2. // Add styling for gateways if needed
  3. if (graph.getStylesheet().getStyles().containsKey(STYLE_GATEWAY)) {
  4. Hashtable<String, Object> style = new Hashtable<String, Object>();
  5. style.put(mxConstants.STYLE_SHAPE, mxConstants.SHAPE_RHOMBUS);
  6. graph.getStylesheet().putCellStyle(STYLE_GATEWAY, style);
  7. }
  8. // Create gateway node
  9. Object gatewayVertex = graph.insertVertex(cellParent, flowElement.getId(), "", 0, 0, gatewaySize, gatewaySize, STYLE_GATEWAY);
  10. generatedVertices.put(flowElement.getId(), gatewayVertex);
  11. }

代码示例来源:origin: Activiti/Activiti

  1. protected void handleSubProcess(FlowElement flowElement) {
  2. BpmnAutoLayout bpmnAutoLayout = new BpmnAutoLayout(bpmnModel);
  3. bpmnAutoLayout.layout((SubProcess) flowElement);
  4. double subProcessWidth = bpmnAutoLayout.getGraph().getView().getGraphBounds().getWidth();
  5. double subProcessHeight = bpmnAutoLayout.getGraph().getView().getGraphBounds().getHeight();
  6. Object subProcessVertex = graph.insertVertex(cellParent, flowElement.getId(), "", 0, 0, subProcessWidth + 2 * subProcessMargin, subProcessHeight + 2 * subProcessMargin);
  7. generatedVertices.put(flowElement.getId(), subProcessVertex);
  8. }

代码示例来源:origin: org.tinyjee.jgraphx/jgraphx

  1. /**
  2. * Creates and adds a new vertex with an empty style.
  3. */
  4. public Object insertVertex(Object parent, String id, Object value,
  5. double x, double y, double width, double height)
  6. {
  7. return insertVertex(parent, id, value, x, y, width, height, null);
  8. }

代码示例来源:origin: com.github.vlsi.mxgraph/jgraphx

  1. /**
  2. * Creates and adds a new vertex with an empty style.
  3. */
  4. public Object insertVertex(Object parent, String id, Object value,
  5. double x, double y, double width, double height)
  6. {
  7. return insertVertex(parent, id, value, x, y, width, height, null);
  8. }

代码示例来源:origin: stackoverflow.com

  1. public GraphEditor(String appTitle, mxGraphComponent component)
  2. {
  3. super(appTitle, component);
  4. final mxGraph graph = graphComponent.getGraph();
  5. graph.insertVertex(graph.getDefaultParent(), null, "Test", 100, 100, 200, 100);
  6. ...
  7. }

代码示例来源:origin: org.flowable/flowable-bpmn-layout

  1. protected void handleActivity(FlowElement flowElement) {
  2. Object activityVertex = graph.insertVertex(cellParent, flowElement.getId(), "", 0, 0, taskWidth, taskHeight);
  3. generatedVertices.put(flowElement.getId(), activityVertex);
  4. }

代码示例来源:origin: com.bbossgroups.activiti/activiti-bpmn-layout

  1. protected void createEventVertex(FlowElement flowElement) {
  2. // Add styling for events if needed
  3. if (!graph.getStylesheet().getStyles().containsKey(STYLE_EVENT)) {
  4. Hashtable<String, Object> eventStyle = new Hashtable<String, Object>();
  5. eventStyle.put(mxConstants.STYLE_SHAPE, mxConstants.SHAPE_ELLIPSE);
  6. graph.getStylesheet().putCellStyle(STYLE_EVENT, eventStyle);
  7. }
  8. // Add vertex representing event to graph
  9. Object eventVertex = graph.insertVertex(cellParent, flowElement.getId(), "", 0, 0, eventSize, eventSize, STYLE_EVENT);
  10. generatedVertices.put(flowElement.getId(), eventVertex);
  11. }

代码示例来源:origin: com.bbossgroups.activiti/activiti-bpmn-layout

  1. protected void createGatewayVertex(FlowElement flowElement) {
  2. // Add styling for gateways if needed
  3. if (graph.getStylesheet().getStyles().containsKey(STYLE_GATEWAY)) {
  4. Hashtable<String, Object> style = new Hashtable<String, Object>();
  5. style.put(mxConstants.STYLE_SHAPE, mxConstants.SHAPE_RHOMBUS);
  6. graph.getStylesheet().putCellStyle(STYLE_GATEWAY, style);
  7. }
  8. // Create gateway node
  9. Object gatewayVertex = graph.insertVertex(cellParent, flowElement.getId(), "", 0, 0, gatewaySize, gatewaySize, STYLE_GATEWAY);
  10. generatedVertices.put(flowElement.getId(), gatewayVertex);
  11. }

代码示例来源:origin: org.flowable/flowable-bpmn-layout

  1. protected void createEventVertex(FlowElement flowElement) {
  2. // Add styling for events if needed
  3. if (!graph.getStylesheet().getStyles().containsKey(STYLE_EVENT)) {
  4. Hashtable<String, Object> eventStyle = new Hashtable<>();
  5. eventStyle.put(mxConstants.STYLE_SHAPE, mxConstants.SHAPE_ELLIPSE);
  6. graph.getStylesheet().putCellStyle(STYLE_EVENT, eventStyle);
  7. }
  8. // Add vertex representing event to graph
  9. Object eventVertex = graph.insertVertex(cellParent, flowElement.getId(), "", 0, 0, eventSize, eventSize, STYLE_EVENT);
  10. generatedVertices.put(flowElement.getId(), eventVertex);
  11. }

代码示例来源:origin: org.flowable/flowable-bpmn-layout

  1. protected void createGatewayVertex(FlowElement flowElement) {
  2. // Add styling for gateways if needed
  3. if (graph.getStylesheet().getStyles().containsKey(STYLE_GATEWAY)) {
  4. Hashtable<String, Object> style = new Hashtable<>();
  5. style.put(mxConstants.STYLE_SHAPE, mxConstants.SHAPE_RHOMBUS);
  6. graph.getStylesheet().putCellStyle(STYLE_GATEWAY, style);
  7. }
  8. // Create gateway node
  9. Object gatewayVertex = graph.insertVertex(cellParent, flowElement.getId(), "", 0, 0, gatewaySize, gatewaySize, STYLE_GATEWAY);
  10. generatedVertices.put(flowElement.getId(), gatewayVertex);
  11. }

代码示例来源:origin: org.opensingular/singular-server-commons

  1. private static void addStartTransition(mxGraph graph, STask<?> taskInicial, Map<String, Object> mapaVertice) {
  2. final Object v = graph.insertVertex(graph.getDefaultParent(), null, null, 20, 20, 20, 20);
  3. setStyle(v, "START");
  4. final Object destiny = mapaVertice.get(taskInicial.getAbbreviation());
  5. graph.insertEdge(graph.getDefaultParent(), null, null, v, destiny);
  6. }

代码示例来源:origin: org.opensingular/server-commons

  1. private static void addStartTransition(mxGraph graph, MTask<?> taskInicial, Map<String, Object> mapaVertice) {
  2. final Object v = graph.insertVertex(graph.getDefaultParent(), null, null, 20, 20, 20, 20);
  3. setStyle(v, "START");
  4. final Object destino = mapaVertice.get(taskInicial.getAbbreviation());
  5. graph.insertEdge(graph.getDefaultParent(), null, null, v, destino);
  6. }

代码示例来源:origin: org.opensingular/singular-requirement-commons

  1. private static void addStartTransition(mxGraph graph, STask<?> taskInicial, Map<String, Object> mapaVertice) {
  2. final Object v = graph.insertVertex(graph.getDefaultParent(), null, null, 20, 20, 20, 20);
  3. setStyle(v, "START");
  4. final Object destiny = mapaVertice.get(taskInicial.getAbbreviation());
  5. graph.insertEdge(graph.getDefaultParent(), null, null, v, destiny);
  6. }

代码示例来源:origin: org.opensingular/singular-requirement-module

  1. private static void addStartTransition(mxGraph graph, STask<?> taskInicial, Map<String, Object> mapaVertice) {
  2. final Object v = graph.insertVertex(graph.getDefaultParent(), null, null, 20, 20, 20, 20);
  3. setStyle(v, "START");
  4. final Object destiny = mapaVertice.get(taskInicial.getAbbreviation());
  5. graph.insertEdge(graph.getDefaultParent(), null, null, v, destiny);
  6. }

代码示例来源:origin: com.github.vlsi.mxgraph/jgraphx

  1. /**
  2. *
  3. */
  4. public Object insertCell(mxRectangle bounds)
  5. {
  6. // FIXME: Clone prototype cell for insert
  7. return graphComponent.getGraph().insertVertex(null, null, "",
  8. bounds.getX(), bounds.getY(), bounds.getWidth(),
  9. bounds.getHeight(), style);
  10. }

代码示例来源:origin: org.tinyjee.jgraphx/jgraphx

  1. /**
  2. *
  3. */
  4. public Object insertCell(mxRectangle bounds)
  5. {
  6. // FIXME: Clone prototype cell for insert
  7. return graphComponent.getGraph().insertVertex(null, null, "",
  8. bounds.getX(), bounds.getY(), bounds.getWidth(),
  9. bounds.getHeight(), style);
  10. }

代码示例来源:origin: org.flowable/flowable-bpmn-layout

  1. protected void handleSubProcess(FlowElement flowElement) {
  2. BpmnAutoLayout bpmnAutoLayout = new BpmnAutoLayout(bpmnModel);
  3. bpmnAutoLayout.layout((SubProcess) flowElement);
  4. double subProcessWidth = bpmnAutoLayout.getGraph().getView().getGraphBounds().getWidth();
  5. double subProcessHeight = bpmnAutoLayout.getGraph().getView().getGraphBounds().getHeight();
  6. Object subProcessVertex = graph.insertVertex(cellParent, flowElement.getId(), "", 0, 0, subProcessWidth + 2 * subProcessMargin, subProcessHeight + 2 * subProcessMargin);
  7. generatedVertices.put(flowElement.getId(), subProcessVertex);
  8. }

代码示例来源:origin: com.bbossgroups.activiti/activiti-bpmn-layout

  1. protected void handleSubProcess(FlowElement flowElement) {
  2. BpmnAutoLayout bpmnAutoLayout = new BpmnAutoLayout(bpmnModel);
  3. bpmnAutoLayout.layout((SubProcess) flowElement);
  4. double subProcessWidth = bpmnAutoLayout.getGraph().getView().getGraphBounds().getWidth();
  5. double subProcessHeight = bpmnAutoLayout.getGraph().getView().getGraphBounds().getHeight();
  6. Object subProcessVertex = graph.insertVertex(cellParent, flowElement.getId(), "", 0, 0,
  7. subProcessWidth + 2 * subProcessMargin, subProcessHeight + 2 * subProcessMargin);
  8. generatedVertices.put(flowElement.getId(), subProcessVertex);
  9. }

相关文章

mxGraph类方法