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

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

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

mxGraph.getConnectionPoint介绍

[英]Sets the connection constraint that describes the given connection point. If no constraint is given then nothing is changed. To remove an existing constraint from the given edge, use an empty constraint instead.
[中]设置描述给定连接点的连接约束。如果没有给出任何约束,那么什么都不会改变。要从给定边删除现有约束,请改用空约束。

代码示例

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

  1. /**
  2. * Sets the fixed source or target terminal point on the given edge.
  3. *
  4. * @param edge
  5. * Cell state whose initial terminal points should be updated.
  6. */
  7. public void updateFixedTerminalPoint(mxCellState edge,
  8. mxCellState terminal, boolean source,
  9. mxConnectionConstraint constraint)
  10. {
  11. mxPoint pt = null;
  12. if (constraint != null)
  13. {
  14. pt = graph.getConnectionPoint(terminal, constraint);
  15. }
  16. if (pt == null && terminal == null)
  17. {
  18. mxPoint orig = edge.getOrigin();
  19. mxGeometry geo = graph.getCellGeometry(edge.getCell());
  20. pt = geo.getTerminalPoint(source);
  21. if (pt != null)
  22. {
  23. pt = new mxPoint(scale
  24. * (translate.getX() + pt.getX() + orig.getX()), scale
  25. * (translate.getY() + pt.getY() + orig.getY()));
  26. }
  27. }
  28. edge.setAbsoluteTerminalPoint(pt, source);
  29. }

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

  1. /**
  2. * Sets the fixed source or target terminal point on the given edge.
  3. *
  4. * @param edge
  5. * Cell state whose initial terminal points should be updated.
  6. */
  7. public void updateFixedTerminalPoint(mxCellState edge,
  8. mxCellState terminal, boolean source,
  9. mxConnectionConstraint constraint)
  10. {
  11. mxPoint pt = null;
  12. if (constraint != null)
  13. {
  14. pt = graph.getConnectionPoint(terminal, constraint);
  15. }
  16. if (pt == null && terminal == null)
  17. {
  18. mxPoint orig = edge.getOrigin();
  19. mxGeometry geo = graph.getCellGeometry(edge.getCell());
  20. pt = geo.getTerminalPoint(source);
  21. if (pt != null)
  22. {
  23. pt = new mxPoint(scale
  24. * (translate.getX() + pt.getX() + orig.getX()), scale
  25. * (translate.getY() + pt.getY() + orig.getY()));
  26. }
  27. }
  28. edge.setAbsoluteTerminalPoint(pt, source);
  29. }

相关文章

mxGraph类方法