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

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

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

mxGraph.addEdge介绍

[英]Adds the edge to the parent and connects it to the given source and target terminals. This is a shortcut method.
[中]将边添加到父端子,并将其连接到给定的源端子和目标端子。这是一种快捷方式。

代码示例

代码示例来源: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. }

相关文章

mxGraph类方法