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

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

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

mxGraph.getCurrentRoot介绍

[英]Returns the current root of the displayed cell hierarchy. This is a shortcut to in .
[中]返回显示的单元格层次结构的当前根。这是进入的捷径。

代码示例

代码示例来源:origin: Activiti/Activiti

  1. double y0 = x0;
  2. if (!moveTree || parent == graph.getDefaultParent() || parent == graph.getCurrentRoot()) {
  3. mxGeometry g = model.getGeometry(root);
  4. if (g.isRelative()) {
  5. if (model.getParent(node.cell) != graph.getCurrentRoot() && model.getParent(node.cell) != graph.getDefaultParent()) {
  6. moveNode(node, dx, dy);

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

  1. /**
  2. * Uses the root of the model as the root of the displayed cell hierarchy
  3. * and selects the previous root.
  4. */
  5. public void home()
  6. {
  7. Object current = getCurrentRoot();
  8. if (current != null)
  9. {
  10. view.setCurrentRoot(null);
  11. mxCellState state = view.getState(current);
  12. if (state != null)
  13. {
  14. setSelectionCell(current);
  15. }
  16. }
  17. }

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

  1. /**
  2. * Uses the root of the model as the root of the displayed cell hierarchy
  3. * and selects the previous root.
  4. */
  5. public void home()
  6. {
  7. Object current = getCurrentRoot();
  8. if (current != null)
  9. {
  10. view.setCurrentRoot(null);
  11. mxCellState state = view.getState(current);
  12. if (state != null)
  13. {
  14. setSelectionCell(current);
  15. }
  16. }
  17. }

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

  1. /**
  2. *
  3. */
  4. protected void cellDrawn(mxICanvas canvas, mxCellState state)
  5. {
  6. if (isFoldingEnabled() && canvas instanceof mxGraphics2DCanvas)
  7. {
  8. mxIGraphModel model = graph.getModel();
  9. mxGraphics2DCanvas g2c = (mxGraphics2DCanvas) canvas;
  10. Graphics2D g2 = g2c.getGraphics();
  11. // Draws the collapse/expand icons
  12. boolean isEdge = model.isEdge(state.getCell());
  13. if (state.getCell() != graph.getCurrentRoot()
  14. && (model.isVertex(state.getCell()) || isEdge))
  15. {
  16. ImageIcon icon = getFoldingIcon(state);
  17. if (icon != null)
  18. {
  19. Rectangle bounds = getFoldingIconBounds(state, icon);
  20. g2.drawImage(icon.getImage(), bounds.x, bounds.y,
  21. bounds.width, bounds.height, this);
  22. }
  23. }
  24. }
  25. }

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

  1. /**
  2. *
  3. */
  4. protected void cellDrawn(mxICanvas canvas, mxCellState state)
  5. {
  6. if (isFoldingEnabled() && canvas instanceof mxGraphics2DCanvas)
  7. {
  8. mxIGraphModel model = graph.getModel();
  9. mxGraphics2DCanvas g2c = (mxGraphics2DCanvas) canvas;
  10. Graphics2D g2 = g2c.getGraphics();
  11. // Draws the collapse/expand icons
  12. boolean isEdge = model.isEdge(state.getCell());
  13. if (state.getCell() != graph.getCurrentRoot()
  14. && (model.isVertex(state.getCell()) || isEdge))
  15. {
  16. ImageIcon icon = getFoldingIcon(state);
  17. if (icon != null)
  18. {
  19. Rectangle bounds = getFoldingIconBounds(state, icon);
  20. g2.drawImage(icon.getImage(), bounds.x, bounds.y,
  21. bounds.width, bounds.height, this);
  22. }
  23. }
  24. }
  25. }

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

  1. Object current = getCurrentRoot();

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

  1. Object current = getCurrentRoot();

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

  1. if (parent == getDefaultParent() || parent == getCurrentRoot())

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

  1. if (parent == getDefaultParent() || parent == getCurrentRoot())

代码示例来源:origin: com.bbossgroups.activiti/activiti-bpmn-layout

  1. double y0 = x0;
  2. if (!moveTree || parent == graph.getDefaultParent() || parent == graph.getCurrentRoot()) {
  3. mxGeometry g = model.getGeometry(root);
  4. if (g.isRelative()) {
  5. if (model.getParent(node.cell) != graph.getCurrentRoot() && model.getParent(node.cell) != graph.getDefaultParent()) {
  6. moveNode(node, dx, dy);

代码示例来源:origin: org.flowable/flowable-bpmn-layout

  1. double y0 = x0;
  2. if (!moveTree || parent == graph.getDefaultParent() || parent == graph.getCurrentRoot()) {
  3. mxGeometry g = model.getGeometry(root);
  4. if (g.isRelative()) {
  5. if (model.getParent(node.cell) != graph.getCurrentRoot() && model.getParent(node.cell) != graph.getDefaultParent()) {
  6. moveNode(node, dx, dy);

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

  1. && model.getGeometry(parent) != null)
  2. if (getCurrentRoot() != parent)

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

  1. && model.getGeometry(parent) != null)
  2. if (getCurrentRoot() != parent)

相关文章

mxGraph类方法