org.kie.workbench.common.stunner.core.graph.Edge.getTargetNode()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(8.4k)|赞(0)|评价(0)|浏览(173)

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

Edge.getTargetNode介绍

暂无

代码示例

代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-core-common

@SuppressWarnings("unchecked")
public Node<? extends View<?>, Edge> getTargetNode(final GraphCommandExecutionContext context) {
  if (null == targetNode) {
    targetNode = getEdge(context).getTargetNode();
  }
  return targetNode;
}

代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-case-mgmt-backend

@SuppressWarnings("unchecked")
private void buildChildEdge(Node parentNode) {
  final List<Node> nodes = (List<Node>) parentNode.getOutEdges().stream()
      .map(e -> ((Edge) e).getTargetNode()).collect(Collectors.toList());
  for (int i = 0, n = nodes.size() - 1; i < n; i++) {
    createEdge(UUID.uuid(), nodes.get(i), nodes.get(i + 1));
  }
}

代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-case-mgmt-backend

@SuppressWarnings("unchecked")
private void deleteChild(Node parent, Node child) {
  parent.getOutEdges().stream().filter(edge -> child.equals(((Edge) edge).getTargetNode()))
      .findAny().ifPresent(edge -> {
    parent.getOutEdges().remove(edge);
    child.getInEdges().remove(edge);
  });
}

代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-client-common

private void updateConnectionEdges(AbstractCanvasHandler context, Node<? extends Definition<?>, Edge> candidate) {
  // Update incoming edges for the new shape
  Optional.ofNullable(candidate.getInEdges())
      .ifPresent(edges -> edges.stream()
          .filter(this::isViewEdge)
          .forEach(edge -> updateConnections(context, edge, edge.getSourceNode(), candidate)));
  // Update outgoing edges for the new shape.
  Optional.ofNullable(candidate.getOutEdges())
      .ifPresent(edges -> edges.stream()
          .filter(this::isViewEdge)
          .forEach(edge -> updateConnections(context, edge, candidate, edge.getTargetNode())));
}

代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-core-common

private static boolean isNotCyclicEdge(final Edge edge) {
    final String sourceId = edge.getSourceNode() != null ? edge.getSourceNode().getUUID() : null;
    final String targetId = edge.getTargetNode() != null ? edge.getTargetNode().getUUID() : null;
    return !Objects.equals(sourceId, targetId);
  }
}

代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-core-common

@SuppressWarnings("unchecked")
private void startEdgeTraversal(final Edge edge) {
  final String uuid = edge.getUUID();
  if (!this.processesEdges.contains(uuid)) {
    processesEdges.add(uuid);
    if (callback.startEdgeTraversal(edge)) {
      ifNotProcessed(edge.getTargetNode(),
              () -> startNodeTraversal(edge.getTargetNode()));
    }
    endEdgeTraversal(edge);
  }
}

代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-core-common

@SuppressWarnings("unchecked")
public SetConnectionSourceNodeCommand(final Node<? extends View<?>, Edge> sourceNode,
                   final Edge<? extends View, Node> edge,
                   final Connection connection) {
  this(null != sourceNode ? sourceNode.getUUID() : null,
     edge.getUUID(),
     connection);
  this.sourceNode = sourceNode;
  this.edge = edge;
  this.targetNode = edge.getTargetNode();
}

代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-lienzo

@SuppressWarnings("unchecked")
private static boolean isTargetChanged(final Node node,
                    final Edge<ViewConnector<?>, Node> connector,
                    final Connection connection) {
  final ViewConnector vc = connector.getContent();
  return (!eq(node,
        connector.getTargetNode(),
        connection,
        null != vc ? vc.getTargetConnection() : Optional.empty()));
}

代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-client-common

@Override
  public String toString() {
    return getClass().getName() +
        " [candidate=" + getUUID(candidate) + "," +
        " sourceNode=" + getUUID(candidate.getSourceNode()) + "," +
        " targetNode=" + getUUID(candidate.getTargetNode()) + "]";
  }
}

代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-client-common

@Override
  public String toString() {
    return getClass().getName() +
        " [candidate=" + getUUID(edge) + "," +
        " sourceNode=" + getUUID(edge.getSourceNode()) + "," +
        " targetNode=" + getUUID(edge.getTargetNode()) + "]";
  }
}

代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-bpmn-client

protected BPMNDefinition getEdgeTarget(Edge edge) {
    Node targetNode = edge.getTargetNode();
    if (targetNode != null && targetNode.getContent() instanceof View) {
      Object definition = ((View) targetNode.getContent()).getDefinition();
      if (definition instanceof BPMNDefinition) {
        return (BPMNDefinition) definition;
      }
    }
    return null;
  }
}

代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-core-common

@SuppressWarnings("unchecked")
  private void initializeTheChildNode() {
    Child edgeContent = mock(Child.class);
    when(edge.getContent()).thenReturn(edgeContent);
    when(edge.getSourceNode()).thenReturn(node);
    when(edge.getTargetNode()).thenReturn(node1);
    nodeOutEdges.add(edge);
    nodeInEdges1.add(edge);
  }
}

代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-bpmn-backend

private <T extends BPMNViewDefinition> Edge mockEdge(Node<View<T>, ?> sourceNode, Node<View<T>, ?> targetNode) {
  Edge edge = mock(Edge.class);
  when(edge.getContent()).thenReturn(mock(Child.class));
  when(edge.getSourceNode()).thenReturn(sourceNode);
  when(edge.getTargetNode()).thenReturn(targetNode);
  return edge;
}

代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-core-common

private void shortcut(final Edge<? extends ViewConnector<?>, Node> in,
           final Edge<? extends ViewConnector<?>, Node> out) {
  final ViewConnector<?> outContent = out.getContent();
  final Node targetNode = out.getTargetNode();
  addCommand(new DeleteConnectorCommand(out));
  safeDeleteCallback.ifPresent(c -> c.deleteCandidateConnector(out));
  addCommand(new SetConnectionTargetNodeCommand(targetNode,
                         in,
                         outContent.getTargetConnection().orElse(null)));
  safeDeleteCallback.ifPresent(c -> c.setEdgeTargetNode(targetNode,
                             in));
}

代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-case-mgmt-client

@Test
  public void checkGetChildIndex() {
    final Edge edge = mock(Edge.class);
    when(edge.getTargetNode()).thenReturn(child);
    when(parent.getOutEdges()).thenReturn(Collections.singletonList(edge));

    assertEquals(0, CaseManagementCanvasCommandFactory.getChildIndex(parent, child));
  }
}

代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-case-mgmt-client

@Before
public void setUp() {
  super.setup();
  final Edge edge = mock(Edge.class);
  when(edge.getTargetNode()).thenReturn(candidate);
  parent.getOutEdges().add(edge);
  tested = new CaseManagementRemoveChildCommand(parent, candidate);
}

代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-core-common

@Override
public void startChildEdgeTraversal(final Edge<Object, Node> edge) {
  log("(Child= Edge UUID: " + edge.getUUID());
  final Node outNode = edge.getTargetNode();
  if (outNode == null) {
    log(indent + "  No outgoing node found");
  } else {
    log(indent + "  Outgoing Node");
    log(indent + "  ==============");
  }
}

代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-core-common

@Test
@SuppressWarnings("unchecked")
public void testSkipRulesForSameTargetNodeAsBefore() {
  when(edge.getTargetNode()).thenReturn(node);
  CommandResult<RuleViolation> result = tested.allow(graphCommandExecutionContext);
  assertEquals(CommandResult.Type.INFO,
         result.getType());
  verify(ruleManager,
      times(0)).evaluate(eq(ruleSet),
               any(RuleEvaluationContext.class));
}

代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-core-common

public static void log(final Edge<?, Node> edge) {
  log("Edge UUID: " + edge.getUUID());
  final Object content = edge.getContent();
  log("  Edge Content: " + content.getClass().getName());
  final Node inNode = edge.getSourceNode();
  final Node outNode = edge.getTargetNode();
  log("  Edge In Node: " + (null != inNode ? inNode.getUUID() : "null"));
  log("  Edge Out Node: " + (null != outNode ? outNode.getUUID() : "null"));
  if (edge.getContent() instanceof ViewConnector) {
    log((ViewConnector) edge.getContent());
  }
}

代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-case-mgmt-client

@Test
public void testGraphCommand() {
  assertCommandSuccess(command.execute(canvasHandler));
  assertEquals(1,
         parent.getOutEdges().size());
  assertEquals(candidate,
         parent.getOutEdges().get(index).getTargetNode());
  assertEquals(1,
         candidate.getInEdges().size());
  assertEquals(parent,
         candidate.getInEdges().get(0).getSourceNode());
}

相关文章