Search in sources :

Example 1 with NullShapeDef

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

the class CaseManagementShapeDefFactory method newNullShape.

@SuppressWarnings("unchecked")
private Shape newNullShape(final Object instance, final ShapeDef shapeDef) {
    NullShapeDef nullShapeDef = (NullShapeDef) shapeDef;
    final NullView view = cmShapeViewFactory.newNullView();
    return new NullShape(nullShapeDef, view);
}
Also used : NullShapeDef(org.kie.workbench.common.stunner.cm.client.shape.def.NullShapeDef) NullView(org.kie.workbench.common.stunner.cm.client.shape.view.NullView) NullShape(org.kie.workbench.common.stunner.cm.client.shape.NullShape)

Example 2 with NullShapeDef

use of org.kie.workbench.common.stunner.cm.client.shape.def.NullShapeDef 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);
}
Also used : CaseManagementReusableSubprocessTaskShapeDef(org.kie.workbench.common.stunner.cm.client.shape.def.CaseManagementReusableSubprocessTaskShapeDef) NullShapeDef(org.kie.workbench.common.stunner.cm.client.shape.def.NullShapeDef) NullShape(org.kie.workbench.common.stunner.cm.client.shape.NullShape) Shape(org.kie.workbench.common.stunner.core.client.shape.Shape) CMContainerShape(org.kie.workbench.common.stunner.cm.client.shape.CMContainerShape) ActivityShape(org.kie.workbench.common.stunner.cm.client.shape.ActivityShape) CaseManagementTaskShapeDef(org.kie.workbench.common.stunner.cm.client.shape.def.CaseManagementTaskShapeDef) NullShape(org.kie.workbench.common.stunner.cm.client.shape.NullShape) CaseManagementDiagramShapeDef(org.kie.workbench.common.stunner.cm.client.shape.def.CaseManagementDiagramShapeDef) CMContainerShape(org.kie.workbench.common.stunner.cm.client.shape.CMContainerShape) CaseManagementSubprocessShapeDef(org.kie.workbench.common.stunner.cm.client.shape.def.CaseManagementSubprocessShapeDef) BPMNDefinition(org.kie.workbench.common.stunner.bpmn.definition.BPMNDefinition) ActivityShape(org.kie.workbench.common.stunner.cm.client.shape.ActivityShape) Test(org.junit.Test)

Aggregations

NullShape (org.kie.workbench.common.stunner.cm.client.shape.NullShape)2 NullShapeDef (org.kie.workbench.common.stunner.cm.client.shape.def.NullShapeDef)2 Test (org.junit.Test)1 BPMNDefinition (org.kie.workbench.common.stunner.bpmn.definition.BPMNDefinition)1 ActivityShape (org.kie.workbench.common.stunner.cm.client.shape.ActivityShape)1 CMContainerShape (org.kie.workbench.common.stunner.cm.client.shape.CMContainerShape)1 CaseManagementDiagramShapeDef (org.kie.workbench.common.stunner.cm.client.shape.def.CaseManagementDiagramShapeDef)1 CaseManagementReusableSubprocessTaskShapeDef (org.kie.workbench.common.stunner.cm.client.shape.def.CaseManagementReusableSubprocessTaskShapeDef)1 CaseManagementSubprocessShapeDef (org.kie.workbench.common.stunner.cm.client.shape.def.CaseManagementSubprocessShapeDef)1 CaseManagementTaskShapeDef (org.kie.workbench.common.stunner.cm.client.shape.def.CaseManagementTaskShapeDef)1 NullView (org.kie.workbench.common.stunner.cm.client.shape.view.NullView)1 Shape (org.kie.workbench.common.stunner.core.client.shape.Shape)1