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

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

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

mxGraph.isCellVisible介绍

[英]Returns true if the given cell is visible in this graph. This implementation uses . Subclassers can override this to implement specific visibility for cells in only one graph, that is, without affecting the visible state of the cell. When using dynamic filter expressions for cell visibility, then the graph should be revalidated after the filter expression has changed.
[中]如果给定单元格在此图中可见,则返回true。此实现使用。子类可以覆盖该属性,以便只在一个图形中实现单元格的特定可见性,也就是说,不影响单元格的可见状态。当为单元格可见性使用动态过滤器表达式时,应在过滤器表达式更改后重新验证图形。

代码示例

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

  1. /**
  2. * Returns the visible child vertices or edges in the given parent. If
  3. * vertices and edges is false, then all children are returned.
  4. *
  5. * @param parent Cell whose children should be returned.
  6. * @param vertices Specifies if child vertices should be returned.
  7. * @param edges Specifies if child edges should be returned.
  8. * @return Returns the child vertices and edges.
  9. */
  10. public Object[] getChildCells(Object parent, boolean vertices, boolean edges)
  11. {
  12. Object[] cells = mxGraphModel.getChildCells(model, parent, vertices,
  13. edges);
  14. List<Object> result = new ArrayList<Object>(cells.length);
  15. // Filters out the non-visible child cells
  16. for (int i = 0; i < cells.length; i++)
  17. {
  18. if (isCellVisible(cells[i]))
  19. {
  20. result.add(cells[i]);
  21. }
  22. }
  23. return result.toArray();
  24. }

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

  1. /**
  2. * Returns the visible child vertices or edges in the given parent. If
  3. * vertices and edges is false, then all children are returned.
  4. *
  5. * @param parent Cell whose children should be returned.
  6. * @param vertices Specifies if child vertices should be returned.
  7. * @param edges Specifies if child edges should be returned.
  8. * @return Returns the child vertices and edges.
  9. */
  10. public Object[] getChildCells(Object parent, boolean vertices, boolean edges)
  11. {
  12. Object[] cells = mxGraphModel.getChildCells(model, parent, vertices,
  13. edges);
  14. List<Object> result = new ArrayList<Object>(cells.length);
  15. // Filters out the non-visible child cells
  16. for (int i = 0; i < cells.length; i++)
  17. {
  18. if (isCellVisible(cells[i]))
  19. {
  20. result.add(cells[i]);
  21. }
  22. }
  23. return result.toArray();
  24. }

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

  1. /**
  2. * Returns the cell state for the given cell. If create is true, then the
  3. * state is created if it does not yet exist.
  4. *
  5. * @param cell
  6. * Cell for which a new state should be returned.
  7. * @param create
  8. * Boolean indicating if a new state should be created if it does
  9. * not yet exist.
  10. * @return Returns the state for the given cell.
  11. */
  12. public mxCellState getState(Object cell, boolean create)
  13. {
  14. mxCellState state = null;
  15. if (cell != null)
  16. {
  17. state = states.get(cell);
  18. if (state == null && create && graph.isCellVisible(cell))
  19. {
  20. state = createState(cell);
  21. states.put(cell, state);
  22. }
  23. }
  24. return state;
  25. }

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

  1. /**
  2. * Returns the cell state for the given cell. If create is true, then the
  3. * state is created if it does not yet exist.
  4. *
  5. * @param cell
  6. * Cell for which a new state should be returned.
  7. * @param create
  8. * Boolean indicating if a new state should be created if it does
  9. * not yet exist.
  10. * @return Returns the state for the given cell.
  11. */
  12. public mxCellState getState(Object cell, boolean create)
  13. {
  14. mxCellState state = null;
  15. if (cell != null)
  16. {
  17. state = states.get(cell);
  18. if (state == null && create && graph.isCellVisible(cell))
  19. {
  20. state = createState(cell);
  21. states.put(cell, state);
  22. }
  23. }
  24. return state;
  25. }

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

  1. /**
  2. * Returns true if the given vertex has no connected edges.
  3. *
  4. * @param vertex Object that represents the vertex to be tested.
  5. * @return Returns true if the vertex should be ignored.
  6. */
  7. public boolean isVertexIgnored(Object vertex)
  8. {
  9. return !graph.getModel().isVertex(vertex)
  10. || !graph.isCellVisible(vertex);
  11. }

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

  1. /**
  2. * Returns true if the given vertex has no connected edges.
  3. *
  4. * @param vertex Object that represents the vertex to be tested.
  5. * @return Returns true if the vertex should be ignored.
  6. */
  7. public boolean isVertexIgnored(Object vertex)
  8. {
  9. return !graph.getModel().isVertex(vertex)
  10. || !graph.isCellVisible(vertex);
  11. }

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

  1. /**
  2. * Creates a set of descendant cells
  3. * @param cell The cell whose descendants are to be calculated
  4. * @return the descendants of the cell (not the cell)
  5. */
  6. public Set<Object> filterDescendants(Object cell)
  7. {
  8. mxIGraphModel model = graph.getModel();
  9. Set<Object> result = new LinkedHashSet<Object>();
  10. if (model.isVertex(cell) && cell != this.parent && graph.isCellVisible(cell))
  11. {
  12. result.add(cell);
  13. }
  14. if (this.traverseAncestors || cell == this.parent
  15. && graph.isCellVisible(cell))
  16. {
  17. int childCount = model.getChildCount(cell);
  18. for (int i = 0; i < childCount; i++)
  19. {
  20. Object child = model.getChildAt(cell, i);
  21. result.addAll(filterDescendants(child));
  22. }
  23. }
  24. return result;
  25. }

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

  1. /**
  2. * Creates a set of descendant cells
  3. * @param cell The cell whose descendants are to be calculated
  4. * @return the descendants of the cell (not the cell)
  5. */
  6. public Set<Object> filterDescendants(Object cell)
  7. {
  8. mxIGraphModel model = graph.getModel();
  9. Set<Object> result = new LinkedHashSet<Object>();
  10. if (model.isVertex(cell) && cell != this.parent && graph.isCellVisible(cell))
  11. {
  12. result.add(cell);
  13. }
  14. if (this.traverseAncestors || cell == this.parent
  15. && graph.isCellVisible(cell))
  16. {
  17. int childCount = model.getChildCount(cell);
  18. for (int i = 0; i < childCount; i++)
  19. {
  20. Object child = model.getChildAt(cell, i);
  21. result.addAll(filterDescendants(child));
  22. }
  23. }
  24. return result;
  25. }

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

  1. /**
  2. * Returns true if the given edge has no source or target terminal.
  3. *
  4. * @param edge Object that represents the edge to be tested.
  5. * @return Returns true if the edge should be ignored.
  6. */
  7. public boolean isEdgeIgnored(Object edge)
  8. {
  9. mxIGraphModel model = graph.getModel();
  10. return !model.isEdge(edge) || !graph.isCellVisible(edge)
  11. || model.getTerminal(edge, true) == null
  12. || model.getTerminal(edge, false) == null;
  13. }

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

  1. /**
  2. * Returns true if the given edge has no source or target terminal.
  3. *
  4. * @param edge Object that represents the edge to be tested.
  5. * @return Returns true if the edge should be ignored.
  6. */
  7. public boolean isEdgeIgnored(Object edge)
  8. {
  9. mxIGraphModel model = graph.getModel();
  10. return !model.isEdge(edge) || !graph.isCellVisible(edge)
  11. || model.getTerminal(edge, true) == null
  12. || model.getTerminal(edge, false) == null;
  13. }

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

  1. mxCellState state = view.getState(child);
  2. if (isCellVisible(child) && state != null)

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

  1. if (isCollapsed || !graph.isCellVisible(child))

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

  1. if (isCollapsed || !graph.isCellVisible(child))

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

  1. mxCellState state = view.getState(child);
  2. if (isCellVisible(child) && state != null)

代码示例来源:origin: org.activecomponents.jadex/jadex-editor-bpmn

  1. /**
  2. *
  3. */
  4. public boolean isCellVisible(Object cell)
  5. {
  6. boolean ret = super.isCellVisible(cell);
  7. if (cell instanceof VInParameter ||
  8. cell instanceof VOutParameter ||
  9. cell instanceof VDataEdge)
  10. {
  11. if(modelcontainer.getSettings()!=null)
  12. {
  13. ret &= modelcontainer.getSettings().isDataEdges();
  14. }
  15. }
  16. else if (cell instanceof VSequenceEdge)
  17. {
  18. if(modelcontainer.getSettings()!=null)
  19. {
  20. ret &= modelcontainer.getSettings().isSequenceEdges();
  21. }
  22. }
  23. // System.out.println("IsVisible: " + cell + " " + ret);
  24. return ret;
  25. }

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

  1. if (!graph.isCellVisible(best) || graph.isCellCollapsed(result))

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

  1. if (!graph.isCellVisible(best) || graph.isCellCollapsed(result))

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

  1. mxCellState state = view.getState(cell);
  2. if (graph.isCellVisible(cell) && state != null)

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

  1. visible = visible && graph.isCellVisible(cell);
  2. mxCellState state = getState(cell, visible);

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

  1. visible = visible && graph.isCellVisible(cell);
  2. mxCellState state = getState(cell, visible);

相关文章

mxGraph类方法