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


Java MouseMotionEvent.getDeltaWheel方法代码示例

本文整理汇总了Java中com.jme3.input.event.MouseMotionEvent.getDeltaWheel方法的典型用法代码示例。如果您正苦于以下问题:Java MouseMotionEvent.getDeltaWheel方法的具体用法?Java MouseMotionEvent.getDeltaWheel怎么用?Java MouseMotionEvent.getDeltaWheel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.jme3.input.event.MouseMotionEvent的用法示例。


在下文中一共展示了MouseMotionEvent.getDeltaWheel方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onMouseMotionEvent

import com.jme3.input.event.MouseMotionEvent; //导入方法依赖的package包/类
public void onMouseMotionEvent(MouseMotionEvent evt) {
    // Only forward the event if there's actual motion involved.
    // No longer ignores mouse wheel
    if (inputManager.isCursorVisible() && (evt.getDX() != 0 ||
                                           evt.getDY() != 0 ||
                                           evt.getDeltaWheel() != 0)){
        inputQueue.add(evt);
    }
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:10,代码来源:InputSystemJme.java

示例2: s3dOnMouseMotionEvent

import com.jme3.input.event.MouseMotionEvent; //导入方法依赖的package包/类
private void s3dOnMouseMotionEvent(MouseMotionEvent evt, boolean guiFocus) {
	if (!mousePressed) {
		float x = Screen.isAndroid() ? touchXY.x : mouseXY.x;
		float y = Screen.isAndroid() ? touchXY.y : mouseXY.y;
		mouseFocusNode = getEventNode(x, y);
		if (!guiFocus) {
			if (mouseFocusNode != previousMouseFocusNode) {
				if (previousMouseFocusNode instanceof MouseFocusListener) {
					((MouseFocusListener)previousMouseFocusNode).onLoseFocus(evt);
				}
				if (mouseFocusNode instanceof MouseFocusListener) {
					((MouseFocusListener)mouseFocusNode).onGetFocus(evt);
				}
				previousMouseFocusNode = mouseFocusNode;
			}
			if (mouseFocusNode != null) {
				if (mouseFocusNode instanceof MouseWheelListener) {
					if (evt.getDeltaWheel() > 0) {
						((MouseWheelListener)mouseFocusNode).onMouseWheelDown(evt);
					} else if (evt.getDeltaWheel() < 0) {
						((MouseWheelListener)mouseFocusNode).onMouseWheelUp(evt);
					}
				}
			}
			if (mouseFocusNode instanceof MouseMovementListener) {
				((MouseMovementListener)mouseFocusNode).onMouseMove(evt);
			}
		} else {
			if (previousMouseFocusNode instanceof MouseFocusListener) {
				((MouseFocusListener)previousMouseFocusNode).onLoseFocus(evt);
				previousMouseFocusNode = null;
			}
		}
	}
}
 
开发者ID:meltzow,项目名称:tonegodgui,代码行数:36,代码来源:Screen.java

示例3: onMouseMotionEvent

import com.jme3.input.event.MouseMotionEvent; //导入方法依赖的package包/类
public void onMouseMotionEvent(MouseMotionEvent evt) {
    // Only forward the event if there's actual motion involved.
    if (inputManager.isCursorVisible() && (evt.getDX() != 0 ||
                                           evt.getDY() != 0 ||
                                           evt.getDeltaWheel() != 0)){
        inputQueue.add(evt);
    }
}
 
开发者ID:chototsu,项目名称:MikuMikuStudio,代码行数:9,代码来源:InputSystemJme.java

示例4: MouseUIWheelEvent

import com.jme3.input.event.MouseMotionEvent; //导入方法依赖的package包/类
public MouseUIWheelEvent(MouseMotionEvent originator, E element, int modifiers) {
	super(originator, element, modifiers);
	direction = originator.getDeltaWheel() < 0 ? Direction.up : Direction.down;
}
 
开发者ID:rockfireredmoon,项目名称:icetone,代码行数:5,代码来源:MouseUIWheelEvent.java

示例5: MouseUIMotionEvent

import com.jme3.input.event.MouseMotionEvent; //导入方法依赖的package包/类
public MouseUIMotionEvent(MouseMotionEvent originator, int relx, int rely, E element, int modifiers) {
	this(originator.getX(), originator.getY(), originator.getDX(), originator.getDY(), originator.getWheel(),
			originator.getDeltaWheel(), relx, rely, modifiers, element);
	this.originator = originator;
}
 
开发者ID:rockfireredmoon,项目名称:icetone,代码行数:6,代码来源:MouseUIMotionEvent.java

示例6: onMouseMotionEvent

import com.jme3.input.event.MouseMotionEvent; //导入方法依赖的package包/类
public void onMouseMotionEvent(MouseMotionEvent oldEvt, MouseMotionEvent evt) {
	setMouseXY(evt.getX(),evt.getY());
	if (!mousePressed) {
		mouseFocusElement = getEventElement(evt.getX(), evt.getY());
		if (mouseFocusElement != previousMouseFocusElement) {
			if (previousMouseFocusElement instanceof MouseFocusListener) {
				((MouseFocusListener)previousMouseFocusElement).onLoseFocus(evt);
			}
			if (mouseFocusElement instanceof MouseFocusListener) {
				((MouseFocusListener)mouseFocusElement).onGetFocus(evt);
			}
			previousMouseFocusElement = mouseFocusElement;
		}
		if (mouseFocusElement != null) {
			focusElementIsMovable = mouseFocusElement.getIsMovable();
			
			if (mouseFocusElement instanceof MouseWheelListener) {
				if (evt.getDeltaWheel() > 0) {
					((MouseWheelListener)mouseFocusElement).onMouseWheelDown(evt);
				} else if (evt.getDeltaWheel() < 0) {
					((MouseWheelListener)mouseFocusElement).onMouseWheelUp(evt);
				}
				oldEvt.setConsumed();
			}
		}
		if (mouseFocusElement instanceof MouseMovementListener) {
			((MouseMovementListener)mouseFocusElement).onMouseMove(evt);
		}
	} else {
		if (eventElement != null) {
			if (mouseLeftPressed) {
				focusElementIsMovable = contactElement.getIsMovable();
				if (eventElementResizeDirection != null) {
					eventElement.resize(evt.getX(), evt.getY(), eventElementResizeDirection);
				} else if (focusElementIsMovable) {
					eventElement.moveTo(evt.getX()-eventElementOffsetX, evt.getY()-eventElementOffsetY);
				}
			}

			if (eventElement instanceof MouseMovementListener) {
				((MouseMovementListener)eventElement).onMouseMove(evt);
			}
		}
	}
}
 
开发者ID:meltzow,项目名称:tonegodgui,代码行数:46,代码来源:SubScreen.java


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