Search in sources :

Example 1 with WiresShapeDragProxy

use of org.kie.workbench.common.stunner.lienzo.primitive.WiresShapeDragProxy in project kie-wb-common by kiegroup.

the class ShapeViewDragProxyImpl method show.

@Override
public DragProxy<AbstractCanvas, ShapeView<?>, DragProxyCallback> show(final ShapeView<?> item, final int x, final int y, final DragProxyCallback callback) {
    final AbstractDragProxy.Callback c = new AbstractDragProxy.Callback() {

        @Override
        public void onStart(final int x, final int y) {
            callback.onStart(x, y);
        }

        @Override
        public void onMove(final int x, final int y) {
            callback.onMove(x, y);
        }

        @Override
        public void onComplete(final int x, final int y) {
            callback.onComplete(x, y);
        }
    };
    if (item instanceof WiresShape) {
        final WiresShape wiresShape = (WiresShape) item;
        this.proxy = new WiresShapeDragProxy(getLayer().getLienzoLayer(), wiresShape, x, y, 100, c);
    } else if (item instanceof WiresConnector) {
        final WiresConnector wiresConnector = (WiresConnector) item;
        this.proxy = new WiresConnectorDragProxy(getLayer().getLienzoLayer(), wiresConnector, x, y, 100, c);
    }
    return this;
}
Also used : AbstractDragProxy(org.kie.workbench.common.stunner.lienzo.primitive.AbstractDragProxy) WiresShape(com.ait.lienzo.client.core.shape.wires.WiresShape) WiresConnector(com.ait.lienzo.client.core.shape.wires.WiresConnector) DragProxyCallback(org.kie.workbench.common.stunner.core.client.components.drag.DragProxyCallback) WiresConnectorDragProxy(org.kie.workbench.common.stunner.lienzo.primitive.WiresConnectorDragProxy) WiresShapeDragProxy(org.kie.workbench.common.stunner.lienzo.primitive.WiresShapeDragProxy)

Aggregations

WiresConnector (com.ait.lienzo.client.core.shape.wires.WiresConnector)1 WiresShape (com.ait.lienzo.client.core.shape.wires.WiresShape)1 DragProxyCallback (org.kie.workbench.common.stunner.core.client.components.drag.DragProxyCallback)1 AbstractDragProxy (org.kie.workbench.common.stunner.lienzo.primitive.AbstractDragProxy)1 WiresConnectorDragProxy (org.kie.workbench.common.stunner.lienzo.primitive.WiresConnectorDragProxy)1 WiresShapeDragProxy (org.kie.workbench.common.stunner.lienzo.primitive.WiresShapeDragProxy)1