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

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

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

mxGraph.isCellSelectable介绍

[英]Returns true if the given cell is selectable. This implementation returns .
[中]如果给定单元格是可选的,则返回true。这个实现返回。

代码示例

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

  1. /**
  2. * Returns the first selectable cell in the given array of cells.
  3. *
  4. * @param cells Array of cells to return the first selectable cell for.
  5. * @return Returns the first cell that may be selected.
  6. */
  7. protected Object getFirstSelectableCell(Object[] cells)
  8. {
  9. if (cells != null)
  10. {
  11. for (int i = 0; i < cells.length; i++)
  12. {
  13. if (graph.isCellSelectable(cells[i]))
  14. {
  15. return cells[i];
  16. }
  17. }
  18. }
  19. return null;
  20. }

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

  1. /**
  2. * Returns the first selectable cell in the given array of cells.
  3. *
  4. * @param cells Array of cells to return the first selectable cell for.
  5. * @return Returns the first cell that may be selected.
  6. */
  7. protected Object getFirstSelectableCell(Object[] cells)
  8. {
  9. if (cells != null)
  10. {
  11. for (int i = 0; i < cells.length; i++)
  12. {
  13. if (graph.isCellSelectable(cells[i]))
  14. {
  15. return cells[i];
  16. }
  17. }
  18. }
  19. return null;
  20. }

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

  1. /**
  2. *
  3. */
  4. public void addCells(Object[] cells)
  5. {
  6. if (cells != null)
  7. {
  8. Collection<Object> remove = null;
  9. if (singleSelection)
  10. {
  11. remove = this.cells;
  12. cells = new Object[] { getFirstSelectableCell(cells) };
  13. }
  14. List<Object> tmp = new ArrayList<Object>(cells.length);
  15. for (int i = 0; i < cells.length; i++)
  16. {
  17. if (!isSelected(cells[i]) && graph.isCellSelectable(cells[i]))
  18. {
  19. tmp.add(cells[i]);
  20. }
  21. }
  22. changeSelection(tmp, remove);
  23. }
  24. }

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

  1. /**
  2. * Clears the selection and adds the given cells.
  3. */
  4. public void setCells(Object[] cells)
  5. {
  6. if (cells != null)
  7. {
  8. if (singleSelection)
  9. {
  10. cells = new Object[] { getFirstSelectableCell(cells) };
  11. }
  12. List<Object> tmp = new ArrayList<Object>(cells.length);
  13. for (int i = 0; i < cells.length; i++)
  14. {
  15. if (graph.isCellSelectable(cells[i]))
  16. {
  17. tmp.add(cells[i]);
  18. }
  19. }
  20. changeSelection(tmp, this.cells);
  21. }
  22. else
  23. {
  24. clear();
  25. }
  26. }

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

  1. /**
  2. *
  3. */
  4. public void addCells(Object[] cells)
  5. {
  6. if (cells != null)
  7. {
  8. Collection<Object> remove = null;
  9. if (singleSelection)
  10. {
  11. remove = this.cells;
  12. cells = new Object[] { getFirstSelectableCell(cells) };
  13. }
  14. List<Object> tmp = new ArrayList<Object>(cells.length);
  15. for (int i = 0; i < cells.length; i++)
  16. {
  17. if (!isSelected(cells[i]) && graph.isCellSelectable(cells[i]))
  18. {
  19. tmp.add(cells[i]);
  20. }
  21. }
  22. changeSelection(tmp, remove);
  23. }
  24. }

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

  1. /**
  2. * Clears the selection and adds the given cells.
  3. */
  4. public void setCells(Object[] cells)
  5. {
  6. if (cells != null)
  7. {
  8. if (singleSelection)
  9. {
  10. cells = new Object[] { getFirstSelectableCell(cells) };
  11. }
  12. List<Object> tmp = new ArrayList<Object>(cells.length);
  13. for (int i = 0; i < cells.length; i++)
  14. {
  15. if (graph.isCellSelectable(cells[i]))
  16. {
  17. tmp.add(cells[i]);
  18. }
  19. }
  20. changeSelection(tmp, this.cells);
  21. }
  22. else
  23. {
  24. clear();
  25. }
  26. }

相关文章

mxGraph类方法