java类com.google.gwt.event.dom.client.MouseWheelHandler的实例源码

CirSim.java 文件源码 项目:circuitjs1 阅读 21 收藏 0 点赞 0 评论 0
public void onMouseWheel(MouseWheelEvent e) {
    e.preventDefault();

    // once we start zooming, don't allow other uses of mouse wheel for a while
    // so we don't accidentally edit a resistor value while zooming
    boolean zoomOnly = System.currentTimeMillis() < zoomTime+1000;

    if (!zoomOnly)
        scrollValues(e.getNativeEvent().getClientX(), e.getNativeEvent().getClientY(), e.getDeltaY());

    if (mouseElm instanceof MouseWheelHandler && !zoomOnly)
        ((MouseWheelHandler) mouseElm).onMouseWheel(e);
    else if (scopeSelected != -1)
        scopes[scopeSelected].onMouseWheel(e);
    else if (!dialogIsShowing()) {
        zoomCircuit(e.getDeltaY());
        zoomTime = System.currentTimeMillis();
}
}
VImageViewer.java 文件源码 项目:ImageViewer 阅读 20 收藏 0 点赞 0 评论 0
public VImageViewer() {
    /* Create widget's root panel */
    panelRoot = new FlowPanel();
    Style style = panelRoot.getElement().getStyle();
    style.setPosition(Position.RELATIVE);
    setStyleName(CLASSNAME);
    panelRoot.setStyleName(CLASSNAME + "-flow");
    style.setWidth(100, Unit.PCT);
    style.setHeight(100, Unit.PCT);

    /* Create image container */
    imageContainer = new FlowPanel();
    style = imageContainer.getElement().getStyle();
    style.setPosition(Position.ABSOLUTE);
    style.setOverflow(Overflow.HIDDEN);

    /* Add widgets */
    setWidget(panelRoot);
    panelRoot.add(imageContainer);

    /* Register handlers */
    addDomHandler(this, KeyDownEvent.getType());
    addDomHandler(this, ClickEvent.getType());
    addMouseWheelHandler(new MouseWheelHandler() {
        public void onMouseWheel(MouseWheelEvent event) {
            event.preventDefault();
            if (event.isNorth()) {
                moveImages(true);
            } else {
                moveImages(false);
            }
        }
    });
}
GridLienzoScrollHandlerTest.java 文件源码 项目:appformer 阅读 24 收藏 0 点赞 0 评论 0
@Test
public void testSetupContextSwitcher() {

    final AbsolutePanel domElementContainer = mock(AbsolutePanel.class);
    final LienzoPanel lienzoPanel = mock(LienzoPanel.class);
    final MouseWheelHandler wheelHandler = mock(MouseWheelHandler.class);
    final MouseMoveHandler moveHandler = mock(MouseMoveHandler.class);

    doReturn(domElementContainer).when(gridLienzoPanel).getDomElementContainer();
    doReturn(wheelHandler).when(gridLienzoScrollHandler).disablePointerEvents();
    doReturn(moveHandler).when(gridLienzoScrollHandler).enablePointerEvents();

    gridLienzoScrollHandler.setupContextSwitcher();

    verify(domElementContainer).addDomHandler(wheelHandler, MouseWheelEvent.getType());
    verify(gridLienzoPanel).addMouseMoveHandler(moveHandler);
}
EventsExecutor.java 文件源码 项目:platypus-js 阅读 24 收藏 0 点赞 0 评论 0
public void setMouseWheelMoved(JavaScriptObject aValue) {
    if (mouseWheelMoved != aValue) {
        if (mouseWheelReg != null) {
            mouseWheelReg.removeHandler();
            mouseWheelReg = null;
        }
        mouseWheelMoved = aValue;
        if (mouseWheelMoved != null) {
            MouseWheelHandler handler = new MouseWheelHandler() {
                @Override
                public void onMouseWheel(MouseWheelEvent event) {
                    if (mouseWheelMoved != null) {
                        event.stopPropagation();
                        executeEvent(mouseWheelMoved, EventsPublisher.publish(event));
                    }
                }
            };
            if (component instanceof Widget) {
                mouseWheelReg = ((Widget) component).addDomHandler(handler, MouseWheelEvent.getType());
            } else if (component instanceof HasMouseWheelHandlers) {
                mouseWheelReg = ((HasMouseWheelHandlers) component).addMouseWheelHandler(handler);
            }
        }
    }
}
ListItem.java 文件源码 项目:putnami-web-toolkit 阅读 17 收藏 0 点赞 0 评论 0
@Override
public HandlerRegistration addMouseWheelHandler(MouseWheelHandler handler) {
    return this.addDomHandler(handler, MouseWheelEvent.getType());
}
GreenScrollPanel.java 文件源码 项目:ineform 阅读 22 收藏 0 点赞 0 评论 0
public GreenScrollPanel(boolean withHorizontalScroll) {
    mainPanel = new ResizeLayoutPanel() {
        @Override
        protected void onAttach() {
            super.onAttach();
            // hack to hide scrollbar in chrome when leaflet map is also
            // displayed (check GreenScrollImpl.onAttach too)
            if (isChrome()) {
                try {
                    ((Element) (getElement().getChild(1))).getStyle().setZIndex(-1000);
                    ((Element) (getElement().getChild(2))).getStyle().setZIndex(-1000);
                } catch (Exception e) {
                    GWT.log("", e);
                }
            }

        }
    };

    if (hasMacNanoScrollBar()) {
        this.impl = new ScrollPanel();
    } else {
        this.impl = new GreenScrollImpl(withHorizontalScroll);
    }

    mainPanel.setWidget(impl);

    impl.addDomHandler(new MouseWheelHandler() {

        @Override
        public void onMouseWheel(MouseWheelEvent event) {
            event.stopPropagation();
        }
    }, MouseWheelEvent.getType());

}
PopupCanvas.java 文件源码 项目:QMAClone 阅读 23 收藏 0 点赞 0 评论 0
@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
public HandlerRegistration addMouseWheelHandler(MouseWheelHandler handler) {
    eventHandlers.put(handler, (DomEvent.Type) MouseWheelEvent.getType());
    if (canvas != null) {
        canvas.addDomHandler(handler, MouseWheelEvent.getType());
    }
    return null;
}
MouseEventsCanvas.java 文件源码 项目:QMAClone 阅读 21 收藏 0 点赞 0 评论 0
@Override
public HandlerRegistration addMouseWheelHandler(MouseWheelHandler handler) {
    return addDomHandler(handler, MouseWheelEvent.getType());
}
GraphicsWidget.java 文件源码 项目:geomajas-project-client-gwt 阅读 20 收藏 0 点赞 0 评论 0
public HandlerRegistration addMouseWheelHandler(MouseWheelHandler handler) {
    return widget.addMouseWheelHandler(handler);
}
DMNGridPanel.java 文件源码 项目:kie-wb-common 阅读 23 收藏 0 点赞 0 评论 0
private MouseWheelHandler destroyDOMElements() {
    return (event) -> gridLayer
            .getGridWidgets()
            .forEach(gridWidget -> gridWidget
                    .getModel()
                    .getColumns()
                    .stream()
                    .filter(gridColumn -> gridColumn instanceof HasDOMElementResources)
                    .map(gridColumn -> ((HasDOMElementResources) gridColumn))
                    .forEach(HasDOMElementResources::destroyResources));
}
P.java 文件源码 项目:unitimes 阅读 28 收藏 0 点赞 0 评论 0
@Override
public HandlerRegistration addMouseWheelHandler( MouseWheelHandler handler) {
    return addHandler(handler, MouseWheelEvent.getType());
}
HandlerPanel.java 文件源码 项目:appinventor-extensions 阅读 21 收藏 0 点赞 0 评论 0
public HandlerRegistration addMouseWheelHandler(MouseWheelHandler handler) {
  return addDomHandler(handler, MouseWheelEvent.getType());
}
Canvas.java 文件源码 项目:mgwt-traffic-flow 阅读 29 收藏 0 点赞 0 评论 0
public HandlerRegistration addMouseWheelHandler(MouseWheelHandler handler) {
    return html.addMouseWheelHandler(handler);
}
TreeView.java 文件源码 项目:r01fb 阅读 27 收藏 0 点赞 0 评论 0
@Override
public HandlerRegistration addMouseWheelHandler(final MouseWheelHandler handler) {
    return this.addDomHandler(handler,
                              MouseWheelEvent.getType());
}
P.java 文件源码 项目:unitime 阅读 22 收藏 0 点赞 0 评论 0
@Override
public HandlerRegistration addMouseWheelHandler( MouseWheelHandler handler) {
    return addHandler(handler, MouseWheelEvent.getType());
}
WgtIntBox.java 文件源码 项目:fullmetalgalaxy 阅读 24 收藏 0 点赞 0 评论 0
@Override
public HandlerRegistration addMouseWheelHandler(MouseWheelHandler p_handler)
{
  return m_intBox.addMouseWheelHandler( p_handler );
}
Canvas.java 文件源码 项目:appformer 阅读 26 收藏 0 点赞 0 评论 0
public HandlerRegistration addMouseWheelHandler(MouseWheelHandler handler) {
    return html.addMouseWheelHandler(handler);
}
GridLienzoScrollHandler.java 文件源码 项目:appformer 阅读 17 收藏 0 点赞 0 评论 0
MouseWheelHandler disablePointerEvents() {
    return event -> gridLienzoScrollUI().disablePointerEvents(getDomElementContainer());
}
DropDockRootPanel.java 文件源码 项目:gwthtml5apps 阅读 21 收藏 0 点赞 0 评论 0
public HandlerRegistration addMouseWheelHandler(MouseWheelHandler handler) {
  return addDomHandler(handler, MouseWheelEvent.getType());
}
AbstractInput.java 文件源码 项目:putnami-web-toolkit 阅读 20 收藏 0 点赞 0 评论 0
@Override
public com.google.gwt.event.shared.HandlerRegistration addMouseWheelHandler(MouseWheelHandler handler) {
    return this.addDomHandler(handler, MouseWheelEvent.getType());
}
Anchor.java 文件源码 项目:putnami-web-toolkit 阅读 21 收藏 0 点赞 0 评论 0
@Override
public HandlerRegistration addMouseWheelHandler(MouseWheelHandler handler) {
    return this.addDomHandler(handler, MouseWheelEvent.getType());
}
ButtonCaption.java 文件源码 项目:gwtoauthlogindemo 阅读 25 收藏 0 点赞 0 评论 0
@Override
public HandlerRegistration addMouseWheelHandler(MouseWheelHandler handler)
{
    return addMouseWheelHandler(handler);
}
GraphicsWidget.java 文件源码 项目:geomajas-project-client-gwt 阅读 44 收藏 0 点赞 0 评论 0
public HandlerRegistration addMouseWheelHandler(MouseWheelHandler handler) {
    return eventWidget.addMouseWheelHandler(handler);
}
MapWidgetImpl.java 文件源码 项目:geomajas-project-client-gwt2 阅读 27 收藏 0 点赞 0 评论 0
public HandlerRegistration addMouseWheelHandler(MouseWheelHandler handler) {
    return addDomHandler(handler, MouseWheelEvent.getType());
}
AbstractButton.java 文件源码 项目:gwtbootstrap3 阅读 19 收藏 0 点赞 0 评论 0
@Override
public HandlerRegistration addMouseWheelHandler(final MouseWheelHandler handler) {
    return addDomHandler(handler, MouseWheelEvent.getType());
}
Label.java 文件源码 项目:gwtbootstrap3 阅读 22 收藏 0 点赞 0 评论 0
@Override
public HandlerRegistration addMouseWheelHandler(final MouseWheelHandler handler) {
    return addDomHandler(handler, MouseWheelEvent.getType());
}
RenderEngine.java 文件源码 项目:GwtGameUi 阅读 20 收藏 0 点赞 0 评论 0
@Override
public HandlerRegistration addMouseWheelHandler(MouseWheelHandler handler) {
  return addDomHandler(handler, com.google.gwt.event.dom.client.MouseWheelEvent.getType());
}
MapWidget.java 文件源码 项目:geomajas-project-client-gwt 阅读 21 收藏 0 点赞 0 评论 0
/**
 * Set a new mouse wheel controller on the map. If the zoom on scroll is currently enabled, it will be disabled
 * first.
 * 
 * @param controller
 *            The new mouse wheel controller to be applied on the map.
 * @since 1.6.0
 */
@Api
public void setMouseWheelController(MouseWheelHandler controller) {
    setZoomOnScrollEnabled(false);
    mouseWheelRegistration = graphics.addMouseWheelHandler(controller);
}


问题


面经


文章

微信
公众号

扫码关注公众号