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

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

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

mxGraph.isSplitEnabled介绍

[英]Affects the return values of isValidDropTarget to allow for edges as drop targets. The splitEdge method is called in mxGraphHandler if mxGraphComponent.isSplitEvent returns true for a given configuration.
[中]影响isValidDropTarget的返回值,以允许边作为放置目标。如果mxGraphComponent,则在mxGraphHandler中调用splitEdge方法。对于给定的配置,isSplitEvent返回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. : null;
  2. if (graph.isSplitEnabled()
  3. && graph.isSplitTarget(target, cells))

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

  1. : null;
  2. if (graph.isSplitEnabled()
  3. && graph.isSplitTarget(target, cells))

相关文章

mxGraph类方法