Search in sources :

Example 1 with CanvasControlPointDragStartEvent

use of org.kie.workbench.common.stunner.core.client.canvas.event.controlpoint.CanvasControlPointDragStartEvent in project kie-wb-common by kiegroup.

the class ControlPointControlImplTest method setUp.

@Before
public void setUp() {
    super.setUp();
    initialControlPointPosition = new Point2D(0, 0);
    newControlPointPosition = new Point2D(10, 10);
    controlPoint1 = new ControlPointImpl(initialControlPointPosition);
    canvasSelectionEvent = new CanvasSelectionEvent(canvasHandler, EDGE_UUID);
    canvasControlPointDragStartEvent = new CanvasControlPointDragStartEvent(initialControlPointPosition);
    canvasControlPointDragEndEvent = new CanvasControlPointDragEndEvent(newControlPointPosition);
    canvasControlPointDoubleClickEvent = new CanvasControlPointDoubleClickEvent(initialControlPointPosition);
    controlPointControl = spy(new ControlPointControlImpl(canvasCommandFactory));
    when(canvas.getShape(EDGE_UUID)).thenReturn(connectorShape);
    when(graphIndex.get(EDGE_UUID)).thenReturn(edge);
    when(graphIndex.getEdge(EDGE_UUID)).thenReturn(edge);
    when(edge.getContent()).thenReturn(viewConnector);
    when(edge.getUUID()).thenReturn(EDGE_UUID);
    when(connectorShape.getShapeView()).thenReturn(shapeView);
    when(viewConnector.getControlPoints()).thenReturn(Arrays.asList(controlPoint1));
    controlPointControl.enable(canvasHandler);
    controlPointControl.setCommandManagerProvider(() -> commandManager);
    controlPointControl.register(edge);
}
Also used : CanvasSelectionEvent(org.kie.workbench.common.stunner.core.client.canvas.event.selection.CanvasSelectionEvent) Point2D(org.kie.workbench.common.stunner.core.graph.content.view.Point2D) CanvasControlPointDragStartEvent(org.kie.workbench.common.stunner.core.client.canvas.event.controlpoint.CanvasControlPointDragStartEvent) CanvasControlPointDragEndEvent(org.kie.workbench.common.stunner.core.client.canvas.event.controlpoint.CanvasControlPointDragEndEvent) ControlPointImpl(org.kie.workbench.common.stunner.core.graph.content.view.ControlPointImpl) CanvasControlPointDoubleClickEvent(org.kie.workbench.common.stunner.core.client.canvas.event.controlpoint.CanvasControlPointDoubleClickEvent) Before(org.junit.Before)

Aggregations

Before (org.junit.Before)1 CanvasControlPointDoubleClickEvent (org.kie.workbench.common.stunner.core.client.canvas.event.controlpoint.CanvasControlPointDoubleClickEvent)1 CanvasControlPointDragEndEvent (org.kie.workbench.common.stunner.core.client.canvas.event.controlpoint.CanvasControlPointDragEndEvent)1 CanvasControlPointDragStartEvent (org.kie.workbench.common.stunner.core.client.canvas.event.controlpoint.CanvasControlPointDragStartEvent)1 CanvasSelectionEvent (org.kie.workbench.common.stunner.core.client.canvas.event.selection.CanvasSelectionEvent)1 ControlPointImpl (org.kie.workbench.common.stunner.core.graph.content.view.ControlPointImpl)1 Point2D (org.kie.workbench.common.stunner.core.graph.content.view.Point2D)1