本文整理了Java中org.kie.workbench.common.stunner.core.graph.Edge.getUUID()
方法的一些代码示例,展示了Edge.getUUID()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Edge.getUUID()
方法的具体详情如下:
包路径:org.kie.workbench.common.stunner.core.graph.Edge
类名称:Edge
方法名:getUUID
暂无
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-core-common
private void processEdge(final Map<String, Node> nodes,
final Map<String, Edge> edges,
final Edge edge) {
if (!edges.containsKey(edge.getUUID())) {
edges.put(edge.getUUID(),
edge);
}
}
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-core-common
@Override
public MutableIndex<Node, Edge> addEdge(final Edge edge) {
edges.put(edge.getUUID(),
edge);
return this;
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-core-common
@Override
public MutableIndex<Node, Edge> removeEdge(final Edge edge) {
edges.remove(edge.getUUID());
return this;
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-core-common
private void deleteConnector(final Callback callback,
final Edge<? extends View<?>, Node> edge,
final boolean candidate) {
if (!processedConnectors.contains(edge.getUUID())) {
if (candidate) {
callback.deleteCandidateConnector(edge);
} else {
callback.deleteConnector(edge);
}
processedConnectors.add(edge.getUUID());
}
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-client-common
@Override
public void startEdgeTraversal(final Edge<View<?>, Node> edge) {
addShape(edge.getUUID());
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-client-common
private static void validateConnector(Edge edge) {
Objects.requireNonNull(edge, "Edge should not be null");
if (!(edge.getContent() instanceof ViewConnector)) {
throw new IllegalArgumentException("Edge content should be a ViewConnector. Edge UUID: " + edge.getUUID());
}
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-core-common
private boolean doDeleteConnector(final Edge<? extends View<?>, Node> edge) {
if (!isElementExcluded(edge) && !processedConnectors.contains(edge.getUUID())) {
addCommand(new DeleteConnectorCommand(edge));
safeDeleteCallback.ifPresent(c -> c.deleteConnector(edge));
processedConnectors.add(edge.getUUID());
return true;
}
return false;
}
});
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-core-common
public static EmptyConnectionViolation build(final Edge<? extends View<?>, ? extends Node> connector,
final Optional<Node<? extends View<?>, ? extends Edge>> sourceNode,
final Optional<Node<? extends View<?>, ? extends Edge>> targetNode) {
// Violation objects are portable so avoid use of optionals, just null or not null.
final String sourceUUID = sourceNode.map(Element::getUUID).orElse(null);
final String targetUUID = targetNode.map(Element::getUUID).orElse(null);
return (EmptyConnectionViolation) new EmptyConnectionViolation(sourceUUID,
targetUUID)
.setUUID(connector.getUUID());
}
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-bpmn-client
private Node getSourceNode(Diagram diagram, String edgeUuid) {
final Iterator<Node> nodes = diagram.getGraph().nodes().iterator();
Node<?, ? extends Edge> sourceNode;
while (nodes.hasNext()) {
sourceNode = nodes.next();
if (sourceNode.getOutEdges().stream()
.anyMatch(edge -> edge.getUUID().equals(edgeUuid))) {
return sourceNode;
}
}
return null;
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-client-common
private static void appendViewConnectorIds(final Set<String> result,
final Node<?, Edge> node) {
Stream.concat(node.getInEdges().stream(),
node.getOutEdges().stream())
.filter(e -> e.getContent() instanceof ViewConnector)
.forEach(e -> result.add(e.getUUID()));
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-client-common
@Override
public boolean deleteConnector(final Edge<? extends View<?>, Node> connector) {
if (super.deleteConnector(connector)) {
options.getExclusions().add(connector.getUUID());
return true;
}
return false;
}
};
代码示例来源: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
@Override
public void addControlPoints(Edge candidate, ControlPoint... controlPoint) {
selectionEvent.fire(new CanvasSelectionEvent(canvasHandler, candidate.getUUID()));
execute(canvasCommandFactory.addControlPoint(candidate, controlPoint));
}
代码示例来源: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-client-common
private static ConnectorShape getConnectorShape(Edge edge, CanvasHandler canvasHandler) {
validateConnector(edge);
return (ConnectorShape) canvasHandler.getCanvas().getShape(edge.getUUID());
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-client-common
private boolean doDeleteConnector(final Edge<? extends View<?>, Node> connector) {
if (!options.getExclusions().contains(connector.getUUID())) {
getCommand().addCommand(new DeleteCanvasConnectorCommand(connector));
return true;
}
return false;
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-core-common
public static Edge mockEdge(String uuid) {
Edge edge = mock(Edge.class);
when(edge.getUUID()).thenReturn(uuid);
when(edge.asEdge()).thenReturn(edge);
return edge;
}
代码示例来源: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
@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
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());
}
}
内容来源于网络,如有侵权,请联系作者删除!