当前位置: 首页>>代码示例>>Java>>正文


Java MouseWheelHandler类代码示例

本文整理汇总了Java中com.google.gwt.event.dom.client.MouseWheelHandler的典型用法代码示例。如果您正苦于以下问题:Java MouseWheelHandler类的具体用法?Java MouseWheelHandler怎么用?Java MouseWheelHandler使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


MouseWheelHandler类属于com.google.gwt.event.dom.client包,在下文中一共展示了MouseWheelHandler类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onMouseWheel

import com.google.gwt.event.dom.client.MouseWheelHandler; //导入依赖的package包/类
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();
}
}
 
开发者ID:sharpie7,项目名称:circuitjs1,代码行数:20,代码来源:CirSim.java

示例2: VImageViewer

import com.google.gwt.event.dom.client.MouseWheelHandler; //导入依赖的package包/类
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);
            }
        }
    });
}
 
开发者ID:tepi,项目名称:ImageViewer,代码行数:35,代码来源:VImageViewer.java

示例3: testSetupContextSwitcher

import com.google.gwt.event.dom.client.MouseWheelHandler; //导入依赖的package包/类
@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);
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:18,代码来源:GridLienzoScrollHandlerTest.java

示例4: setMouseWheelMoved

import com.google.gwt.event.dom.client.MouseWheelHandler; //导入依赖的package包/类
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);
			}
		}
	}
}
 
开发者ID:marat-gainullin,项目名称:platypus-js,代码行数:26,代码来源:EventsExecutor.java

示例5: addMouseWheelHandler

import com.google.gwt.event.dom.client.MouseWheelHandler; //导入依赖的package包/类
@Override
public HandlerRegistration addMouseWheelHandler(MouseWheelHandler handler) {
	return this.addDomHandler(handler, MouseWheelEvent.getType());
}
 
开发者ID:Putnami,项目名称:putnami-web-toolkit,代码行数:5,代码来源:ListItem.java

示例6: GreenScrollPanel

import com.google.gwt.event.dom.client.MouseWheelHandler; //导入依赖的package包/类
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());

}
 
开发者ID:inepex,项目名称:ineform,代码行数:37,代码来源:GreenScrollPanel.java

示例7: addMouseWheelHandler

import com.google.gwt.event.dom.client.MouseWheelHandler; //导入依赖的package包/类
@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;
}
 
开发者ID:nodchip,项目名称:QMAClone,代码行数:10,代码来源:PopupCanvas.java

示例8: addMouseWheelHandler

import com.google.gwt.event.dom.client.MouseWheelHandler; //导入依赖的package包/类
@Override
public HandlerRegistration addMouseWheelHandler(MouseWheelHandler handler) {
	return addDomHandler(handler, MouseWheelEvent.getType());
}
 
开发者ID:nodchip,项目名称:QMAClone,代码行数:5,代码来源:MouseEventsCanvas.java

示例9: addMouseWheelHandler

import com.google.gwt.event.dom.client.MouseWheelHandler; //导入依赖的package包/类
public HandlerRegistration addMouseWheelHandler(MouseWheelHandler handler) {
	return widget.addMouseWheelHandler(handler);
}
 
开发者ID:geomajas,项目名称:geomajas-project-client-gwt,代码行数:4,代码来源:GraphicsWidget.java

示例10: destroyDOMElements

import com.google.gwt.event.dom.client.MouseWheelHandler; //导入依赖的package包/类
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));
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:12,代码来源:DMNGridPanel.java

示例11: addMouseWheelHandler

import com.google.gwt.event.dom.client.MouseWheelHandler; //导入依赖的package包/类
@Override
public HandlerRegistration addMouseWheelHandler( MouseWheelHandler handler) {
	return addHandler(handler, MouseWheelEvent.getType());
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:5,代码来源:P.java

示例12: addMouseWheelHandler

import com.google.gwt.event.dom.client.MouseWheelHandler; //导入依赖的package包/类
public HandlerRegistration addMouseWheelHandler(MouseWheelHandler handler) {
  return addDomHandler(handler, MouseWheelEvent.getType());
}
 
开发者ID:mit-cml,项目名称:appinventor-extensions,代码行数:4,代码来源:HandlerPanel.java

示例13: addMouseWheelHandler

import com.google.gwt.event.dom.client.MouseWheelHandler; //导入依赖的package包/类
public HandlerRegistration addMouseWheelHandler(MouseWheelHandler handler) {
	return html.addMouseWheelHandler(handler);
}
 
开发者ID:waynedyck,项目名称:mgwt-traffic-flow,代码行数:4,代码来源:Canvas.java

示例14: addMouseWheelHandler

import com.google.gwt.event.dom.client.MouseWheelHandler; //导入依赖的package包/类
@Override
public HandlerRegistration addMouseWheelHandler(final MouseWheelHandler handler) {
	return this.addDomHandler(handler,
							  MouseWheelEvent.getType());
}
 
开发者ID:opendata-euskadi,项目名称:r01fb,代码行数:6,代码来源:TreeView.java

示例15: addMouseWheelHandler

import com.google.gwt.event.dom.client.MouseWheelHandler; //导入依赖的package包/类
@Override
public HandlerRegistration addMouseWheelHandler(MouseWheelHandler p_handler)
{
  return m_intBox.addMouseWheelHandler( p_handler );
}
 
开发者ID:kroc702,项目名称:fullmetalgalaxy,代码行数:6,代码来源:WgtIntBox.java


注:本文中的com.google.gwt.event.dom.client.MouseWheelHandler类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。