Search in sources :

Example 1 with CaseManagementActivityShapeDef

use of org.kie.workbench.common.stunner.cm.client.shape.def.CaseManagementActivityShapeDef in project kie-wb-common by kiegroup.

the class CaseManagementShapeDefFactory method newActivityShape.

@SuppressWarnings("unchecked")
private Shape newActivityShape(final Object instance, final ShapeDef shapeDef) {
    final BPMNViewDefinition bpmnDefinition = (BPMNViewDefinition) instance;
    final CaseManagementActivityShapeDef cmShapeDef = (CaseManagementActivityShapeDef) shapeDef;
    final double width = cmShapeDef.getWidth(bpmnDefinition);
    final double height = cmShapeDef.getHeight(bpmnDefinition);
    final ActivityView view = cmShapeViewFactory.newActivityView(width, height);
    final SafeUri iconUri = cmShapeDef.getIconUri(instance.getClass());
    final PictureShapeView iconView = basicShapeViewFactory.pictureFromUri(iconUri, 15d, 15d);
    return new ActivityShape(cmShapeDef, iconView, view);
}
Also used : CaseManagementActivityShapeDef(org.kie.workbench.common.stunner.cm.client.shape.def.CaseManagementActivityShapeDef) ActivityView(org.kie.workbench.common.stunner.cm.client.shape.view.ActivityView) SafeUri(com.google.gwt.safehtml.shared.SafeUri) BPMNViewDefinition(org.kie.workbench.common.stunner.bpmn.definition.BPMNViewDefinition) ActivityShape(org.kie.workbench.common.stunner.cm.client.shape.ActivityShape) PictureShapeView(org.kie.workbench.common.stunner.shapes.client.view.PictureShapeView)

Aggregations

SafeUri (com.google.gwt.safehtml.shared.SafeUri)1 BPMNViewDefinition (org.kie.workbench.common.stunner.bpmn.definition.BPMNViewDefinition)1 ActivityShape (org.kie.workbench.common.stunner.cm.client.shape.ActivityShape)1 CaseManagementActivityShapeDef (org.kie.workbench.common.stunner.cm.client.shape.def.CaseManagementActivityShapeDef)1 ActivityView (org.kie.workbench.common.stunner.cm.client.shape.view.ActivityView)1 PictureShapeView (org.kie.workbench.common.stunner.shapes.client.view.PictureShapeView)1