本文整理了Java中org.kie.workbench.common.stunner.core.graph.Graph.getNode()
方法的一些代码示例,展示了Graph.getNode()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Graph.getNode()
方法的具体详情如下:
包路径:org.kie.workbench.common.stunner.core.graph.Graph
类名称:Graph
方法名:getNode
暂无
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-bpmn-client
protected void onFormFieldChanged(@Observes FormFieldChanged formFieldChanged) {
Optional.ofNullable(isSelected)
.map(Supplier::get)
.filter(Boolean.TRUE::equals)
.map(focus -> getDiagram()
.map(d -> d.getGraph().getNode(formFieldChanged.getUuid()))
).ifPresent(focus -> refresh());
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-client-common
public static Node getSelectedNode(Diagram diagram, ClientSession clientSession) {
String uuid = getSelectedElementUUID(clientSession);
return uuid != null ? diagram.getGraph().getNode(uuid) : null;
}
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-bpmn-backend
private Node<? extends Definition, ?> getNodebyId(Diagram<Graph, Metadata> diagram, String id) {
Node<? extends Definition, ?> node = diagram.getGraph().getNode(id);
assertThat(node).isNotNull();
return node;
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-core-common
@Before
public void setup() throws Exception {
super.init();
when(node.getUUID()).thenReturn(UUID);
when(graph.getNode(eq(UUID))).thenReturn(node);
when(graphIndex.getNode(eq(UUID))).thenReturn(node);
this.tested = new AddNodeCommand(node);
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-bpmn-backend
@SuppressWarnings("unchecked")
T getGatewayNodeById(Diagram<Graph, Metadata> diagram, String id, Class<T> type) {
Node<? extends Definition, ?> node = diagram.getGraph().getNode(id);
assertThat(node).isNotNull();
return type.cast(node.getContent().getDefinition());
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-core-common
@Before
public void setup() throws Exception {
super.init();
node = mockNode(UUID);
graphNodes.add(node);
when(graph.getNode(eq(UUID))).thenReturn(node);
when(graphIndex.getNode(eq(UUID))).thenReturn(node);
this.tested = new DeleteNodeCommand(UUID);
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-bpmn-client
protected Node getSelectedElement() {
String elementUUID = getSelectedElementUUID(sessionManager.getCurrentSession());
if (elementUUID != null) {
return sessionManager.getCurrentSession().getCanvasHandler().getDiagram().getGraph().getNode(elementUUID);
}
return null;
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-bpmn-client
protected Node getSelectedElement() {
String elementUUID = getSelectedElementUUID(canvasSessionManager.getCurrentSession());
if (elementUUID != null) {
return canvasSessionManager.getCurrentSession().getCanvasHandler().getDiagram().getGraph().getNode(elementUUID);
}
return null;
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-backend-common
private String getDiagramSvgFileName(Diagram diagram) {
final Object metaProperty = definitionManager.adapters()
.forDefinition()
.getMetaProperty(PropertyMetaTypes.ID,
((Definition) diagram.getGraph()
.getNode(diagram.getMetadata().getCanvasRootUUID())
.getContent()).getDefinition());
final Object diagramFileId = definitionManager.adapters().forProperty().getValue(metaProperty);
return String.valueOf(diagramFileId).concat(SVG_SUFFIX);
}
代码示例来源:origin: org.kie.workbench/kie-wb-common-dmn-client
@SuppressWarnings("unused")
void onNestedElementAdded(final @Observes ExpressionEditorChanged event) {
final Node node = presenter.getGraph().getNode(getActiveParent().getUUID());
presenter.updateElement(node);
getActiveParent().getChildren().forEach(e -> getTreePresenter().selectItem(e.getUUID()));
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-bpmn-backend
@SuppressWarnings("unchecked")
T getStartNodeById(Diagram<Graph, Metadata> diagram, String id, Class<T> type) {
Node<? extends Definition, ?> node = diagram.getGraph().getNode(id);
assertNotNull(node);
assertEquals(1, node.getOutEdges().size());
return type.cast(node.getContent().getDefinition());
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-bpmn-backend
@SuppressWarnings("unchecked")
T getTaskNodeById(Diagram<Graph, Metadata> diagram, String id, int amountOfIncomeEdges, boolean hasOutcomeEdge) {
Node<? extends Definition, ?> node = diagram.getGraph().getNode(id);
assertNotNull(node);
assertEquals(amountOfIncomeEdges + 1, node.getInEdges().size());
int outcomeEdges = hasOutcomeEdge ? 1 : 0;
assertEquals(outcomeEdges, node.getOutEdges().size());
return getTaskType().cast(node.getContent().getDefinition());
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-bpmn-backend
@SuppressWarnings("unchecked")
T getEndNodeById(Diagram<Graph, Metadata> diagram, String id, boolean hasIncomeEdge) {
Node<? extends Definition, ?> node = diagram.getGraph().getNode(id);
assertNotNull(node);
int incomeEdges = hasIncomeEdge ? 2 : 1;
assertEquals(incomeEdges, node.getInEdges().size());
assertEquals(0, node.getOutEdges().size());
return getEndEventType().cast(node.getContent().getDefinition());
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-bpmn-backend
@SuppressWarnings("unchecked")
T getCatchingIntermediateNodeById(Diagram<Graph, Metadata> diagram, String id, boolean hasIncomeEdge, boolean hasOutgoingEdge) {
Node<? extends Definition, ?> node = diagram.getGraph().getNode(id);
assertNotNull(node);
int incomeEdges = hasIncomeEdge ? getDefaultAmountOfIncomdeEdges() + 1 : getDefaultAmountOfIncomdeEdges();
assertEquals(incomeEdges, node.getInEdges().size());
int outgoingEdges = hasOutgoingEdge ? 1 : 0;
assertEquals(outgoingEdges, node.getOutEdges().size());
return getCatchingIntermediateEventType().cast(node.getContent().getDefinition());
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-bpmn-backend
@Test
public void parseAssociations() throws Exception {
Diagram<Graph, Metadata> d = unmarshall(newMarshaller, BPMN_FILE_PATH);
Node<View<UserTask>, ?> node = d.getGraph().getNode(TASK_ID);
UserTask definition = node.getContent().getDefinition();
AssignmentsInfo assignmentsinfo = definition.getExecutionSet().getAssignmentsinfo();
assertEquals("|Body:String,From:String,Subject:String,To:String||CUSTOM:String,CUSTOM2:String|[din]Body=HELLO,[din]myprocvar->From,[dout]CUSTOM->myprocvar",
assignmentsinfo.getValue());
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-bpmn-backend
@Test
public void RHBA607() throws Exception {
final String BPMN_USER_TASK_PROPERTIES_FILE_PATH =
"org/kie/workbench/common/stunner/bpmn/backend/service/diagram/userTaskProperties.bpmn";
final String DIAGRAM_ID = "_pfJ-8O50EeiVSc03Fghuww";
Diagram<Graph, Metadata> d = unmarshall(newMarshaller, BPMN_USER_TASK_PROPERTIES_FILE_PATH);
Node<View<BPMNDiagramImpl>, ?> node = d.getGraph().getNode(DIAGRAM_ID);
ProcessData processData = node.getContent().getDefinition().getProcessData();
ProcessVariables processVariables = processData.getProcessVariables();
DeclarationList declarationList = DeclarationList.fromString(processVariables.getValue());
assertTrue(declarationList.getDeclarations().isEmpty());
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-bpmn-backend
@Test
@SuppressWarnings("unchecked")
public void testUnmarshallBasic() throws Exception {
Diagram<Graph, Metadata> diagram = unmarshall(BPMN_BASIC);
assertDiagram(diagram,
4);
assertEquals("Basic process",
diagram.getMetadata().getTitle());
Node<? extends Definition, ?> task1 = diagram.getGraph().getNode("810797AB-7D09-4E1F-8A5B-96C424E4B031");
assertTrue(task1.getContent().getDefinition() instanceof NoneTask);
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-bpmn-backend
@Test
@SuppressWarnings("unchecked")
public void testUnmarshallBasic() throws Exception {
Diagram<Graph, Metadata> diagram = unmarshall(BPMN_BASIC);
assertDiagram(diagram,
4);
assertEquals("Basic process",
diagram.getMetadata().getTitle());
Node<? extends Definition, ?> task1 = diagram.getGraph().getNode("810797AB-7D09-4E1F-8A5B-96C424E4B031");
assertTrue(task1.getContent().getDefinition() instanceof NoneTask);
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-bpmn-backend
@Test
public void testBasicUnmarshall() throws Exception {
Diagram<Graph, Metadata> d = unmarshall(newMarshaller, BPMN_SERVICE_TASK_PROPERTIES_FILE_PATH);
Node<View<ServiceTask>, ?> node = d.getGraph().getNode(SERVICE_TASK_ID);
ServiceTask definition = node.getContent().getDefinition();
assertEquals("Custom Email", definition.getGeneral().getName().getValue());
assertEquals("This is an email task", definition.getGeneral().getDocumentation().getValue());
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-bpmn-backend
@Test
public void testBasicBidi() throws Exception {
Diagram<Graph, Metadata> d = unmarshall(newMarshaller, BPMN_SERVICE_TASK_PROPERTIES_FILE_PATH);
String marshall = newMarshaller.marshall(d);
Diagram<Graph, Metadata> d2 = Unmarshalling.unmarshall(newMarshaller, new StringInputStream(marshall));
Node<View<ServiceTask>, ?> node = d2.getGraph().getNode(SERVICE_TASK_ID);
ServiceTask definition = node.getContent().getDefinition();
assertEquals("Custom Email", definition.getGeneral().getName().getValue());
assertEquals("This is an email task", definition.getGeneral().getDocumentation().getValue());
}
}
内容来源于网络,如有侵权,请联系作者删除!