Search in sources :

Example 1 with ActivityShape

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

the class CaseManagementCanvasHandlerTest method checkAddShapeRenderableShapes.

@Test
public void checkAddShapeRenderableShapes() {
    final ActivityShape shape = makeShape();
    handler.addShape(shape);
    verify(canvas, times(1)).addShape(eq(shape));
}
Also used : ActivityShape(org.kie.workbench.common.stunner.cm.client.shape.ActivityShape) Test(org.junit.Test)

Example 2 with ActivityShape

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

the class CaseManagementCanvasHandlerTest method checkRemoveChildRenderableShapes.

@Test
@SuppressWarnings("unchecked")
public void checkRemoveChildRenderableShapes() {
    final ActivityShape parentShape = makeShape();
    final ActivityShape childShape = makeShape();
    final Node<View<BPMNViewDefinition>, Edge> parentNode = makeNode("parent", parentShape);
    final Node<View<BPMNViewDefinition>, Edge> childNode = makeNode("child", childShape);
    handler.register(parentShape, parentNode, true);
    handler.register(childShape, childNode, true);
    handler.addChild(parentNode, childNode);
    handler.removeChild(parentNode, childNode);
    verify(canvas, times(1)).deleteChildShape(parentShape, childShape);
    verify(layer, never()).removeShape(childShape);
}
Also used : ActivityShape(org.kie.workbench.common.stunner.cm.client.shape.ActivityShape) PictureShapeView(org.kie.workbench.common.stunner.shapes.client.view.PictureShapeView) ActivityView(org.kie.workbench.common.stunner.cm.client.shape.view.ActivityView) View(org.kie.workbench.common.stunner.core.graph.content.view.View) Edge(org.kie.workbench.common.stunner.core.graph.Edge) Test(org.junit.Test)

Example 3 with ActivityShape

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

the class CaseManagementCanvasHandlerTest method checkRegisterRenderableShapes.

@Test
@SuppressWarnings("unchecked")
public void checkRegisterRenderableShapes() {
    final ActivityShape shape = makeShape();
    final Node<View<BPMNViewDefinition>, Edge> node = makeNode("uuid", shape);
    handler.register(shape, node, true);
    verify(canvas, times(1)).addShape(eq(shape));
    verify(canvas, times(1)).draw();
}
Also used : ActivityShape(org.kie.workbench.common.stunner.cm.client.shape.ActivityShape) PictureShapeView(org.kie.workbench.common.stunner.shapes.client.view.PictureShapeView) ActivityView(org.kie.workbench.common.stunner.cm.client.shape.view.ActivityView) View(org.kie.workbench.common.stunner.core.graph.content.view.View) Edge(org.kie.workbench.common.stunner.core.graph.Edge) Test(org.junit.Test)

Example 4 with ActivityShape

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

the class CaseManagementCanvasHandlerTest method checkDeregisterRenderableShapes.

@Test
public void checkDeregisterRenderableShapes() {
    final ActivityShape shape = makeShape();
    final Node<View<BPMNViewDefinition>, Edge> node = makeNode("uuid", shape);
    handler.deregister(shape, node, true);
    verify(canvas, times(1)).deleteShape(eq(shape));
    verify(canvas, times(1)).draw();
}
Also used : ActivityShape(org.kie.workbench.common.stunner.cm.client.shape.ActivityShape) PictureShapeView(org.kie.workbench.common.stunner.shapes.client.view.PictureShapeView) ActivityView(org.kie.workbench.common.stunner.cm.client.shape.view.ActivityView) View(org.kie.workbench.common.stunner.core.graph.content.view.View) Edge(org.kie.workbench.common.stunner.core.graph.Edge) Test(org.junit.Test)

Example 5 with ActivityShape

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

the class CaseManagementCanvasHandlerTest method checkApplyElementMutationRenderableShapes.

@Test
@SuppressWarnings("unchecked")
public void checkApplyElementMutationRenderableShapes() {
    final ActivityShape shape = spy(makeShape());
    final Node<View<BPMNViewDefinition>, Edge> node = makeNode("uuid", shape);
    final MutationContext mutationContext = mock(MutationContext.class);
    doNothing().when(shape).applyPosition(eq(node), eq(mutationContext));
    doNothing().when(shape).applyProperties(eq(node), eq(mutationContext));
    doNothing().when(shape).applyTitle(anyString(), any(Node.class), eq(mutationContext));
    handler.applyElementMutation(shape, node, true, true, mutationContext);
    verify(shape, times(1)).applyPosition(eq(node), eq(mutationContext));
    verify(shape, times(1)).applyProperties(eq(node), eq(mutationContext));
    verify(canvas, times(1)).draw();
}
Also used : Node(org.kie.workbench.common.stunner.core.graph.Node) ActivityShape(org.kie.workbench.common.stunner.cm.client.shape.ActivityShape) PictureShapeView(org.kie.workbench.common.stunner.shapes.client.view.PictureShapeView) ActivityView(org.kie.workbench.common.stunner.cm.client.shape.view.ActivityView) View(org.kie.workbench.common.stunner.core.graph.content.view.View) Edge(org.kie.workbench.common.stunner.core.graph.Edge) MutationContext(org.kie.workbench.common.stunner.core.client.shape.MutationContext) Test(org.junit.Test)

Aggregations

ActivityShape (org.kie.workbench.common.stunner.cm.client.shape.ActivityShape)12 Test (org.junit.Test)10 ActivityView (org.kie.workbench.common.stunner.cm.client.shape.view.ActivityView)9 PictureShapeView (org.kie.workbench.common.stunner.shapes.client.view.PictureShapeView)9 Edge (org.kie.workbench.common.stunner.core.graph.Edge)7 View (org.kie.workbench.common.stunner.core.graph.content.view.View)7 CaseManagementTaskShapeDef (org.kie.workbench.common.stunner.cm.client.shape.def.CaseManagementTaskShapeDef)2 MutationContext (org.kie.workbench.common.stunner.core.client.shape.MutationContext)2 Node (org.kie.workbench.common.stunner.core.graph.Node)2 MultiPath (com.ait.lienzo.client.core.shape.MultiPath)1 SafeUri (com.google.gwt.safehtml.shared.SafeUri)1 BPMNDefinition (org.kie.workbench.common.stunner.bpmn.definition.BPMNDefinition)1 BPMNViewDefinition (org.kie.workbench.common.stunner.bpmn.definition.BPMNViewDefinition)1 CMContainerShape (org.kie.workbench.common.stunner.cm.client.shape.CMContainerShape)1 NullShape (org.kie.workbench.common.stunner.cm.client.shape.NullShape)1 CaseManagementActivityShapeDef (org.kie.workbench.common.stunner.cm.client.shape.def.CaseManagementActivityShapeDef)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 NullShapeDef (org.kie.workbench.common.stunner.cm.client.shape.def.NullShapeDef)1