本文整理汇总了Java中com.google.gwt.event.dom.client.MouseWheelEvent.getDeltaY方法的典型用法代码示例。如果您正苦于以下问题:Java MouseWheelEvent.getDeltaY方法的具体用法?Java MouseWheelEvent.getDeltaY怎么用?Java MouseWheelEvent.getDeltaY使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.event.dom.client.MouseWheelEvent
的用法示例。
在下文中一共展示了MouseWheelEvent.getDeltaY方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onPaletteChooserMouseWheel
import com.google.gwt.event.dom.client.MouseWheelEvent; //导入方法依赖的package包/类
@UiHandler("paletteChooser")
void onPaletteChooserMouseWheel(MouseWheelEvent event) {
// determine new index based on scroll direction
int newIndex = paletteChooser.getSelectedIndex();
if (event.getDeltaY() < 0) {
newIndex--;
}
else {
newIndex++;
}
// set new index (if it's valid) and trigger change event (is not automatically triggered)
if (newIndex >= 0 && newIndex < paletteChooser.getItemCount()) {
paletteChooser.setSelectedIndex(newIndex);
DomEvent.fireNativeEvent(Document.get().createChangeEvent(), paletteChooser);
}
}
示例2: onMouseWheel
import com.google.gwt.event.dom.client.MouseWheelEvent; //导入方法依赖的package包/类
@Override
public void onMouseWheel(MouseWheelEvent event) {
if(useTrackball){
return;
}
double tzoom=0.05*baseScale;
//TODO make class
long t=System.currentTimeMillis();
if(mouseLast+100>t){
czoom*=2;
}else{
czoom=tzoom;
}
//GWT.log("wheel:"+event.getDeltaY());
double tmp=cameraZ+event.getDeltaY()*czoom;
tmp=Math.max(0.2, tmp);
tmp=Math.min(4000, tmp);
cameraZ=(double)tmp;
mouseLast=t;
}
示例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包/类
void onMouseWheel(MouseWheelEvent e) {
wheelDeltaY += e.getDeltaY();
if (wheelDeltaY > 5) {
slowDown();
wheelDeltaY = 0;
}
if (wheelDeltaY < -5)
speedUp();
wheelDeltaY = 0;
}
示例5: 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();
}
}
示例6: onMouseWheel
import com.google.gwt.event.dom.client.MouseWheelEvent; //导入方法依赖的package包/类
public void onMouseWheel(MouseWheelEvent event) {
final boolean isNorth;
if (event.getDeltaY() == 0) {
isNorth = (getWheelDelta(event.getNativeEvent()) < 0);
} else {
isNorth = event.isNorth();
}
if (isNorth) {
if (zoomType == ScrollZoomType.ZOOM_POSITION) {
mapModel.getMapView().scale(
2.0f,
MapView.ZoomOption.LEVEL_CHANGE,
mapModel.getMapView().getWorldViewTransformer()
.viewToWorld(new Coordinate(event.getX(), event.getY())));
} else {
mapModel.getMapView().scale(2.0f, MapView.ZoomOption.LEVEL_CHANGE);
}
} else {
if (zoomType == ScrollZoomType.ZOOM_POSITION) {
mapModel.getMapView().scale(
0.5f,
MapView.ZoomOption.LEVEL_CHANGE,
mapModel.getMapView().getWorldViewTransformer()
.viewToWorld(new Coordinate(event.getX(), event.getY())));
} else {
mapModel.getMapView().scale(0.5f, MapView.ZoomOption.LEVEL_CHANGE);
}
}
}
示例7: onMouseWheel
import com.google.gwt.event.dom.client.MouseWheelEvent; //导入方法依赖的package包/类
@Override
public void onMouseWheel(MouseWheelEvent event) {
final boolean isNorth;
if (event.getDeltaY() == 0) {
isNorth = (getWheelDelta(event.getNativeEvent()) < 0);
} else {
isNorth = event.isNorth();
}
Coordinate location = getLocation(event, RenderSpace.WORLD);
scrollZoomTo(isNorth, location);
}
示例8: onMouseWheel
import com.google.gwt.event.dom.client.MouseWheelEvent; //导入方法依赖的package包/类
@Override
public void onMouseWheel(MouseWheelEvent event)
{
int wheelDelta = event.getDeltaY();
wheelDelta = wheelDelta != 0 ? wheelDelta : workaroundEventGetMouseWheelVelocityY(event.getNativeEvent());
this.setMousePoint(event.getRelativeX(m_container.getElement()), event.getRelativeY(m_container.getElement()), m_mouseEvent.getPoint());
m_mouseEvent.set(E_MouseEventType.MOUSE_SCROLLED, -wheelDelta, Element.as(event.getNativeEvent().getEventTarget()), false);
s_logger.log(Level.INFO, "scroll" + m_mouseEvent.getScrollDelta());
dispatchEvent(m_mouseEvent);
}
示例9: 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();
}