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

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

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

mxGraph.getEdgeValidationError介绍

[英]Returns the validation error message to be displayed when inserting or changing an edges' connectivity. A return value of null means the edge is valid, a return value of '' means it's not valid, but do not display an error message. Any other (non-empty) string returned from this method is displayed as an error message when trying to connect an edge to a source and target. This implementation uses the multiplicities, as well as multigraph and allowDanglingEdges to generate validation errors.
[中]

代码示例

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

  1. /**
  2. * Checks if the return value of getEdgeValidationError for the given
  3. * arguments is null.
  4. *
  5. * @param edge Cell that represents the edge to validate.
  6. * @param source Cell that represents the source terminal.
  7. * @param target Cell that represents the target terminal.
  8. */
  9. public boolean isEdgeValid(Object edge, Object source, Object target)
  10. {
  11. return getEdgeValidationError(edge, source, target) == null;
  12. }

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

  1. /**
  2. * Checks if the return value of getEdgeValidationError for the given
  3. * arguments is null.
  4. *
  5. * @param edge Cell that represents the edge to validate.
  6. * @param source Cell that represents the source terminal.
  7. * @param target Cell that represents the target terminal.
  8. */
  9. public boolean isEdgeValid(Object edge, Object source, Object target)
  10. {
  11. return getEdgeValidationError(edge, source, target) == null;
  12. }

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

  1. /**
  2. * Returns the error message or an empty string if the connection for the
  3. * given source target pair is not valid. Otherwise it returns null.
  4. */
  5. public String validateConnection(Object source, Object target)
  6. {
  7. return graphComponent.getGraph().getEdgeValidationError(
  8. state.getCell(), source, target);
  9. }

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

  1. /**
  2. * Returns the error message or an empty string if the connection for the
  3. * given source target pair is not valid. Otherwise it returns null.
  4. */
  5. public String validateConnection(Object source, Object target)
  6. {
  7. return graphComponent.getGraph().getEdgeValidationError(
  8. state.getCell(), source, target);
  9. }

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

  1. /**
  2. * Returns the error message or an empty string if the connection for the
  3. * given source target pair is not valid. Otherwise it returns null.
  4. */
  5. public String validateConnection(Object source, Object target)
  6. {
  7. if (target == null && createTarget)
  8. {
  9. return null;
  10. }
  11. if (!isValidTarget(target))
  12. {
  13. return "";
  14. }
  15. return graphComponent.getGraph().getEdgeValidationError(
  16. connectPreview.getPreviewState().getCell(), source, target);
  17. }

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

  1. /**
  2. * Returns the error message or an empty string if the connection for the
  3. * given source target pair is not valid. Otherwise it returns null.
  4. */
  5. public String validateConnection(Object source, Object target)
  6. {
  7. if (target == null && createTarget)
  8. {
  9. return null;
  10. }
  11. if (!isValidTarget(target))
  12. {
  13. return "";
  14. }
  15. return graphComponent.getGraph().getEdgeValidationError(
  16. connectPreview.getPreviewState().getCell(), source, target);
  17. }

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

  1. Object target)
  2. String error = super.getEdgeValidationError(edge, source, target);
  3. if (error == null)

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

  1. String tmp = graph.getEdgeValidationError(cell,
  2. model.getTerminal(cell, true),
  3. model.getTerminal(cell, false));

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

  1. String tmp = graph.getEdgeValidationError(cell,
  2. model.getTerminal(cell, true),
  3. model.getTerminal(cell, false));

代码示例来源: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. }

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

  1. && getEdgeValidationError(clones[i],
  2. model.getTerminal(clones[i], true),
  3. model.getTerminal(clones[i], false)) != null)

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

  1. && getEdgeValidationError(clones[i],
  2. model.getTerminal(clones[i], true),
  3. model.getTerminal(clones[i], false)) != null)

相关文章

mxGraph类方法