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

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

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

Edge.getSourceNode介绍

暂无

代码示例

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

private Predicate<Edge> isDifferentParent() {
  return e -> e.getContent() instanceof Child &&
      !parent.equals(e.getSourceNode());
}

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

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

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

private Map<String, Node> findEdgesBydId(String nodeId) {
  Map<String, Node> nodes = new HashMap<>();
  childEdges()
      .filter(e -> e.getSourceNode().getUUID().equals(nodeId))
      .map(Edge::getTargetNode)
      .forEach(n -> nodes.put(n.getUUID(), n)); // use forEach instead of collect to avoid issues with type inference
  return nodes;
}

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

private static boolean isCompensationTarget(final Node<?, ? extends Edge> node) {
  return node.getInEdges().stream()
      .filter(edge -> edge.getSourceNode().getContent() instanceof View &&
          ((View) edge.getSourceNode().getContent()).getDefinition() instanceof IntermediateCompensationEvent)
      .findFirst()
      .isPresent();
}

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

@SuppressWarnings("unchecked")
private static Node getParent(final Node node) {
  List<Edge> inEdges = node.getInEdges();
  if (null != inEdges && !inEdges.isEmpty()) {
    for (final Edge edge : inEdges) {
      if (edge.getContent() instanceof Child) {
        return edge.getSourceNode();
      }
    }
  }
  return null;
}

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

@SuppressWarnings("unchecked")
private Node<View, Edge> getDockSourceNode(final Node<View, Edge> node) {
  List<Edge> inEdges = node.getInEdges();
  if (null != inEdges && !inEdges.isEmpty()) {
    for (Edge edge : inEdges) {
      if (isDockEdge(edge)) {
        return edge.getSourceNode();
      }
    }
  }
  return null;
}

代码示例来源: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-client-common

private Optional<Node> getParent() {
  List<Edge> inEdges = candidate.getInEdges();
  if (null != inEdges && !inEdges.isEmpty()) {
    for (final Edge edge : inEdges) {
      if (isChildEdge(edge) || isDockEdge(edge)) {
        return Optional.ofNullable(edge.getSourceNode());
      }
    }
  }
  return Optional.empty();
}

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

@SuppressWarnings("unchecked")
public static Node getParent(final Node node) {
  List<Edge> inEdges = null != node ? node.getInEdges() : null;
  if (null != inEdges && !inEdges.isEmpty()) {
    for (final Edge edge : inEdges) {
      if (isChildEdge(edge) || isDockEdge(edge)) {
        return edge.getSourceNode();
      }
    }
  }
  return null;
}

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

@SuppressWarnings("unchecked")
private static boolean isSourceChanged(final Node node,
                    final Edge<ViewConnector<?>, Node> connector,
                    final Connection connection) {
  final ViewConnector vc = connector.getContent();
  return (!eq(node,
        connector.getSourceNode(),
        connection,
        null != vc ? vc.getSourceConnection() : 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-core-common

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

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

@Override
@SuppressWarnings("unchecked")
protected boolean doStartEdgeTraversal(final Edge edge,
                    final ChildrenTraverseCallback<Node<View, Edge>, Edge<Child, Node>> callback) {
  if (accepts(edge)) {
    final Node<View, Edge> parent = edge.getSourceNode();
    parentStack.push(parent);
    callback.startEdgeTraversal(edge);
    return true;
  }
  return false;
}

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

@Test
@SuppressWarnings("unchecked")
public void testSkipRulesForSameSourceNodeAsBefore() {
  when(edge.getSourceNode()).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());
}

相关文章