use of org.kie.workbench.common.stunner.cm.definition.CaseManagementDiagram in project kie-wb-common by kiegroup.
the class CaseManagementShapeDefFactory method newDiagramShape.
@SuppressWarnings("unchecked")
private Shape newDiagramShape(final Object instance, final ShapeDef shapeDef) {
final CaseManagementDiagram diagram = (CaseManagementDiagram) instance;
final CaseManagementDiagramShapeDef cmShapeDef = (CaseManagementDiagramShapeDef) shapeDef;
final double width = cmShapeDef.getWidth(diagram);
final double height = cmShapeDef.getHeight(diagram);
final DiagramView view = cmShapeViewFactory.newDiagramView(width, height);
return new CMContainerShape(cmShapeDef, view);
}
use of org.kie.workbench.common.stunner.cm.definition.CaseManagementDiagram in project kie-wb-common by kiegroup.
the class CaseManagementUtilsTest method checkGetFirstDiagramNodeWithNonEmptyGraph.
@Test
@SuppressWarnings("unchecked")
public void checkGetFirstDiagramNodeWithNonEmptyGraph() {
final Graph graph = new GraphImpl<>("uuid", new GraphNodeStoreImpl());
final Node node = new NodeImpl<Definition>("node-uuid");
final CaseManagementDiagram content = new CaseManagementDiagram.CaseManagementDiagramBuilder().build();
node.setContent(new DefinitionImpl<>(content));
graph.addNode(node);
final Node<Definition<CaseManagementDiagram>, ?> fNode = CaseManagementUtils.getFirstDiagramNode(graph);
assertNotNull(fNode);
assertEquals("node-uuid", fNode.getUUID());
assertEquals(content, fNode.getContent().getDefinition());
}
Aggregations