use of com.google.gwt.event.shared.HandlerRegistration in project kie-wb-common by kiegroup.
the class ViewEventHandlerManager method registerExitHandler.
protected HandlerRegistration[] registerExitHandler(final ViewHandler<ViewEvent> eventHandler) {
return new HandlerRegistration[] { shape.addNodeMouseExitHandler(e -> {
if (isEnabled()) {
final MouseExitEvent event = new MouseExitEvent(e.getX(), e.getY(), e.getMouseEvent().getClientX(), e.getMouseEvent().getClientY());
event.setShiftKeyDown(e.isShiftKeyDown());
event.setAltKeyDown(e.isAltKeyDown());
event.setMetaKeyDown(e.isMetaKeyDown());
eventHandler.handle(event);
}
}) };
}
use of com.google.gwt.event.shared.HandlerRegistration in project kie-wb-common by kiegroup.
the class ViewEventHandlerManager method registerDoubleClickHandler.
protected HandlerRegistration[] registerDoubleClickHandler(final ViewHandler<ViewEvent> eventHandler) {
return new HandlerRegistration[] { node.addNodeMouseDoubleClickHandler(nodeMouseDoubleClickEvent -> {
if (isEnabled()) {
skipClickHandler();
final MouseDoubleClickEvent event = new MouseDoubleClickEvent(nodeMouseDoubleClickEvent.getX(), nodeMouseDoubleClickEvent.getY(), nodeMouseDoubleClickEvent.getMouseEvent().getClientX(), nodeMouseDoubleClickEvent.getMouseEvent().getClientY());
event.setShiftKeyDown(nodeMouseDoubleClickEvent.isShiftKeyDown());
event.setAltKeyDown(nodeMouseDoubleClickEvent.isAltKeyDown());
event.setMetaKeyDown(nodeMouseDoubleClickEvent.isMetaKeyDown());
event.setButtonLeft(nodeMouseDoubleClickEvent.isButtonLeft());
event.setButtonMiddle(nodeMouseDoubleClickEvent.isButtonMiddle());
event.setButtonRight(nodeMouseDoubleClickEvent.isButtonRight());
eventHandler.handle(event);
restoreClickHandler();
}
}) };
}
use of com.google.gwt.event.shared.HandlerRegistration 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 };
}
use of com.google.gwt.event.shared.HandlerRegistration in project kie-wb-common by kiegroup.
the class ViewEventHandlerManager method registerEnterHandler.
protected HandlerRegistration[] registerEnterHandler(final ViewHandler<ViewEvent> eventHandler) {
return new HandlerRegistration[] { shape.addNodeMouseEnterHandler(e -> {
if (isEnabled()) {
final MouseEnterEvent event = new MouseEnterEvent(e.getX(), e.getY(), e.getMouseEvent().getClientX(), e.getMouseEvent().getClientY());
event.setShiftKeyDown(e.isShiftKeyDown());
event.setAltKeyDown(e.isAltKeyDown());
event.setMetaKeyDown(e.isMetaKeyDown());
eventHandler.handle(event);
}
}) };
}
use of com.google.gwt.event.shared.HandlerRegistration in project kie-wb-common by kiegroup.
the class WiresShapeViewExt method registerDragHandler.
private HandlerRegistration[] registerDragHandler(final ViewHandler<DragEvent> eventHandler) {
if (!getAttachableShape().isDraggable()) {
final DragHandler dragHandler = (DragHandler) eventHandler;
setDragEnabled(true);
HandlerRegistration dragStartReg = addWiresDragStartHandler(wiresDragStartEvent -> {
final DragEvent e = buildDragEvent(wiresDragStartEvent);
dragHandler.start(e);
});
HandlerRegistration dragMoveReg = addWiresDragMoveHandler(wiresDragMoveEvent -> {
final DragEvent e = buildDragEvent(wiresDragMoveEvent);
dragHandler.handle(e);
});
HandlerRegistration dragEndReg = addWiresDragEndHandler(wiresDragEndEvent -> {
final DragEvent e = buildDragEvent(wiresDragEndEvent);
dragHandler.end(e);
});
return new HandlerRegistration[] { dragStartReg, dragMoveReg, dragEndReg };
}
return null;
}
Aggregations