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

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

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

mxGraph.createEdge介绍

[英]Hook method that creates the new edge for insertEdge. This implementation does not set the source and target of the edge, these are set when the edge is added to the model.
[中]为insertEdge创建新边的钩子方法。此实现不设置边的源和目标,这些是在将边添加到模型时设置的。

代码示例

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

  1. /**
  2. * Adds a new edge into the given parent using value as the user object and
  3. * the given source and target as the terminals of the new edge. The Id and
  4. * style are used for the respective properties of the new cell, which is
  5. * returned.
  6. *
  7. * @param parent Cell that specifies the parent of the new edge.
  8. * @param id Optional string that defines the Id of the new edge.
  9. * @param value Object to be used as the user object.
  10. * @param source Cell that defines the source of the edge.
  11. * @param target Cell that defines the target of the edge.
  12. * @param style Optional string that defines the cell style.
  13. * @return Returns the new edge that has been inserted.
  14. */
  15. public Object insertEdge(Object parent, String id, Object value,
  16. Object source, Object target, String style)
  17. {
  18. Object edge = createEdge(parent, id, value, source, target, style);
  19. return addEdge(edge, parent, source, target, null);
  20. }

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

  1. /**
  2. * Adds a new edge into the given parent using value as the user object and
  3. * the given source and target as the terminals of the new edge. The Id and
  4. * style are used for the respective properties of the new cell, which is
  5. * returned.
  6. *
  7. * @param parent Cell that specifies the parent of the new edge.
  8. * @param id Optional string that defines the Id of the new edge.
  9. * @param value Object to be used as the user object.
  10. * @param source Cell that defines the source of the edge.
  11. * @param target Cell that defines the target of the edge.
  12. * @param style Optional string that defines the cell style.
  13. * @return Returns the new edge that has been inserted.
  14. */
  15. public Object insertEdge(Object parent, String id, Object value,
  16. Object source, Object target, String style)
  17. {
  18. Object edge = createEdge(parent, id, value, source, target, style);
  19. return addEdge(edge, parent, source, target, null);
  20. }

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

  1. /**
  2. * Creates a new instance of mxShape for previewing the edge.
  3. */
  4. protected Object createCell(mxCellState startState, String style)
  5. {
  6. mxGraph graph = graphComponent.getGraph();
  7. mxICell cell = ((mxICell) graph
  8. .createEdge(null, null, "",
  9. (startState != null) ? startState.getCell() : null,
  10. null, style));
  11. ((mxICell) startState.getCell()).insertEdge(cell, true);
  12. return cell;
  13. }

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

  1. /**
  2. * Creates a new instance of mxShape for previewing the edge.
  3. */
  4. protected Object createCell(mxCellState startState, String style)
  5. {
  6. mxGraph graph = graphComponent.getGraph();
  7. mxICell cell = ((mxICell) graph
  8. .createEdge(null, null, "",
  9. (startState != null) ? startState.getCell() : null,
  10. null, style));
  11. ((mxICell) startState.getCell()).insertEdge(cell, true);
  12. return cell;
  13. }

相关文章

mxGraph类方法