use of org.kie.workbench.common.stunner.cm.client.shape.CMContainerShape 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.CMContainerShape in project kie-wb-common by kiegroup.
the class CaseManagementShapeDefFactory method newStageShape.
@SuppressWarnings("unchecked")
private Shape newStageShape(final Object instance, final ShapeDef shapeDef) {
final BPMNViewDefinition bpmnDefinition = (BPMNViewDefinition) instance;
final StageShapeDef cmShapeDef = (StageShapeDef) shapeDef;
final double width = cmShapeDef.getWidth(bpmnDefinition);
final double height = cmShapeDef.getHeight(bpmnDefinition);
final double dropWidth = cmShapeDef.getDropAreaWidth(bpmnDefinition);
final double dropHeight = cmShapeDef.getDropAreaHeight(bpmnDefinition);
final double voffset = cmShapeDef.getVOffset(bpmnDefinition);
final StageView view = cmShapeViewFactory.newStageView(dropWidth, dropHeight, voffset).setWidth(width).setHeight(height);
return new CMContainerShape(cmShapeDef, view);
}
use of org.kie.workbench.common.stunner.cm.client.shape.CMContainerShape 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