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

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

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

mxGraph.getBoundingBoxFromGeometry介绍

[英]Returns the bounding box for the geometries of the vertices in the given array of cells.
[中]返回给定单元格数组中顶点几何图形的边界框。

代码示例

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

  1. /**
  2. * Returns the bounds to be used for the given group and children. This
  3. * implementation computes the bounding box of the geometries of all
  4. * vertices in the given children array. Edges are ignored. If the group
  5. * cell is a swimlane the title region is added to the bounds.
  6. */
  7. public mxRectangle getBoundsForGroup(Object group, Object[] children,
  8. double border)
  9. {
  10. mxRectangle result = getBoundingBoxFromGeometry(children);
  11. if (result != null)
  12. {
  13. if (isSwimlane(group))
  14. {
  15. mxRectangle size = getStartSize(group);
  16. result.setX(result.getX() - size.getWidth());
  17. result.setY(result.getY() - size.getHeight());
  18. result.setWidth(result.getWidth() + size.getWidth());
  19. result.setHeight(result.getHeight() + size.getHeight());
  20. }
  21. // Adds the border
  22. result.setX(result.getX() - border);
  23. result.setY(result.getY() - border);
  24. result.setWidth(result.getWidth() + 2 * border);
  25. result.setHeight(result.getHeight() + 2 * border);
  26. }
  27. return result;
  28. }

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

  1. /**
  2. * Returns the bounds to be used for the given group and children. This
  3. * implementation computes the bounding box of the geometries of all
  4. * vertices in the given children array. Edges are ignored. If the group
  5. * cell is a swimlane the title region is added to the bounds.
  6. */
  7. public mxRectangle getBoundsForGroup(Object group, Object[] children,
  8. double border)
  9. {
  10. mxRectangle result = getBoundingBoxFromGeometry(children);
  11. if (result != null)
  12. {
  13. if (isSwimlane(group))
  14. {
  15. mxRectangle size = getStartSize(group);
  16. result.setX(result.getX() - size.getWidth());
  17. result.setY(result.getY() - size.getHeight());
  18. result.setWidth(result.getWidth() + size.getWidth());
  19. result.setHeight(result.getHeight() + size.getHeight());
  20. }
  21. // Adds the border
  22. result.setX(result.getX() - border);
  23. result.setY(result.getY() - border);
  24. result.setWidth(result.getWidth() + 2 * border);
  25. result.setHeight(result.getHeight() + 2 * border);
  26. }
  27. return result;
  28. }

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

  1. mxRectangle bounds = graph.getBoundingBoxFromGeometry(children);

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

  1. mxRectangle bounds = graph.getBoundingBoxFromGeometry(children);

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

  1. mxRectangle childBounds = getBoundingBoxFromGeometry(children);

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

  1. mxRectangle childBounds = getBoundingBoxFromGeometry(children);

相关文章

mxGraph类方法