@Test public void testAddDividerDragHandler() { view.addDividerDragHandler(dragHandler); final HandlerManager handlerManager = view.getHandlerManager(); assertThat(handlerManager.isEventHandled(MoveDividerStartEvent.TYPE)).isTrue(); assertThat(handlerManager.isEventHandled(MoveDividerStepEvent.TYPE)).isTrue(); assertThat(handlerManager.isEventHandled(MoveDividerEndEvent.TYPE)).isTrue(); assertThat(handlerManager.getHandlerCount(MoveDividerStartEvent.TYPE)).isEqualTo(1); assertThat(handlerManager.getHandlerCount(MoveDividerStepEvent.TYPE)).isEqualTo(1); assertThat(handlerManager.getHandlerCount(MoveDividerEndEvent.TYPE)).isEqualTo(1); handlerManager.getHandler(MoveDividerStartEvent.TYPE, 0).onMoveDividerStart(new MoveDividerStartEvent(view, nodeDragStartEvent)); verify(dragHandler).start(any(DragEvent.class)); handlerManager.getHandler(MoveDividerStepEvent.TYPE, 0).onMoveDividerStep(new MoveDividerStepEvent(view, nodeDragMoveEvent)); verify(dragHandler).handle(any(DragEvent.class)); handlerManager.getHandler(MoveDividerEndEvent.TYPE, 0).onMoveDividerEnd(new MoveDividerEndEvent(view, nodeDragEndEvent)); verify(dragHandler).end(any(DragEvent.class)); }
public DecisionServiceSVGShapeView addDividerDragHandler(final DragHandler dragHandler) { final HandlerManager handlerManager = getHandlerManager(); final HandlerRegistration dragStartRegistration = handlerManager.addHandler(MoveDividerStartEvent.TYPE, event -> dragHandler.start(buildDragEvent(event))); final HandlerRegistration dragStepRegistration = handlerManager.addHandler(MoveDividerStepEvent.TYPE, event -> dragHandler.handle(buildDragEvent(event))); final HandlerRegistration dragEndRegistration = handlerManager.addHandler(MoveDividerEndEvent.TYPE, event -> dragHandler.end(buildDragEvent(event))); final HandlerRegistration[] registrations = new HandlerRegistration[]{dragStartRegistration, dragStepRegistration, dragEndRegistration}; getEventHandlerManager().addHandlersRegistration(ViewEventType.DRAG, registrations); return this; }
DecisionServiceSVGShapeView extends SVGShapeViewImpl { public DecisionServiceSVGShapeView addDividerDragHandler(final DragHandler dragHandler) { final HandlerManager handlerManager = getHandlerManager(); final HandlerRegistration dragStartRegistration = handlerManager.addHandler(MoveDividerStartEvent.TYPE, event -> dragHandler.start(buildDragEvent(event))); final HandlerRegistration dragStepRegistration = handlerManager.addHandler(MoveDividerStepEvent.TYPE, event -> dragHandler.handle(buildDragEvent(event))); final HandlerRegistration dragEndRegistration = handlerManager.addHandler(MoveDividerEndEvent.TYPE, event -> dragHandler.end(buildDragEvent(event))); final HandlerRegistration[] registrations = new HandlerRegistration[]{dragStartRegistration, dragStepRegistration, dragEndRegistration}; getEventHandlerManager().addHandlersRegistration(ViewEventType.DRAG, registrations); return this; } }
DecisionServiceSVGShapeView extends SVGShapeViewImpl { public DecisionServiceSVGShapeView addDividerDragHandler(final DragHandler dragHandler) { final HandlerManager handlerManager = getHandlerManager(); final HandlerRegistration dragStartRegistration = handlerManager.addHandler(MoveDividerStartEvent.TYPE, event -> dragHandler.start(buildDragEvent(event))); final HandlerRegistration dragStepRegistration = handlerManager.addHandler(MoveDividerStepEvent.TYPE, event -> dragHandler.handle(buildDragEvent(event))); final HandlerRegistration dragEndRegistration = handlerManager.addHandler(MoveDividerEndEvent.TYPE, event -> dragHandler.end(buildDragEvent(event))); final HandlerRegistration[] registrations = new HandlerRegistration[]{dragStartRegistration, dragStepRegistration, dragEndRegistration}; getEventHandlerManager().addHandlersRegistration(ViewEventType.DRAG, registrations); return this; } DecisionServiceSVGShapeView(final String name,
                                       final SVGPrimitiveShape svgPrimitive,
                                       final double width,
                                       final double height,
                                       final boolean resizable); }
DecisionServiceSVGShapeView extends SVGShapeViewImpl { public DecisionServiceSVGShapeView addDividerDragHandler(final DragHandler dragHandler) { final HandlerManager handlerManager = getHandlerManager(); final HandlerRegistration dragStartRegistration = handlerManager.addHandler(MoveDividerStartEvent.TYPE, event -> dragHandler.start(buildDragEvent(event))); final HandlerRegistration dragStepRegistration = handlerManager.addHandler(MoveDividerStepEvent.TYPE, event -> dragHandler.handle(buildDragEvent(event))); final HandlerRegistration dragEndRegistration = handlerManager.addHandler(MoveDividerEndEvent.TYPE, event -> dragHandler.end(buildDragEvent(event))); final HandlerRegistration[] registrations = new HandlerRegistration[]{dragStartRegistration, dragStepRegistration, dragEndRegistration}; getEventHandlerManager().addHandlersRegistration(ViewEventType.DRAG, registrations); return this; } DecisionServiceSVGShapeView(final String name,
                                       final SVGPrimitiveShape svgPrimitive,
                                       final double width,
                                       final double height,
                                       final boolean resizable); DecisionServiceSVGShapeView addDividerDragHandler(final DragHandler dragHandler); double getDividerLineY(); void setDividerLineY(final double y); @Override //Override to increase visibility for Unit Tests HandlerManager getHandlerManager(); @Override void destroy(); }
DecisionServiceSVGShapeView extends SVGShapeViewImpl { public DecisionServiceSVGShapeView addDividerDragHandler(final DragHandler dragHandler) { final HandlerManager handlerManager = getHandlerManager(); final HandlerRegistration dragStartRegistration = handlerManager.addHandler(MoveDividerStartEvent.TYPE, event -> dragHandler.start(buildDragEvent(event))); final HandlerRegistration dragStepRegistration = handlerManager.addHandler(MoveDividerStepEvent.TYPE, event -> dragHandler.handle(buildDragEvent(event))); final HandlerRegistration dragEndRegistration = handlerManager.addHandler(MoveDividerEndEvent.TYPE, event -> dragHandler.end(buildDragEvent(event))); final HandlerRegistration[] registrations = new HandlerRegistration[]{dragStartRegistration, dragStepRegistration, dragEndRegistration}; getEventHandlerManager().addHandlersRegistration(ViewEventType.DRAG, registrations); return this; } DecisionServiceSVGShapeView(final String name,
                                       final SVGPrimitiveShape svgPrimitive,
                                       final double width,
                                       final double height,
                                       final boolean resizable); DecisionServiceSVGShapeView addDividerDragHandler(final DragHandler dragHandler); double getDividerLineY(); void setDividerLineY(final double y); @Override //Override to increase visibility for Unit Tests HandlerManager getHandlerManager(); @Override void destroy();  }