Search in sources :

Example 1 with NodeGestureChangeHandler

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

the class ViewEventHandlerManager method registerGestureHandler.

protected HandlerRegistration[] registerGestureHandler(final GestureHandler gestureHandler) {
    HandlerRegistration gestureStartReg = node.addNodeGestureStartHandler(new NodeGestureStartHandler() {

        @Override
        public void onNodeGestureStart(final NodeGestureStartEvent event) {
            if (isEnabled()) {
                final GestureEvent event1 = buildGestureEvent(event);
                if (null != event1) {
                    gestureHandler.start(event1);
                }
            }
        }
    });
    HandlerRegistration gestureChangeReg = node.addNodeGestureChangeHandler(new NodeGestureChangeHandler() {

        @Override
        public void onNodeGestureChange(final NodeGestureChangeEvent event) {
            if (isEnabled()) {
                final GestureEvent event1 = buildGestureEvent(event);
                if (null != event1) {
                    gestureHandler.change(event1);
                }
            }
        }
    });
    HandlerRegistration gestureEndReg = node.addNodeGestureEndHandler(new NodeGestureEndHandler() {

        @Override
        public void onNodeGestureEnd(final NodeGestureEndEvent event) {
            if (isEnabled()) {
                final GestureEvent event1 = buildGestureEvent(event);
                if (null != event1) {
                    gestureHandler.end(event1);
                }
            }
        }
    });
    return new HandlerRegistration[] { gestureStartReg, gestureChangeReg, gestureEndReg };
}
Also used : HandlerRegistration(com.google.gwt.event.shared.HandlerRegistration) NodeGestureStartHandler(com.ait.lienzo.client.core.event.NodeGestureStartHandler) NodeGestureEndHandler(com.ait.lienzo.client.core.event.NodeGestureEndHandler) NodeGestureChangeEvent(com.ait.lienzo.client.core.event.NodeGestureChangeEvent) NodeGestureStartEvent(com.ait.lienzo.client.core.event.NodeGestureStartEvent) GestureEvent(org.kie.workbench.common.stunner.core.client.shape.view.event.GestureEvent) AbstractNodeGestureEvent(com.ait.lienzo.client.core.event.AbstractNodeGestureEvent) NodeGestureEndEvent(com.ait.lienzo.client.core.event.NodeGestureEndEvent) NodeGestureChangeHandler(com.ait.lienzo.client.core.event.NodeGestureChangeHandler)

Aggregations

AbstractNodeGestureEvent (com.ait.lienzo.client.core.event.AbstractNodeGestureEvent)1 NodeGestureChangeEvent (com.ait.lienzo.client.core.event.NodeGestureChangeEvent)1 NodeGestureChangeHandler (com.ait.lienzo.client.core.event.NodeGestureChangeHandler)1 NodeGestureEndEvent (com.ait.lienzo.client.core.event.NodeGestureEndEvent)1 NodeGestureEndHandler (com.ait.lienzo.client.core.event.NodeGestureEndHandler)1 NodeGestureStartEvent (com.ait.lienzo.client.core.event.NodeGestureStartEvent)1 NodeGestureStartHandler (com.ait.lienzo.client.core.event.NodeGestureStartHandler)1 HandlerRegistration (com.google.gwt.event.shared.HandlerRegistration)1 GestureEvent (org.kie.workbench.common.stunner.core.client.shape.view.event.GestureEvent)1