本文整理了Java中org.kie.workbench.common.stunner.core.graph.Graph.addNode()
方法的一些代码示例,展示了Graph.addNode()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Graph.addNode()
方法的具体详情如下:
包路径:org.kie.workbench.common.stunner.core.graph.Graph
类名称:Graph
方法名:addNode
暂无
代码示例来源: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
@SuppressWarnings("unchecked")
public CommandResult<RuleViolation> execute(final GraphCommandExecutionContext context) {
final CommandResult<RuleViolation> results = allow(context);
if (!results.getType().equals(CommandResult.Type.ERROR)) {
final Graph graph = getGraph(context);
graph.addNode(candidate);
getMutableIndex(context).addNode(candidate);
}
return results;
}
代码示例来源: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 testExecute() {
CommandResult<RuleViolation> result = tested.execute(graphCommandExecutionContext);
assertEquals(CommandResult.Type.INFO,
result.getType());
assertTrue(parentInEdges.isEmpty());
assertTrue(candidateOutEdges.isEmpty());
verify(graphIndex,
times(1)).removeEdge(any(Edge.class));
verify(graphIndex,
times(0)).removeNode(any(Node.class));
verify(graph,
times(0)).addNode(any(Node.class));
verify(graphIndex,
times(0)).addNode(any(Node.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 testExecute() {
CommandResult<RuleViolation> result = tested.execute(graphCommandExecutionContext);
assertEquals(CommandResult.Type.INFO,
result.getType());
assertTrue(parentOutEdges.isEmpty());
assertTrue(candidateInEdges.isEmpty());
verify(graphIndex,
times(1)).removeEdge(eq(edge));
verify(graphIndex,
times(0)).removeNode(any(Node.class));
verify(graph,
times(0)).addNode(any(Node.class));
verify(graphIndex,
times(0)).addNode(any(Node.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() {
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 testExecute() {
CommandResult<RuleViolation> result = tested.execute(graphCommandExecutionContext);
assertEquals(CommandResult.Type.INFO,
result.getType());
assertTrue(parentOutEdges.isEmpty());
assertTrue(candidateInEdges.isEmpty());
verify(graphIndex,
times(1)).removeEdge(any(Edge.class));
verify(graphIndex,
times(0)).removeNode(any(Node.class));
verify(graph,
times(0)).addNode(any(Node.class));
verify(graphIndex,
times(0)).addNode(any(Node.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 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-case-mgmt-backend
diagram.getGraph().addNode(startNoneEvent);
createChild(UUID.uuid(), rootNode, startNoneEvent, 0);
diagram.getGraph().addNode(endNoneEvent);
createChild(UUID.uuid(), rootNode, endNoneEvent, -1);
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-bpmn-backend
public Graph<DefinitionSet, Node> createGraph() {
Graph<DefinitionSet, Node> graph = (Graph<DefinitionSet, Node>) factoryManager.newElement(UUID.uuid(),
diagramDefinitionSetClass);
builderContext
// Initialize the builder context.
.init(graph)
// Clears the nodes present, if any, on the recently new graph instance for BPMN. This generator
// provides the adf for the complete graph structure and nodes.
.execute(builderContext.getCommandFactory().clearGraph());
NodeObjectBuilder diagramBuilder = getDiagramBuilder(builderContext);
if (diagramBuilder == null) {
throw new RuntimeException("No diagrams found!");
}
Node<View<BPMNDefinition>, Edge> diagramNode = (Node<View<BPMNDefinition>, Edge>) diagramBuilder.build(builderContext);
graph.addNode(diagramNode);
logBuilders();
return graph;
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-case-mgmt-client
graph.addNode(root);
graph.addNode(parent1);
graph.addNode(parent2);
graph.addNode(parent3);
graph.addNode(child1);
graph.addNode(child2);
graph.addNode(child3);
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-core-common
b);
a.getGraph().addNode(new NodeImpl("Node1"));
b.getGraph().addNode(new NodeImpl("Node2"));
assertNotEquals(a,
b);
b.getGraph().removeNode("Node2");
b.getGraph().addNode(new NodeImpl("Node1"));
assertEquals(a,
b);
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-case-mgmt-backend
graph.getLabels().add("org.kie.workbench.common.stunner.cm.CaseManagementDefinitionSet");
graph.setContent(definitionSet);
graph.addNode(rootNode);
graph.addNode(stageNode);
graph.addNode(subcaseNode);
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-case-mgmt-backend
graph.getLabels().add("org.kie.workbench.common.stunner.cm.CaseManagementDefinitionSet");
graph.setContent(definitionSet);
graph.addNode(rootNode);
graph.addNode(stageNode);
graph.addNode(subprocessNode);
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-core-common
b.hashCode());
a.getGraph().addNode(new NodeImpl("Node1"));
b.getGraph().addNode(new NodeImpl("Node2"));
assertNotEquals(a.hashCode(),
b.hashCode());
b.getGraph().removeNode("Node2");
b.getGraph().addNode(new NodeImpl("Node1"));
assertEquals(a.hashCode(),
b.hashCode());
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-case-mgmt-backend
graph.getLabels().add("org.kie.workbench.common.stunner.cm.CaseManagementDefinitionSet");
graph.setContent(definitionSet);
graph.addNode(rootNode);
graph.addNode(stageNode);
graph.addNode(taskNode);
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-case-mgmt-backend
graph.getLabels().add("org.kie.workbench.common.stunner.cm.CaseManagementDefinitionSet");
graph.setContent(definitionSet);
graph.addNode(rootNode);
graph.addNode(stageNode);
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-project-api
b);
a.getGraph().addNode(new NodeImpl("Node1"));
b.getGraph().addNode(new NodeImpl("Node2"));
assertNotEquals(a,
b);
b.getGraph().removeNode("Node2");
b.getGraph().addNode(new NodeImpl("Node1"));
assertEquals(a,
b);
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-project-api
b.hashCode());
a.getGraph().addNode(new NodeImpl("Node1"));
b.getGraph().addNode(new NodeImpl("Node2"));
assertNotEquals(a.hashCode(),
b.hashCode());
b.getGraph().removeNode("Node2");
b.getGraph().addNode(new NodeImpl("Node1"));
assertEquals(a.hashCode(),
b.hashCode());
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-case-mgmt-backend
graph.getLabels().add("org.kie.workbench.common.stunner.cm.CaseManagementDefinitionSet");
graph.setContent(definitionSet);
graph.addNode(rootNode);
内容来源于网络,如有侵权,请联系作者删除!