本文整理汇总了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();
}
}
示例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);
}
}
});
}
示例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);
}
示例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);
}
}
}
}
示例5: addMouseWheelHandler
import com.google.gwt.event.dom.client.MouseWheelHandler; //导入依赖的package包/类
@Override
public HandlerRegistration addMouseWheelHandler(MouseWheelHandler handler) {
return this.addDomHandler(handler, MouseWheelEvent.getType());
}
示例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());
}
示例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;
}
示例8: addMouseWheelHandler
import com.google.gwt.event.dom.client.MouseWheelHandler; //导入依赖的package包/类
@Override
public HandlerRegistration addMouseWheelHandler(MouseWheelHandler handler) {
return addDomHandler(handler, MouseWheelEvent.getType());
}
示例9: addMouseWheelHandler
import com.google.gwt.event.dom.client.MouseWheelHandler; //导入依赖的package包/类
public HandlerRegistration addMouseWheelHandler(MouseWheelHandler handler) {
return widget.addMouseWheelHandler(handler);
}
示例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));
}
示例11: addMouseWheelHandler
import com.google.gwt.event.dom.client.MouseWheelHandler; //导入依赖的package包/类
@Override
public HandlerRegistration addMouseWheelHandler( MouseWheelHandler handler) {
return addHandler(handler, MouseWheelEvent.getType());
}
示例12: addMouseWheelHandler
import com.google.gwt.event.dom.client.MouseWheelHandler; //导入依赖的package包/类
public HandlerRegistration addMouseWheelHandler(MouseWheelHandler handler) {
return addDomHandler(handler, MouseWheelEvent.getType());
}
示例13: addMouseWheelHandler
import com.google.gwt.event.dom.client.MouseWheelHandler; //导入依赖的package包/类
public HandlerRegistration addMouseWheelHandler(MouseWheelHandler handler) {
return html.addMouseWheelHandler(handler);
}
示例14: addMouseWheelHandler
import com.google.gwt.event.dom.client.MouseWheelHandler; //导入依赖的package包/类
@Override
public HandlerRegistration addMouseWheelHandler(final MouseWheelHandler handler) {
return this.addDomHandler(handler,
MouseWheelEvent.getType());
}
示例15: addMouseWheelHandler
import com.google.gwt.event.dom.client.MouseWheelHandler; //导入依赖的package包/类
@Override
public HandlerRegistration addMouseWheelHandler(MouseWheelHandler p_handler)
{
return m_intBox.addMouseWheelHandler( p_handler );
}