Search in sources :

Example 1 with AbstractWiresDragEvent

use of com.ait.lienzo.client.core.shape.wires.event.AbstractWiresDragEvent in project kie-wb-common by kiegroup.

the class WiresShapeViewExt method buildDragEvent.

protected DragEvent buildDragEvent(final AbstractWiresDragEvent sourceDragEvent) {
    final double x = sourceDragEvent.getX();
    final double y = sourceDragEvent.getY();
    final double cx = sourceDragEvent.getNodeDragEvent().getX();
    final double cy = sourceDragEvent.getNodeDragEvent().getY();
    final int dx = sourceDragEvent.getNodeDragEvent().getDragContext().getDx();
    final int dy = sourceDragEvent.getNodeDragEvent().getDragContext().getDy();
    final DragContext dragContext = new DragContext(dx, dy, () -> sourceDragEvent.getNodeDragEvent().getDragContext().reset());
    return new DragEvent(x, y, cx, cy, dragContext);
}
Also used : DragEvent(org.kie.workbench.common.stunner.core.client.shape.view.event.DragEvent) AbstractWiresDragEvent(com.ait.lienzo.client.core.shape.wires.event.AbstractWiresDragEvent) DragContext(org.kie.workbench.common.stunner.core.client.shape.view.event.DragContext)

Aggregations

AbstractWiresDragEvent (com.ait.lienzo.client.core.shape.wires.event.AbstractWiresDragEvent)1 DragContext (org.kie.workbench.common.stunner.core.client.shape.view.event.DragContext)1 DragEvent (org.kie.workbench.common.stunner.core.client.shape.view.event.DragEvent)1