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

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

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

mxGraph.isCellConnectable介绍

[英]Returns true if the given cell is connectable in this graph. This implementation uses . Subclassers can override this to implement specific connectable states for cells in only one graph, that is, without affecting the connectable state of the cell in the model.
[中]如果给定单元格在此图中可连接,则返回true。此实现使用。子类可以覆盖该属性,只在一个图中为单元实现特定的可连接状态,也就是说,不影响模型中单元的可连接状态。

代码示例

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

  1. /**
  2. * Returns true if the given cell is a valid source for new connections.
  3. * This implementation returns true for all non-null values and is
  4. * called by is called by <isValidConnection>.
  5. *
  6. * @param cell Object that represents a possible source or null.
  7. * @return Returns true if the given cell is a valid source terminal.
  8. */
  9. public boolean isValidSource(Object cell)
  10. {
  11. return (cell == null && allowDanglingEdges)
  12. || (cell != null
  13. && (!model.isEdge(cell) || isConnectableEdges()) && isCellConnectable(cell));
  14. }

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

  1. /**
  2. * Returns true if the given cell is a valid source for new connections.
  3. * This implementation returns true for all non-null values and is
  4. * called by is called by <isValidConnection>.
  5. *
  6. * @param cell Object that represents a possible source or null.
  7. * @return Returns true if the given cell is a valid source terminal.
  8. */
  9. public boolean isValidSource(Object cell)
  10. {
  11. return (cell == null && allowDanglingEdges)
  12. || (cell != null
  13. && (!model.isEdge(cell) || isConnectableEdges()) && isCellConnectable(cell));
  14. }

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

  1. /**
  2. * Returns true if split is enabled and the given edge may be splitted into
  3. * two edges with the given cell as a new terminal between the two.
  4. *
  5. * @param target Object that represents the edge to be splitted.
  6. * @param cells Array of cells to add into the given edge.
  7. * @return Returns true if the given edge may be splitted by the given
  8. * cell.
  9. */
  10. public boolean isSplitTarget(Object target, Object[] cells)
  11. {
  12. if (target != null && cells != null && cells.length == 1)
  13. {
  14. Object src = model.getTerminal(target, true);
  15. Object trg = model.getTerminal(target, false);
  16. return (model.isEdge(target)
  17. && isCellConnectable(cells[0])
  18. && getEdgeValidationError(target,
  19. model.getTerminal(target, true), cells[0]) == null
  20. && !model.isAncestor(cells[0], src) && !model.isAncestor(
  21. cells[0], trg));
  22. }
  23. return false;
  24. }

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

  1. /**
  2. * Returns true if split is enabled and the given edge may be splitted into
  3. * two edges with the given cell as a new terminal between the two.
  4. *
  5. * @param target Object that represents the edge to be splitted.
  6. * @param cells Array of cells to add into the given edge.
  7. * @return Returns true if the given edge may be splitted by the given
  8. * cell.
  9. */
  10. public boolean isSplitTarget(Object target, Object[] cells)
  11. {
  12. if (target != null && cells != null && cells.length == 1)
  13. {
  14. Object src = model.getTerminal(target, true);
  15. Object trg = model.getTerminal(target, false);
  16. return (model.isEdge(target)
  17. && isCellConnectable(cells[0])
  18. && getEdgeValidationError(target,
  19. model.getTerminal(target, true), cells[0]) == null
  20. && !model.isAncestor(cells[0], src) && !model.isAncestor(
  21. cells[0], trg));
  22. }
  23. return false;
  24. }

相关文章

mxGraph类方法