本文整理汇总了Java中com.google.gwt.event.dom.client.MouseWheelEvent.preventDefault方法的典型用法代码示例。如果您正苦于以下问题:Java MouseWheelEvent.preventDefault方法的具体用法?Java MouseWheelEvent.preventDefault怎么用?Java MouseWheelEvent.preventDefault使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.event.dom.client.MouseWheelEvent
的用法示例。
在下文中一共展示了MouseWheelEvent.preventDefault方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onMouseWheel
import com.google.gwt.event.dom.client.MouseWheelEvent; //导入方法依赖的package包/类
public void onMouseWheel(MouseWheelEvent event) {
try {
ChartState chartInfo = getChartState(event);
Chart chart = chartInfo.chart;
int wheelDir = event.getNativeEvent().getMouseWheelVelocityY();
boolean isMouseWheelUp = (wheelDir <= 0);
if (isMouseWheelUp) {
chart.nextZoom();
}
else {
chart.prevZoom();
}
chartInfo.setHandled(true);
} catch (Exception e) {
e.printStackTrace();
}
// Do not move scroll
event.preventDefault();
}
示例2: onMouseWheel
import com.google.gwt.event.dom.client.MouseWheelEvent; //导入方法依赖的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();
}
}
示例3: onMouseWheel
import com.google.gwt.event.dom.client.MouseWheelEvent; //导入方法依赖的package包/类
@Override
public void onMouseWheel( MouseWheelEvent event )
{
if( m_callback == null )
return;
event.preventDefault();
int x = event.getRelativeX( m_canvas.getElement() );
int delta = event.getDeltaY();
if( delta > 0 )
delta = 1;
else if( delta < 0 )
delta = -1;
m_callback.onMouseWheel( m_cookie, event, x, delta );
}
示例4: onMouseWheel
import com.google.gwt.event.dom.client.MouseWheelEvent; //导入方法依赖的package包/类
@Override
public void onMouseWheel(MouseWheelEvent event) {
if (event.isControlKeyDown()) {
int delta = event.getDeltaY();
app.getToolbar().zoomChangeClicked(Integer.signum(-delta));
event.preventDefault();
}
}
示例5: onMouseWheel
import com.google.gwt.event.dom.client.MouseWheelEvent; //导入方法依赖的package包/类
@Override
public void onMouseWheel(MouseWheelEvent event) {
if(event.getDeltaY() > 0) {
scale /= KEY_ZOOM_STEP;
} else {
scale *= KEY_ZOOM_STEP;
}
updateZoom();
event.preventDefault();
}
示例6: onMouseWheel
import com.google.gwt.event.dom.client.MouseWheelEvent; //导入方法依赖的package包/类
public void onMouseWheel(MouseWheelEvent e) {
e.preventDefault();
doDeltaY( e.getDeltaY());
}
示例7: onMouseWheel
import com.google.gwt.event.dom.client.MouseWheelEvent; //导入方法依赖的package包/类
public void onMouseWheel(MouseWheelEvent e) {
e.preventDefault();
if (enabled)
setValue(val+e.getDeltaY()/3);
}