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

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

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

mxGraph.isTerminalPointMovable介绍

[英]Function: isTerminalPointMovable Returns true if the given terminal point is movable. This is independent from isCellConnectable and isCellDisconnectable and controls if terminal points can be moved in the graph if the edge is not connected. Note that it is required for this to return true to connect unconnected edges. This implementation returns true.
[中]函数:如果给定的端点是可移动的,则isTerminalPointMovable返回true。这独立于isCellConnectable和isCellDisconnectable,并控制如果边未连接,是否可以在图形中移动端点。请注意,如果要连接未连接的边,则需要返回true。这个实现返回true。

代码示例

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

  1. /**
  2. *
  3. */
  4. public void mousePressed(MouseEvent e)
  5. {
  6. super.mousePressed(e);
  7. boolean source = isSource(index);
  8. if (source || isTarget(index))
  9. {
  10. mxGraph graph = graphComponent.getGraph();
  11. mxIGraphModel model = graph.getModel();
  12. Object terminal = model.getTerminal(state.getCell(), source);
  13. if ((terminal == null && !graph.isTerminalPointMovable(
  14. state.getCell(), source))
  15. || (terminal != null && !graph.isCellDisconnectable(
  16. state.getCell(), terminal, source)))
  17. {
  18. first = null;
  19. }
  20. }
  21. }

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

  1. /**
  2. *
  3. */
  4. public void mousePressed(MouseEvent e)
  5. {
  6. super.mousePressed(e);
  7. boolean source = isSource(index);
  8. if (source || isTarget(index))
  9. {
  10. mxGraph graph = graphComponent.getGraph();
  11. mxIGraphModel model = graph.getModel();
  12. Object terminal = model.getTerminal(state.getCell(), source);
  13. if ((terminal == null && !graph.isTerminalPointMovable(
  14. state.getCell(), source))
  15. || (terminal != null && !graph.isCellDisconnectable(
  16. state.getCell(), terminal, source)))
  17. {
  18. first = null;
  19. }
  20. }
  21. }

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

  1. /**
  2. *
  3. */
  4. protected Color getHandleFillColor(int index)
  5. {
  6. boolean source = isSource(index);
  7. if (source || isTarget(index))
  8. {
  9. mxGraph graph = graphComponent.getGraph();
  10. Object terminal = graph.getModel().getTerminal(state.getCell(),
  11. source);
  12. if (terminal == null
  13. && !graphComponent.getGraph().isTerminalPointMovable(
  14. state.getCell(), source))
  15. {
  16. return mxSwingConstants.LOCKED_HANDLE_FILLCOLOR;
  17. }
  18. else if (terminal != null)
  19. {
  20. return (graphComponent.getGraph().isCellDisconnectable(
  21. state.getCell(), terminal, source)) ? mxSwingConstants.CONNECT_HANDLE_FILLCOLOR
  22. : mxSwingConstants.LOCKED_HANDLE_FILLCOLOR;
  23. }
  24. }
  25. return super.getHandleFillColor(index);
  26. }

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

  1. /**
  2. *
  3. */
  4. protected Color getHandleFillColor(int index)
  5. {
  6. boolean source = isSource(index);
  7. if (source || isTarget(index))
  8. {
  9. mxGraph graph = graphComponent.getGraph();
  10. Object terminal = graph.getModel().getTerminal(state.getCell(),
  11. source);
  12. if (terminal == null
  13. && !graphComponent.getGraph().isTerminalPointMovable(
  14. state.getCell(), source))
  15. {
  16. return mxSwingConstants.LOCKED_HANDLE_FILLCOLOR;
  17. }
  18. else if (terminal != null)
  19. {
  20. return (graphComponent.getGraph().isCellDisconnectable(
  21. state.getCell(), terminal, source)) ? mxSwingConstants.CONNECT_HANDLE_FILLCOLOR
  22. : mxSwingConstants.LOCKED_HANDLE_FILLCOLOR;
  23. }
  24. }
  25. return super.getHandleFillColor(index);
  26. }

相关文章

mxGraph类方法