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

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

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

mxGraph.isSplitTarget介绍

[英]Returns true if split is enabled and the given edge may be splitted into two edges with the given cell as a new terminal between the two.
[中]如果已启用拆分,且给定的边可能拆分为两条边,且给定的单元格作为两条边之间的新端子,则返回true。

代码示例

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

  1. /**
  2. * Returns true if the given cell is a valid drop target for the specified
  3. * cells. This returns true if the cell is a swimlane, has children and is
  4. * not collapsed, or if splitEnabled is true and isSplitTarget returns
  5. * true for the given arguments
  6. *
  7. * @param cell Object that represents the possible drop target.
  8. * @param cells Objects that are going to be dropped.
  9. * @return Returns true if the cell is a valid drop target for the given
  10. * cells.
  11. */
  12. public boolean isValidDropTarget(Object cell, Object[] cells)
  13. {
  14. return cell != null
  15. && ((isSplitEnabled() && isSplitTarget(cell, cells)) || (!model
  16. .isEdge(cell) && (isSwimlane(cell) || (model
  17. .getChildCount(cell) > 0 && !isCellCollapsed(cell)))));
  18. }

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

  1. /**
  2. * Returns true if the given cell is a valid drop target for the specified
  3. * cells. This returns true if the cell is a swimlane, has children and is
  4. * not collapsed, or if splitEnabled is true and isSplitTarget returns
  5. * true for the given arguments
  6. *
  7. * @param cell Object that represents the possible drop target.
  8. * @param cells Objects that are going to be dropped.
  9. * @return Returns true if the cell is a valid drop target for the given
  10. * cells.
  11. */
  12. public boolean isValidDropTarget(Object cell, Object[] cells)
  13. {
  14. return cell != null
  15. && ((isSplitEnabled() && isSplitTarget(cell, cells)) || (!model
  16. .isEdge(cell) && (isSwimlane(cell) || (model
  17. .getChildCount(cell) > 0 && !isCellCollapsed(cell)))));
  18. }

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

  1. /**
  2. * Gets a drop target using getDropTarget and imports the cells using
  3. * mxGraph.splitEdge or mxGraphComponent.importCells depending on the
  4. * drop target and the return values of mxGraph.isSplitEnabled and
  5. * mxGraph.isSplitTarget. Selects and returns the cells that have been
  6. * imported.
  7. */
  8. protected Object[] importCells(mxGraphComponent graphComponent,
  9. mxGraphTransferable gt, double dx, double dy)
  10. {
  11. Object target = getDropTarget(graphComponent, gt);
  12. mxGraph graph = graphComponent.getGraph();
  13. Object[] cells = gt.getCells();
  14. cells = graphComponent.getImportableCells(cells);
  15. if (graph.isSplitEnabled() && graph.isSplitTarget(target, cells))
  16. {
  17. graph.splitEdge(target, cells, dx, dy);
  18. }
  19. else
  20. {
  21. cells = graphComponent.importCells(cells, dx, dy, target, location);
  22. graph.setSelectionCells(cells);
  23. }
  24. return cells;
  25. }

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

  1. /**
  2. * Gets a drop target using getDropTarget and imports the cells using
  3. * mxGraph.splitEdge or mxGraphComponent.importCells depending on the
  4. * drop target and the return values of mxGraph.isSplitEnabled and
  5. * mxGraph.isSplitTarget. Selects and returns the cells that have been
  6. * imported.
  7. */
  8. protected Object[] importCells(mxGraphComponent graphComponent,
  9. mxGraphTransferable gt, double dx, double dy)
  10. {
  11. Object target = getDropTarget(graphComponent, gt);
  12. mxGraph graph = graphComponent.getGraph();
  13. Object[] cells = gt.getCells();
  14. cells = graphComponent.getImportableCells(cells);
  15. if (graph.isSplitEnabled() && graph.isSplitTarget(target, cells))
  16. {
  17. graph.splitEdge(target, cells, dx, dy);
  18. }
  19. else
  20. {
  21. cells = graphComponent.importCells(cells, dx, dy, target, location);
  22. graph.setSelectionCells(cells);
  23. }
  24. return cells;
  25. }

代码示例来源:origin: sc.fiji/TrackMate_

  1. final Object target = ( targetState != null ) ? targetState.getCell() : null;
  2. if ( lGraph.isSplitEnabled() && lGraph.isSplitTarget( target, cells ) )

代码示例来源:origin: fiji/TrackMate

  1. final Object target = ( targetState != null ) ? targetState.getCell() : null;
  2. if ( lGraph.isSplitEnabled() && lGraph.isSplitTarget( target, cells ) )

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

  1. && graph.isSplitTarget(target, cells))

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

  1. && graph.isSplitTarget(target, cells))

相关文章

mxGraph类方法