本文整理了Java中org.kie.workbench.common.stunner.core.graph.Graph.removeNode()
方法的一些代码示例,展示了Graph.removeNode()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Graph.removeNode()
方法的具体详情如下:
包路径:org.kie.workbench.common.stunner.core.graph.Graph
类名称:Graph
方法名:removeNode
暂无
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-core-common
@Test
@SuppressWarnings("unchecked")
public void testExecute() {
CommandResult<RuleViolation> result = tested.execute(graphCommandExecutionContext);
assertEquals(CommandResult.Type.INFO,
result.getType());
verify(graph,
times(1)).addNode(eq(node));
verify(graphIndex,
times(1)).addNode(eq(node));
verify(graphIndex,
times(0)).addEdge(any(Edge.class));
verify(graph,
times(0)).removeNode(eq(UUID));
verify(graphIndex,
times(0)).removeNode(eq(node));
verify(graphIndex,
times(0)).removeEdge(any(Edge.class));
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-core-common
@Override
public CommandResult<RuleViolation> execute(final GraphCommandExecutionContext context) {
CommandResult<RuleViolation> results = allow(context);
if (!results.getType().equals(CommandResult.Type.ERROR)) {
LOGGER.log(Level.FINE,
"Executing...");
final org.kie.workbench.common.stunner.core.graph.Graph graph = getGraph(context);
final Node<?, Edge> candidate = getCandidate(context);
this.removed = candidate;
graph.removeNode(candidate.getUUID());
getMutableIndex(context).removeNode(candidate);
LOGGER.log(Level.FINE,
"Node [" + uuid + " removed from strcture and index.");
}
return results;
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-case-mgmt-backend
if (StartNoneEvent.class.isInstance(startNode.getContent().getDefinition())) {
deleteChild(root, startNode);
graph.removeNode(startNode.getUUID());
if (EndNoneEvent.class.isInstance(endNode.getContent().getDefinition())) {
deleteChild(root, endNode);
graph.removeNode(endNode.getUUID());
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-core-common
@Test
@SuppressWarnings("unchecked")
public void testExecute() {
CommandResult<RuleViolation> result = tested.execute(graphCommandExecutionContext);
assertEquals(CommandResult.Type.INFO,
result.getType());
verify(graph,
times(1)).removeNode(eq(UUID));
verify(graphIndex,
times(1)).removeNode(eq(node));
verify(graphIndex,
times(0)).removeEdge(any(Edge.class));
verify(graphIndex,
times(0)).addEdge(any(Edge.class));
verify(graphIndex,
times(0)).addNode(any(Node.class));
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-core-common
@Test
@SuppressWarnings("unchecked")
public void testUndo() {
tested.removed = node;
CommandResult<RuleViolation> result = tested.undo(graphCommandExecutionContext);
assertEquals(CommandResult.Type.INFO,
result.getType());
verify(graph,
times(1)).addNode(any(Node.class));
verify(graphIndex,
times(1)).addNode(any(Node.class));
verify(graph,
times(0)).removeNode(eq(UUID));
verify(graphIndex,
times(0)).removeNode(eq(node));
verify(graphIndex,
times(0)).removeEdge(any(Edge.class));
verify(graphIndex,
times(0)).addEdge(any(Edge.class));
}
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-core-common
@Test
@SuppressWarnings("unchecked")
public void testUndo() {
CommandResult<RuleViolation> result = tested.undo(graphCommandExecutionContext);
assertEquals(CommandResult.Type.INFO,
result.getType());
verify(graph,
times(1)).removeNode(eq(UUID));
verify(graphIndex,
times(1)).removeNode(eq(node));
verify(graphIndex,
times(0)).removeEdge(any(Edge.class));
verify(graph,
times(0)).addNode(eq(node));
verify(graphIndex,
times(0)).addNode(eq(node));
verify(graphIndex,
times(0)).addEdge(any(Edge.class));
}
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-core-common
@Test
@SuppressWarnings("unchecked")
public void testExecuteCheckFailed() {
final RuleViolations FAILED_VIOLATIONS = new DefaultRuleViolations()
.addViolation(new ContainmentRuleViolation(graph.getUUID(),
UUID));
when(ruleManager.evaluate(any(RuleSet.class),
any(RuleEvaluationContext.class))).thenReturn(FAILED_VIOLATIONS);
CommandResult<RuleViolation> result = tested.execute(graphCommandExecutionContext);
assertEquals(CommandResult.Type.ERROR,
result.getType());
verify(graph,
times(0)).addNode(eq(node));
verify(graphIndex,
times(0)).addNode(eq(node));
verify(graphIndex,
times(0)).addEdge(any(Edge.class));
verify(graph,
times(0)).removeNode(eq(UUID));
verify(graphIndex,
times(0)).removeNode(eq(node));
verify(graphIndex,
times(0)).removeEdge(any(Edge.class));
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-core-common
assertNotEquals(a,
b);
b.getGraph().removeNode("Node2");
b.getGraph().addNode(new NodeImpl("Node1"));
assertEquals(a,
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-core-common
assertNotEquals(a.hashCode(),
b.hashCode());
b.getGraph().removeNode("Node2");
b.getGraph().addNode(new NodeImpl("Node1"));
assertEquals(a.hashCode(),
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-project-api
assertNotEquals(a,
b);
b.getGraph().removeNode("Node2");
b.getGraph().addNode(new NodeImpl("Node1"));
assertEquals(a,
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-project-api
assertNotEquals(a.hashCode(),
b.hashCode());
b.getGraph().removeNode("Node2");
b.getGraph().addNode(new NodeImpl("Node1"));
assertEquals(a.hashCode(),
内容来源于网络,如有侵权,请联系作者删除!