Search in sources :

Example 1 with CanvasControlPointDoubleClickEvent

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

the class StunnerWiresControlPointHandler method onNodeMouseDoubleClick.

@Override
public void onNodeMouseDoubleClick(NodeMouseDoubleClickEvent event) {
    IPrimitive<?> node = (IPrimitive<?>) event.getSource();
    controlPointDoubleClickEvent.fire(new CanvasControlPointDoubleClickEvent(getPosition(node.getLocation().getX(), node.getLocation().getY())));
}
Also used : IPrimitive(com.ait.lienzo.client.core.shape.IPrimitive) CanvasControlPointDoubleClickEvent(org.kie.workbench.common.stunner.core.client.canvas.event.controlpoint.CanvasControlPointDoubleClickEvent)

Example 2 with CanvasControlPointDoubleClickEvent

use of org.kie.workbench.common.stunner.core.client.canvas.event.controlpoint.CanvasControlPointDoubleClickEvent 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

CanvasControlPointDoubleClickEvent (org.kie.workbench.common.stunner.core.client.canvas.event.controlpoint.CanvasControlPointDoubleClickEvent)2 IPrimitive (com.ait.lienzo.client.core.shape.IPrimitive)1 Before (org.junit.Before)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