use of org.kie.workbench.common.stunner.cm.client.shape.def.CaseManagementDiagramShapeDef 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.client.shape.def.CaseManagementDiagramShapeDef in project kie-wb-common by kiegroup.
the class CaseManagementShapeDefFactoryTest method testBuilders.
@Test
public void testBuilders() {
final Shape nullShape = tested.newShape(mock(BPMNDefinition.class), new NullShapeDef());
assertNotNull(nullShape);
assertTrue(nullShape instanceof NullShape);
final Shape diagramShape = tested.newShape(new CaseManagementDiagram.CaseManagementDiagramBuilder().build(), new CaseManagementDiagramShapeDef());
assertNotNull(diagramShape);
assertTrue(diagramShape instanceof CMContainerShape);
final Shape subprocessShape = tested.newShape(new AdHocSubprocess.AdHocSubprocessBuilder().build(), new CaseManagementSubprocessShapeDef());
assertNotNull(subprocessShape);
assertTrue(subprocessShape instanceof CMContainerShape);
final Shape activityShape = tested.newShape(new UserTask.UserTaskBuilder().build(), new CaseManagementTaskShapeDef());
assertNotNull(activityShape);
assertTrue(activityShape instanceof ActivityShape);
final Shape activityShape2 = tested.newShape(new ReusableSubprocess.ReusableSubprocessBuilder().build(), new CaseManagementReusableSubprocessTaskShapeDef());
assertNotNull(activityShape2);
assertTrue(activityShape2 instanceof ActivityShape);
}
Aggregations