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

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

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

mxGraph.isOrthogonal介绍

[英]Returns true if perimeter points should be computed such that the resulting edge has only horizontal or vertical segments.
[中]如果应计算周长点,使生成的边只有水平或垂直线段,则返回true。

代码示例

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

  1. /**
  2. * Updates the absolute terminal point in the given state for the given
  3. * start and end state, where start is the source if source is true.
  4. *
  5. * @param edge
  6. * Cell state whose terminal point should be updated.
  7. * @param start
  8. * Cell state for the terminal on "this" side of the edge.
  9. * @param end
  10. * Cell state for the terminal on the other side of the edge.
  11. * @param source
  12. * Boolean indicating if start is the source terminal state.
  13. */
  14. public void updateFloatingTerminalPoint(mxCellState edge,
  15. mxCellState start, mxCellState end, boolean source)
  16. {
  17. start = getTerminalPort(edge, start, source);
  18. mxPoint next = getNextPoint(edge, end, source);
  19. double border = mxUtils.getDouble(edge.getStyle(),
  20. mxConstants.STYLE_PERIMETER_SPACING);
  21. border += mxUtils.getDouble(edge.getStyle(),
  22. (source) ? mxConstants.STYLE_SOURCE_PERIMETER_SPACING
  23. : mxConstants.STYLE_TARGET_PERIMETER_SPACING);
  24. mxPoint pt = getPerimeterPoint(start, next, graph.isOrthogonal(edge),
  25. border);
  26. edge.setAbsoluteTerminalPoint(pt, source);
  27. }

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

  1. /**
  2. * Updates the absolute terminal point in the given state for the given
  3. * start and end state, where start is the source if source is true.
  4. *
  5. * @param edge
  6. * Cell state whose terminal point should be updated.
  7. * @param start
  8. * Cell state for the terminal on "this" side of the edge.
  9. * @param end
  10. * Cell state for the terminal on the other side of the edge.
  11. * @param source
  12. * Boolean indicating if start is the source terminal state.
  13. */
  14. public void updateFloatingTerminalPoint(mxCellState edge,
  15. mxCellState start, mxCellState end, boolean source)
  16. {
  17. start = getTerminalPort(edge, start, source);
  18. mxPoint next = getNextPoint(edge, end, source);
  19. double border = mxUtils.getDouble(edge.getStyle(),
  20. mxConstants.STYLE_PERIMETER_SPACING);
  21. border += mxUtils.getDouble(edge.getStyle(),
  22. (source) ? mxConstants.STYLE_SOURCE_PERIMETER_SPACING
  23. : mxConstants.STYLE_TARGET_PERIMETER_SPACING);
  24. mxPoint pt = getPerimeterPoint(start, next, graph.isOrthogonal(edge),
  25. border);
  26. edge.setAbsoluteTerminalPoint(pt, source);
  27. }

相关文章

mxGraph类方法