Search in sources :

Example 1 with ActivityView

use of org.kie.workbench.common.stunner.cm.client.shape.view.ActivityView 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)

Example 2 with ActivityView

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

the class CaseManagementCanvasHandlerTest method makeShape.

@SuppressWarnings("unchecked")
private ActivityShape makeShape() {
    final CaseManagementTaskShapeDef shapeDef = new CaseManagementTaskShapeDef();
    final ActivityView shapeView = new ActivityView(10.0, 20.0);
    final ActivityShape shape = new ActivityShape(shapeDef, new PictureShapeView(new MultiPath()), shapeView);
    return shape;
}
Also used : MultiPath(com.ait.lienzo.client.core.shape.MultiPath) ActivityView(org.kie.workbench.common.stunner.cm.client.shape.view.ActivityView) CaseManagementTaskShapeDef(org.kie.workbench.common.stunner.cm.client.shape.def.CaseManagementTaskShapeDef) ActivityShape(org.kie.workbench.common.stunner.cm.client.shape.ActivityShape) PictureShapeView(org.kie.workbench.common.stunner.shapes.client.view.PictureShapeView)

Example 3 with ActivityView

use of org.kie.workbench.common.stunner.cm.client.shape.view.ActivityView 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);
}
Also used : DiagramView(org.kie.workbench.common.stunner.cm.client.shape.view.DiagramView) ActivityView(org.kie.workbench.common.stunner.cm.client.shape.view.ActivityView) NullView(org.kie.workbench.common.stunner.cm.client.shape.view.NullView) StageView(org.kie.workbench.common.stunner.cm.client.shape.view.StageView) Test(org.junit.Test)

Aggregations

ActivityView (org.kie.workbench.common.stunner.cm.client.shape.view.ActivityView)3 ActivityShape (org.kie.workbench.common.stunner.cm.client.shape.ActivityShape)2 PictureShapeView (org.kie.workbench.common.stunner.shapes.client.view.PictureShapeView)2 MultiPath (com.ait.lienzo.client.core.shape.MultiPath)1 SafeUri (com.google.gwt.safehtml.shared.SafeUri)1 Test (org.junit.Test)1 BPMNViewDefinition (org.kie.workbench.common.stunner.bpmn.definition.BPMNViewDefinition)1 CaseManagementActivityShapeDef (org.kie.workbench.common.stunner.cm.client.shape.def.CaseManagementActivityShapeDef)1 CaseManagementTaskShapeDef (org.kie.workbench.common.stunner.cm.client.shape.def.CaseManagementTaskShapeDef)1 DiagramView (org.kie.workbench.common.stunner.cm.client.shape.view.DiagramView)1 NullView (org.kie.workbench.common.stunner.cm.client.shape.view.NullView)1 StageView (org.kie.workbench.common.stunner.cm.client.shape.view.StageView)1