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


Java MouseButtonEvent.isReleased方法代码示例

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


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

示例1: onMouseButtonEvent

import com.jme3.input.event.MouseButtonEvent; //导入方法依赖的package包/类
@Override
public void onMouseButtonEvent( MouseButtonEvent evt ) {
    if( !isEnabled() ) {
        return;
    }
    if( evt.isPressed() ) {
        // Save the location for later
        clickStart.set(evt.getX(), evt.getY());
    } else if( evt.isReleased() ) {
        
        Vector2f click = new Vector2f(evt.getX(), evt.getY());
        if( click.distanceSquared(clickStart) < clickRadiusSq ) {
            processClickEvent(click, evt);
        }  
    }
}
 
开发者ID:jMonkeyEngine-Contributions,项目名称:Lemur,代码行数:17,代码来源:SelectionState.java

示例2: onMouseButtonEvent

import com.jme3.input.event.MouseButtonEvent; //导入方法依赖的package包/类
public void onMouseButtonEvent(MouseButtonEvent mbe) {
    //on a click release we request the focus for the top component
    //this allow netbeans to catch keyEvents and trigger actions according to keymapping
    if ("true".equals(NbPreferences.forModule(Installer.class).get("use_lwjgl_canvas", "false"))) {
        if (mbe.isReleased()) {
            java.awt.EventQueue.invokeLater(new Runnable() {

                public void run() {
                    SceneViewerTopComponent.findInstance().requestActive();
                }
            });
        }
    }

}
 
开发者ID:jMonkeyEngine,项目名称:sdk,代码行数:16,代码来源:AbstractCameraController.java

示例3: onMouseButtonEvent

import com.jme3.input.event.MouseButtonEvent; //导入方法依赖的package包/类
@Override
public void onMouseButtonEvent(MouseButtonEvent evt) {
    if (evt.isReleased()) {
        currentTool.onMouseButtonReleased(this);
    } else if (evt.isPressed()) {
        currentTool.onMouseButtonPressed(this);
    }
}
 
开发者ID:samynk,项目名称:DArtE,代码行数:9,代码来源:SandboxViewport.java

示例4: onMouseButtonEvent

import com.jme3.input.event.MouseButtonEvent; //导入方法依赖的package包/类
public void onMouseButtonEvent(MouseButtonEvent mbe) {
    //on a click release we request the focus for the top component
    //this allow netbeans to catch keyEvents and trigger actions according to keymapping
    if (mbe.isReleased()) {
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                SceneViewerTopComponent.findInstance().requestActive();
            }
        });
    }

}
 
开发者ID:chototsu,项目名称:MikuMikuStudio,代码行数:14,代码来源:AbstractCameraController.java

示例5: s3dOnMouseButtonEvent

import com.jme3.input.event.MouseButtonEvent; //导入方法依赖的package包/类
private void s3dOnMouseButtonEvent(MouseButtonEvent evt) {
	float x = Screen.isAndroid() ? touchXY.x : mouseXY.x;
	float y = Screen.isAndroid() ? touchXY.y : mouseXY.y;
	eventNode = getEventNode(x, y);
	if (eventNode != null) {
		if (evt.isPressed()) {
			switch (evt.getButtonIndex()) {
				case 0:
					if (eventNode instanceof MouseButtonListener) {
						((MouseButtonListener)eventNode).onMouseLeftPressed(evt);
					}
					break;
				case 1:
					if (eventNode instanceof MouseButtonListener) {
						((MouseButtonListener)eventNode).onMouseRightPressed(evt);
					}
					break;
				case 2:
					if (eventNode instanceof MouseWheelListener) {
						((MouseWheelListener)eventNode).onMouseWheelPressed(evt);
					}
					break;
			}
		} else if (evt.isReleased()) {
			switch (evt.getButtonIndex()) {
				case 0:
					if (eventNode instanceof MouseButtonListener) {
						((MouseButtonListener)eventNode).onMouseLeftReleased(evt);
					}
					break;
				case 1:
					if (eventNode instanceof MouseButtonListener) {
						((MouseButtonListener)eventNode).onMouseRightReleased(evt);
					}
					break;
				case 2:
					if (eventNode instanceof MouseWheelListener) {
						((MouseWheelListener)eventNode).onMouseWheelReleased(evt);
					}
					break;
			}
			eventNode = null;
		}
	}
}
 
开发者ID:meltzow,项目名称:tonegodgui,代码行数:46,代码来源:Screen.java


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