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


Java MouseMotionEvent.setConsumed方法代码示例

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


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

示例1: onMouseMove

import com.jme3.input.event.MouseMotionEvent; //导入方法依赖的package包/类
@Override
public void onMouseMove(MouseMotionEvent evt) {
	if (mouseLook) {
		if (enabled) {
			if (evt.getY() > lastY)
				bridge.getChaseCamera().onAnalog("ChaseCamUp", -evt.getDY()*(bridge.getCurrentTPF()/2), bridge.getCurrentTPF());
			else
				bridge.getChaseCamera().onAnalog("ChaseCamDown", evt.getDY()*(bridge.getCurrentTPF()/2), bridge.getCurrentTPF());
			if (evt.getX() > lastX)
				bridge.getChaseCamera().onAnalog("ChaseCamMoveRight", evt.getDX()*(bridge.getCurrentTPF()/2), bridge.getCurrentTPF());
			else
				bridge.getChaseCamera().onAnalog("ChaseCamMoveLeft", -evt.getDX()*(bridge.getCurrentTPF()/2), bridge.getCurrentTPF());
		}
		lastX = evt.getX();
		lastY = evt.getY();
		evt.setConsumed();
	}
}
 
开发者ID:meltzow,项目名称:tonegodgui,代码行数:19,代码来源:OSRViewPort.java

示例2: onMouseWheelUp

import com.jme3.input.event.MouseMotionEvent; //导入方法依赖的package包/类
@Override
public void onMouseWheelUp(MouseMotionEvent evt) {
	if (getVerticalScrollDistance() > 0) {
		scrollYBy(-getTrackInc());
		evt.setConsumed();
	}
}
 
开发者ID:meltzow,项目名称:tonegodgui,代码行数:8,代码来源:ScrollPanel.java

示例3: onMouseWheelDown

import com.jme3.input.event.MouseMotionEvent; //导入方法依赖的package包/类
@Override
public void onMouseWheelDown(MouseMotionEvent evt) {
	if (getVerticalScrollDistance() > 0) {
		scrollYBy(getTrackInc());
		evt.setConsumed();
	}
}
 
开发者ID:meltzow,项目名称:tonegodgui,代码行数:8,代码来源:ScrollPanel.java

示例4: onMouseWheelUp

import com.jme3.input.event.MouseMotionEvent; //导入方法依赖的package包/类
@Override
public void onMouseWheelUp(MouseMotionEvent evt) {
	if (vScrollBar != null) {
		vScrollBar.scrollByYInc(-vScrollBar.getTrackInc());
	}
	evt.setConsumed();
}
 
开发者ID:meltzow,项目名称:tonegodgui,代码行数:8,代码来源:ScrollArea.java

示例5: onMouseWheelDown

import com.jme3.input.event.MouseMotionEvent; //导入方法依赖的package包/类
@Override
public void onMouseWheelDown(MouseMotionEvent evt) {
	if (vScrollBar != null) {
		vScrollBar.scrollByYInc(vScrollBar.getTrackInc());
	}
	evt.setConsumed();
}
 
开发者ID:meltzow,项目名称:tonegodgui,代码行数:8,代码来源:ScrollArea.java

示例6: onMouseWheelUp

import com.jme3.input.event.MouseMotionEvent; //导入方法依赖的package包/类
@Override
public void onMouseWheelUp(MouseMotionEvent evt) {
	if (zoomEnabled) {
		if (enabled) {
			bridge.getChaseCamera().onAnalog("ChaseCamZoomIn", evt.getDeltaWheel()*(bridge.getCurrentTPF()/4), bridge.getCurrentTPF());
		}
	}
	evt.setConsumed();
}
 
开发者ID:meltzow,项目名称:tonegodgui,代码行数:10,代码来源:OSRViewPort.java

示例7: onMouseWheelDown

import com.jme3.input.event.MouseMotionEvent; //导入方法依赖的package包/类
@Override
public void onMouseWheelDown(MouseMotionEvent evt) {
	if (zoomEnabled) {
		if (enabled) {
			bridge.getChaseCamera().onAnalog("ChaseCamZoomIn", evt.getDeltaWheel()*(bridge.getCurrentTPF()/4), bridge.getCurrentTPF());
		}
	}
	evt.setConsumed();
}
 
开发者ID:meltzow,项目名称:tonegodgui,代码行数:10,代码来源:OSRViewPort.java

示例8: 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.setConsumed方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。