use of org.kie.workbench.common.stunner.cm.client.shape.view.StageView 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.view.StageView in project kie-wb-common by kiegroup.
the class CaseManagementShapeViewFactoryTest method testBuildViews.
@Test
public void testBuildViews() {
final NullView nullView = tested.newNullView();
assertNotNull(nullView);
final ActivityView activityView = tested.newActivityView(100, 200);
assertNotNull(nullView);
assertEquals(100, activityView.getWidth(), 0);
assertEquals(200, activityView.getHeight(), 0);
final StageView stageView = tested.newStageView(100, 200, 25);
assertNotNull(stageView);
assertEquals(100, stageView.getWidth(), 0);
assertEquals(200, stageView.getHeight(), 0);
final DiagramView diagramView = tested.newDiagramView(100, 200);
assertNotNull(diagramView);
assertEquals(100, diagramView.getWidth(), 0);
assertEquals(200, diagramView.getHeight(), 0);
}
Aggregations