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

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

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

mxGraph.getDropTarget介绍

[英]Returns the given cell if it is a drop target for the given cells or the nearest ancestor that may be used as a drop target for the given cells. If the given array contains a swimlane and swimlaneNesting is false then this always returns null. If no cell is given, then the bottommost swimlane at the location of the given event is returned. This function should only be used if isDropEnabled returns true.
[中]如果给定单元格是丢弃目标,或者最近的祖先可能用作给定单元格的丢弃目标,则返回给定单元格。如果给定数组包含泳道,且泳道嵌套为false,则该数组始终返回null。如果没有给出单元格,则返回给定事件位置最底部的泳道。仅当IsDrupEnabled返回true时,才应使用此函数。

代码示例

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

  1. /**
  2. * Returns the drop target for the given transferable and location.
  3. */
  4. protected Object getDropTarget(mxGraphComponent graphComponent,
  5. mxGraphTransferable gt)
  6. {
  7. Object[] cells = gt.getCells();
  8. Object target = null;
  9. // Finds the target cell at the given location and checks if the
  10. // target is not already the parent of the first imported cell
  11. if (location != null)
  12. {
  13. target = graphComponent.getGraph().getDropTarget(cells, location,
  14. graphComponent.getCellAt(location.x, location.y));
  15. if (cells.length > 0
  16. && graphComponent.getGraph().getModel().getParent(cells[0]) == target)
  17. {
  18. target = null;
  19. }
  20. }
  21. return target;
  22. }

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

  1. /**
  2. * Returns the drop target for the given transferable and location.
  3. */
  4. protected Object getDropTarget(mxGraphComponent graphComponent,
  5. mxGraphTransferable gt)
  6. {
  7. Object[] cells = gt.getCells();
  8. Object target = null;
  9. // Finds the target cell at the given location and checks if the
  10. // target is not already the parent of the first imported cell
  11. if (location != null)
  12. {
  13. target = graphComponent.getGraph().getDropTarget(cells, location,
  14. graphComponent.getCellAt(location.x, location.y));
  15. if (cells.length > 0
  16. && graphComponent.getGraph().getModel().getParent(cells[0]) == target)
  17. {
  18. target = null;
  19. }
  20. }
  21. return target;
  22. }

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

  1. dropTarget = graph.getDropTarget(
  2. new Object[] { vertex }, e.getPoint(),
  3. graphComponent.getCellAt(e.getX(), e.getY()));

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

  1. Object[] cells = (isLocal) ? graph.getSelectionCells()
  2. : dragCells;
  3. cell = graph.getDropTarget(cells, e.getPoint(), cell);

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

  1. cell = graph.getDropTarget(cells, e.getPoint(), cell);

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

  1. dropTarget = graph.getDropTarget(
  2. new Object[] { vertex }, e.getPoint(),
  3. graphComponent.getCellAt(e.getX(), e.getY()));

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

  1. Object[] cells = (isLocal) ? graph.getSelectionCells()
  2. : dragCells;
  3. cell = graph.getDropTarget(cells, e.getPoint(), cell);

相关文章

mxGraph类方法