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

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

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

mxGraph.getCellGeometry介绍

[英]Returns the geometry for the given cell.
[中]返回给定单元格的几何图形。

代码示例

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

  1. /**
  2. * Returns the bounding box for the geometries of the vertices in the
  3. * given array of cells.
  4. */
  5. public mxRectangle getBoundingBoxFromGeometry(Object[] cells)
  6. {
  7. mxRectangle result = null;
  8. if (cells != null)
  9. {
  10. for (int i = 0; i < cells.length; i++)
  11. {
  12. if (getModel().isVertex(cells[i]))
  13. {
  14. mxGeometry geo = getCellGeometry(cells[i]);
  15. if (result == null)
  16. {
  17. result = new mxRectangle(geo);
  18. }
  19. else
  20. {
  21. result.add(geo);
  22. }
  23. }
  24. }
  25. }
  26. return result;
  27. }

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

  1. /**
  2. * Returns the bounding box for the geometries of the vertices in the
  3. * given array of cells.
  4. */
  5. public mxRectangle getBoundingBoxFromGeometry(Object[] cells)
  6. {
  7. mxRectangle result = null;
  8. if (cells != null)
  9. {
  10. for (int i = 0; i < cells.length; i++)
  11. {
  12. if (getModel().isVertex(cells[i]))
  13. {
  14. mxGeometry geo = getCellGeometry(cells[i]);
  15. if (result == null)
  16. {
  17. result = new mxRectangle(geo);
  18. }
  19. else
  20. {
  21. result.add(geo);
  22. }
  23. }
  24. }
  25. }
  26. return result;
  27. }

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

  1. /**
  2. * Returns the top, left corner of the given cell.
  3. */
  4. protected mxPoint getOriginForCell(Object cell)
  5. {
  6. mxPoint result = origins.get(cell);
  7. if (result == null)
  8. {
  9. mxGraph graph = graphComponent.getGraph();
  10. if (cell != null)
  11. {
  12. result = new mxPoint(getOriginForCell(graph.getModel()
  13. .getParent(cell)));
  14. mxGeometry geo = graph.getCellGeometry(cell);
  15. // TODO: Handle offset, relative geometries etc
  16. if (geo != null)
  17. {
  18. result.setX(result.getX() + geo.getX());
  19. result.setY(result.getY() + geo.getY());
  20. }
  21. }
  22. if (result == null)
  23. {
  24. mxPoint t = graph.getView().getTranslate();
  25. result = new mxPoint(-t.getX(), -t.getY());
  26. }
  27. origins.put(cell, result);
  28. }
  29. return result;
  30. }

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

  1. /**
  2. * Returns the top, left corner of the given cell.
  3. */
  4. protected mxPoint getOriginForCell(Object cell)
  5. {
  6. mxPoint result = origins.get(cell);
  7. if (result == null)
  8. {
  9. mxGraph graph = graphComponent.getGraph();
  10. if (cell != null)
  11. {
  12. result = new mxPoint(getOriginForCell(graph.getModel()
  13. .getParent(cell)));
  14. mxGeometry geo = graph.getCellGeometry(cell);
  15. // TODO: Handle offset, relative geometries etc
  16. if (geo != null)
  17. {
  18. result.setX(result.getX() + geo.getX());
  19. result.setY(result.getY() + geo.getY());
  20. }
  21. }
  22. if (result == null)
  23. {
  24. mxPoint t = graph.getView().getTranslate();
  25. result = new mxPoint(-t.getX(), -t.getY());
  26. }
  27. origins.put(cell, result);
  28. }
  29. return result;
  30. }

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

  1. mxGeometry geo = graph.getCellGeometry(cell);

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

  1. mxGeometry geo = graph.getCellGeometry(cell);

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

代码示例来源: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. mxGeometry geo = graph.getCellGeometry(cell);

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

  1. mxGeometry geo = graph.getCellGeometry(cell);

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

  1. mxGeometry geo = graph.getCellGeometry(previewState.getCell());

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

  1. mxGeometry geo = graph.getCellGeometry(cell);

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

  1. mxGeometry geo = graph.getCellGeometry(cell);

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

  1. mxGeometry geo = graph.getCellGeometry(previewState.getCell());

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

  1. if (getCellGeometry(group) == null)

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

  1. if (getCellGeometry(group) == null)

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

  1. mxRectangle bounds = graph.getBoundingBoxFromGeometry(children);
  2. mxGeometry geometry = graph.getCellGeometry(group);
  3. double left = 0;
  4. double top = 0;

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

  1. mxRectangle bounds = graph.getBoundingBoxFromGeometry(children);
  2. mxGeometry geometry = graph.getCellGeometry(group);
  3. double left = 0;
  4. double top = 0;

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

  1. mxGeometry geo = getCellGeometry(cells[i]);

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

  1. mxGeometry geo = getCellGeometry(cells[i]);

相关文章

mxGraph类方法