本文整理了Java中org.kie.workbench.common.stunner.core.graph.Edge.setTargetNode()
方法的一些代码示例,展示了Edge.setTargetNode()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Edge.setTargetNode()
方法的具体详情如下:
包路径:org.kie.workbench.common.stunner.core.graph.Edge
类名称:Edge
方法名:setTargetNode
暂无
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-core-common
@SuppressWarnings("unchecked")
private void removeDockEdge(final GraphCommandExecutionContext context,
final Node<?, Edge> parent,
final Node<?, Edge> candidate,
final Edge edge) {
edge.setSourceNode(null);
edge.setTargetNode(null);
parent.getOutEdges().remove(edge);
candidate.getInEdges().remove(edge);
getMutableIndex(context).removeEdge(edge);
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-case-mgmt-client
@SuppressWarnings("unchecked")
private void removeRelationship(final Edge e,
final Node parent,
final Node child,
final GraphCommandExecutionContext context) {
e.setSourceNode(null);
e.setTargetNode(null);
parent.getOutEdges().remove(e);
child.getInEdges().remove(e);
getMutableIndex(context).removeEdge(e);
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-case-mgmt-backend
@SuppressWarnings("unchecked")
private void createChild(String uuid, Node parent, Node child, int parentIndex) {
final Edge<Child, Node> edge = new EdgeImpl<>(uuid);
edge.setContent(new Child());
edge.setSourceNode(parent);
edge.setTargetNode(child);
if (parentIndex >= 0) {
parent.getOutEdges().add(parentIndex, edge);
} else {
parent.getOutEdges().add(edge);
}
child.getInEdges().add(edge);
}
代码示例来源:origin: org.kie.workbench/kie-wb-common-dmn-api
@SuppressWarnings("unchecked")
private void connectNodes(final Node source,
final Node target,
final Edge connector) {
source.getOutEdges().add(connector);
target.getInEdges().add(connector);
connector.setSourceNode(source);
connector.setTargetNode(target);
}
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-case-mgmt-backend
@SuppressWarnings("unchecked")
private void createEdge(String uuid, Node sourceNode, Node targetNode) {
final Edge<View<SequenceFlow>, Node> edge = typedFactoryManager.newEdge(uuid, SequenceFlow.class);
edge.setSourceNode(sourceNode);
edge.setTargetNode(targetNode);
sourceNode.getOutEdges().add(edge);
targetNode.getInEdges().add(edge);
ViewConnector<SequenceFlow> content = (ViewConnector<SequenceFlow>) edge.getContent();
content.setSourceConnection(MagnetConnection.Builder.forElement(sourceNode));
content.setTargetConnection(MagnetConnection.Builder.forElement(targetNode));
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-case-mgmt-client
@SuppressWarnings("unchecked")
private void addRelationship(final Node parent,
final Node child,
final OptionalInt index,
final GraphCommandExecutionContext context) {
final String uuid = UUID.uuid();
final Edge<Child, Node> edge = new EdgeImpl<>(uuid);
edge.setContent(new Child());
edge.setSourceNode(parent);
edge.setTargetNode(child);
parent.getOutEdges().add(index.orElseGet(() -> parent.getOutEdges().size()), edge);
child.getInEdges().add(edge);
getMutableIndex(context).addEdge(edge);
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-core-common
@Override
public CommandResult<RuleViolation> execute(final GraphCommandExecutionContext context) {
final CommandResult<RuleViolation> results = allow(context);
if (!results.getType().equals(CommandResult.Type.ERROR)) {
final Node<?, Edge> parent = getParent(context);
final Node<?, Edge> candidate = getCandidate(context);
final Edge<Parent, Node> edge = getEdgeForTarget(parent,
candidate);
if (null != edge) {
edge.setSourceNode(null);
edge.setTargetNode(null);
parent.getInEdges().remove(edge);
candidate.getOutEdges().remove(edge);
getMutableIndex(context).removeEdge(edge);
}
}
return results;
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-core-common
@Override
public CommandResult<RuleViolation> execute(final GraphCommandExecutionContext context) {
final CommandResult<RuleViolation> results = allow(context);
if (!results.getType().equals(CommandResult.Type.ERROR)) {
final Node<?, Edge> parent = getParent(context);
final Node<?, Edge> candidate = getCandidate(context);
final Edge<Parent, Node> edge = getEdgeForTarget(parent,
candidate);
if (null != edge) {
edge.setSourceNode(null);
edge.setTargetNode(null);
parent.getOutEdges().remove(edge);
candidate.getInEdges().remove(edge);
getMutableIndex(context).removeEdge(edge);
}
}
return results;
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-core-common
@Override
@SuppressWarnings("unchecked")
public CommandResult<RuleViolation> execute(final GraphCommandExecutionContext context) {
final CommandResult<RuleViolation> results = allow(context);
if (!results.getType().equals(CommandResult.Type.ERROR)) {
final Edge<? extends View, Node> edge = getEdge(context);
final Node<?, Edge> targetNode = getTargetNode(context);
final Node<? extends View<?>, Edge> lastTargetNode = edge.getTargetNode();
// New connection being made
if (null != lastTargetNode) {
lastTargetNodeUUID = lastTargetNode.getUUID();
lastTargetNode.getInEdges().remove(edge);
}
if (null != targetNode) {
targetNode.getInEdges().add(edge);
}
edge.setTargetNode(targetNode);
// Magnet being moved on node
ViewConnector connectionContent = (ViewConnector) edge.getContent();
lastConnection = (Connection) connectionContent.getTargetConnection().orElse(null);
connectionContent.setTargetConnection(connection);
}
return results;
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-core-common
@Before
@SuppressWarnings("unchecked")
public void setup() throws Exception {
super.init();
this.parent = mockNode(PARENT_UUID);
this.candidate = mockNode(CANDIDATE_UUID);
this.edge = new EdgeImpl<>(EDGE_UUID);
this.edge.setContent(new Dock());
this.edge.setSourceNode(parent);
this.edge.setTargetNode(candidate);
when(graphIndex.getNode(eq(PARENT_UUID))).thenReturn(parent);
when(graphIndex.getNode(eq(CANDIDATE_UUID))).thenReturn(candidate);
when(graphIndex.getEdge(eq(EDGE_UUID))).thenReturn(edge);
when(parent.getOutEdges()).thenReturn(parentOutEdges);
when(candidate.getInEdges()).thenReturn(candidateInEdges);
parentOutEdges.add(edge);
candidateInEdges.add(edge);
this.tested = new UnDockNodeCommand(PARENT_UUID,
CANDIDATE_UUID);
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-core-common
times(1)).setTargetConnection(any(Connection.class));
verify(edge,
times(1)).setTargetNode(eq(node));
verify(targetInEdges,
times(0)).remove(any(Edge.class));
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-core-common
@Override
@SuppressWarnings("unchecked")
public CommandResult<RuleViolation> execute(final GraphCommandExecutionContext context) {
final CommandResult<RuleViolation> results = allow(context);
if (!results.getType().equals(CommandResult.Type.ERROR)) {
final Node<?, Edge> parent = getParent(context);
final Node<?, Edge> candidate = getCandidate(context);
final String uuid = UUID.uuid();
final Edge<Child, Node> edge = new EdgeImpl<>(uuid);
edge.setContent(new Child());
edge.setSourceNode(parent);
edge.setTargetNode(candidate);
parent.getOutEdges().add(edge);
candidate.getInEdges().add(edge);
getMutableIndex(context).addEdge(edge);
}
return results;
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-core-common
@Override
@SuppressWarnings("unchecked")
public CommandResult<RuleViolation> execute(final GraphCommandExecutionContext context) {
final CommandResult<RuleViolation> results = allow(context);
if (!results.getType().equals(CommandResult.Type.ERROR)) {
final Node<?, Edge> parent = getParent(context);
final Node<?, Edge> candidate = getCandidate(context);
final String uuid = UUID.uuid();
final Edge<Dock, Node> edge = new EdgeImpl<>(uuid);
edge.setContent(new Dock());
edge.setSourceNode(parent);
edge.setTargetNode(candidate);
parent.getOutEdges().add(edge);
candidate.getInEdges().add(edge);
getMutableIndex(context).addEdge(edge);
}
return results;
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-core-common
@Override
@SuppressWarnings("unchecked")
public CommandResult<RuleViolation> execute(final GraphCommandExecutionContext context) {
final CommandResult<RuleViolation> results = allow(context);
if (!results.getType().equals(CommandResult.Type.ERROR)) {
final Node<?, Edge> parent = getParent(context);
final Node<?, Edge> candidate = getCandidate(context);
// TODO: Create a ParentEdgeFactory iface extending EdgeFactory using as content generics type Relationship
final String uuid = UUID.uuid();
final Edge<Parent, Node> edge = new EdgeImpl<>(uuid);
edge.setContent(new Parent());
edge.setSourceNode(parent);
edge.setTargetNode(candidate);
parent.getOutEdges().add(edge);
candidate.getInEdges().add(edge);
getMutableIndex(context).addEdge(edge);
}
return results;
}
代码示例来源:origin: org.kie.workbench/kie-wb-common-dmn-api
node2.getInEdges().add(c1);
c1.setSourceNode(node1);
c1.setTargetNode(node2);
代码示例来源:origin: org.kie.workbench/kie-wb-common-dmn-api
node2.getInEdges().add(existingConnector);
existingConnector.setSourceNode(node1);
existingConnector.setTargetNode(node2);
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-case-mgmt-client
@Before
public void setup() {
super.setup();
this.parent = CommandTestUtils.makeNode("uuid1",
"parent",
10.0,
20.0,
50.0,
50.0);
this.candidate = CommandTestUtils.makeNode("uuid2",
"candidate",
10.0,
20.0,
50.0,
50.0);
this.command = new CaseManagementRemoveChildCommand(parent,
candidate);
final Edge<Child, Node> edge = new EdgeImpl<>("edge1");
edge.setContent(new Child());
edge.setSourceNode(parent);
edge.setTargetNode(candidate);
parent.getOutEdges().add(edge);
candidate.getInEdges().add(edge);
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-case-mgmt-backend
stageInEdge.setTargetNode(stageNode);
stageInEdge.setContent(new Child());
rootNode.getOutEdges().add(stageInEdge);
subcaseInEdge.setTargetNode(subcaseNode);
subcaseInEdge.setContent(new Child());
stageNode.getOutEdges().add(subcaseInEdge);
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-case-mgmt-backend
stageInEdge.setTargetNode(stageNode);
stageInEdge.setContent(new Child());
rootNode.getOutEdges().add(stageInEdge);
subprocessInEdge.setTargetNode(subprocessNode);
subprocessInEdge.setContent(new Child());
stageNode.getOutEdges().add(subprocessInEdge);
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-case-mgmt-backend
stageInEdge.setTargetNode(stageNode);
stageInEdge.setContent(new Child());
rootNode.getOutEdges().add(stageInEdge);
内容来源于网络,如有侵权,请联系作者删除!