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


Java MouseButtonEvent.setConsumed方法代码示例

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


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

示例1: onMouseButtonEvent

import com.jme3.input.event.MouseButtonEvent; //导入方法依赖的package包/类
@Override
public void onMouseButtonEvent(MouseButtonEvent evt) {
	if (evt.getButtonIndex() == 0) {
		BaseElement mouseFocusElement = screen.getMouseFocusElement();
		if (mouseFocusElement != null) {
			elementTree.setSelectedRowObjects(Arrays.asList(mouseFocusElement));
			highlightSelection();
			for (TableRow r : elementTree.getSelectedRows()) {
				elementTree.scrollToRow(r.getRowIndex());
				break;
			}
		}
	}
	endPick();
	evt.setConsumed();
}
 
开发者ID:rockfireredmoon,项目名称:icetone,代码行数:17,代码来源:GUIExplorerAppState.java

示例2: onMouseLeftPressed

import com.jme3.input.event.MouseButtonEvent; //导入方法依赖的package包/类
@Override
public void onMouseLeftPressed(MouseButtonEvent evt) {
	if (isEnabled) {
		if (isToggleButton) {
			if (isToggled) {
				if (!isRadioButton) isToggled = false;
			} else {
				isToggled = true;
			}
		}
		runPressedEffect(true);
		isStillPressed = true;
		initClickPause = true;
		currentInitClickTrack = 0;
		onButtonMouseLeftDown(evt, isToggled);
	}
	evt.setConsumed();
}
 
开发者ID:meltzow,项目名称:tonegodgui,代码行数:19,代码来源:Button.java

示例3: onMouseLeftReleased

import com.jme3.input.event.MouseButtonEvent; //导入方法依赖的package包/类
@Override
public void onMouseLeftReleased(MouseButtonEvent evt) {
	if (isEnabled) {
		if (!isToggleButton) {
			if (getHasFocus()) {
				runLoseFocusEffect();
				runHoverEffect(false);
			} else {
				runLoseFocusEffect();
			}
		} else {
			if (!isToggled) {
				runLoseFocusEffect();
				runHoverEffect(false);
			}
		}
		isStillPressed = false;
		initClickPause = false;
		currentInitClickTrack = 0;
		onButtonMouseLeftUp(evt, isToggled);
		if (radioButtonGroup != null)
			radioButtonGroup.setSelected(this);
	}
	evt.setConsumed();
}
 
开发者ID:meltzow,项目名称:tonegodgui,代码行数:26,代码来源:Button.java

示例4: onMouseLeftReleased

import com.jme3.input.event.MouseButtonEvent; //导入方法依赖的package包/类
@Override
public void onMouseLeftReleased(MouseButtonEvent evt) {
	if (isMultiselect) {
		if (shift || ctrl) {
			if (!selectedIndexes.contains(currentListItemIndex)) {
				addSelectedIndex(currentListItemIndex);
			} else {
				removeSelectedIndex(currentListItemIndex);
			}
		} else {
			setSelectedIndex(currentListItemIndex);
		}
	} else {
		if (currentListItemIndex >= 0 && currentListItemIndex < listItems.size())
			setSelectedIndex(currentListItemIndex);
		else
			selectedIndexes = new ArrayList();
	}
	evt.setConsumed();
}
 
开发者ID:meltzow,项目名称:tonegodgui,代码行数:21,代码来源:SelectList.java

示例5: onMouseButtonEventQueued

import com.jme3.input.event.MouseButtonEvent; //导入方法依赖的package包/类
private void onMouseButtonEventQueued(MouseButtonEvent evt, NiftyInputConsumer nic) {
    buttonIndex = evt.getButtonIndex();
    pressed = evt.isPressed();

    if (nic.processMouseEvent(x, y, 0, buttonIndex, pressed)){
        evt.setConsumed();
    }
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:9,代码来源:InputSystemJme.java

示例6: mouseButtonEvent

import com.jme3.input.event.MouseButtonEvent; //导入方法依赖的package包/类
@Override
public void mouseButtonEvent( MouseButtonEvent event, Spatial target, Spatial capture ) {

    // Buttons always consume their click events
    event.setConsumed();

    // Do our own better handling of 'click' now
    //super.mouseButtonEvent(event, target, capture);
    if( !isEnabled() )
        return;                                            

    if( event.isPressed() ) {
        setPressed(event.isPressed());
    } else if( isPressed() ) {
        // Only run the up processing if we were already pressed
        // This also handles the case where we weren't enabled before
        // but are now, etc.
        
        if( target == capture ) {
            // Then we are still over the button and we should run the
            // click
            runClick();
        }
        // If we run the up without checking properly then we
        // potentially get up events with no down event.  This messes
        // up listeners that are (correctly) expecting an up for every
        // down and no ups without downs.
        // So, any time the capture is us then we will run, else not
        if( capture == Button.this ) {
            setPressed(false);
        }
    }
}
 
开发者ID:jMonkeyEngine-Contributions,项目名称:Lemur,代码行数:34,代码来源:Button.java

示例7: onMouseLeftReleased

import com.jme3.input.event.MouseButtonEvent; //导入方法依赖的package包/类
@Override
public void onMouseLeftReleased(MouseButtonEvent evt) {
	if (rotateEnabled && useLeftMouseRotate) {
		mouseLook = false;
		if (!Screen.isAndroid()) screen.getApplication().getInputManager().setCursorVisible(true);
		bridge.getChaseCamera().onAction("ChaseCamToggleRotate", evt.isPressed(), bridge.getCurrentTPF());
	}
	evt.setConsumed();
}
 
开发者ID:meltzow,项目名称:tonegodgui,代码行数:10,代码来源:OSRViewPort.java

示例8: onMouseLeftPressed

import com.jme3.input.event.MouseButtonEvent; //导入方法依赖的package包/类
@Override
public void onMouseLeftPressed(MouseButtonEvent evt) {
	if (Screen.isAndroid()) {
		this.enabled = true;
		setHasFocus(true);
	}
	if (rotateEnabled && useLeftMouseRotate) {
		mouseLook = true;
		if (!Screen.isAndroid()) screen.getApplication().getInputManager().setCursorVisible(false);
		bridge.getChaseCamera().onAction("ChaseCamToggleRotate", evt.isPressed(), bridge.getCurrentTPF());
	}
	evt.setConsumed();
}
 
开发者ID:meltzow,项目名称:tonegodgui,代码行数:14,代码来源:OSRViewPort.java

示例9: onMouseRightPressed

import com.jme3.input.event.MouseButtonEvent; //导入方法依赖的package包/类
@Override
public void onMouseRightPressed(MouseButtonEvent evt) {
	if (isEnabled) {
		onButtonMouseRightDown(evt, isToggled);
		if (screen.getUseToolTips()) {
			
		}
	}
	evt.setConsumed();
}
 
开发者ID:meltzow,项目名称:tonegodgui,代码行数:11,代码来源:Button.java

示例10: onMouseRightReleased

import com.jme3.input.event.MouseButtonEvent; //导入方法依赖的package包/类
@Override
public void onMouseRightReleased(MouseButtonEvent evt) {
	if (isEnabled) {
		onButtonMouseRightUp(evt, isToggled);
	}
	evt.setConsumed();
}
 
开发者ID:meltzow,项目名称:tonegodgui,代码行数:8,代码来源:Button.java

示例11: onMouseRightPressed

import com.jme3.input.event.MouseButtonEvent; //导入方法依赖的package包/类
@Override
public void onMouseRightPressed(MouseButtonEvent evt) {
	if (rotateEnabled && !useLeftMouseRotate) {
		mouseLook = true;
		if (!Screen.isAndroid()) screen.getApplication().getInputManager().setCursorVisible(false);
		bridge.getChaseCamera().onAction("ChaseCamToggleRotate", evt.isPressed(), bridge.getCurrentTPF());
	}
	evt.setConsumed();
}
 
开发者ID:meltzow,项目名称:tonegodgui,代码行数:10,代码来源:OSRViewPort.java

示例12: onMouseRightReleased

import com.jme3.input.event.MouseButtonEvent; //导入方法依赖的package包/类
@Override
public void onMouseRightReleased(MouseButtonEvent evt) {
	if (Screen.isAndroid()) {
		if (!mouseLook)
			this.enabled = false;
		setHasFocus(false);
	}
	if (rotateEnabled && !useLeftMouseRotate) {
		mouseLook = false;
		if (!Screen.isAndroid()) screen.getApplication().getInputManager().setCursorVisible(true);
		bridge.getChaseCamera().onAction("ChaseCamToggleRotate", evt.isPressed(), bridge.getCurrentTPF());
	}
	evt.setConsumed();
}
 
开发者ID:meltzow,项目名称:tonegodgui,代码行数:15,代码来源:OSRViewPort.java

示例13: onMouseButtonEvent

import com.jme3.input.event.MouseButtonEvent; //导入方法依赖的package包/类
@Override
public void onMouseButtonEvent(MouseButtonEvent evt) {
    if (currentInputName == null || currentKeyButton == null) {
        return;
    }
    inputManager.removeRawInputListener(this);

    final MouseButtonTrigger trigger =
            new MouseButtonTrigger(evt.getButtonIndex());
    inputManager.deleteMapping(currentInputName);
    inputManager.addMapping(currentInputName, trigger);
    inputSettings.saveInput(currentInputName, trigger);

    try {
        app.getContext().getSettings().save(ClientMain.PREFERENCES_KEY);
    } catch (BackingStoreException ex) {
        Logger.getLogger(KeySetter.class.getName())
                .log(Level.WARNING, "Failed to save settings", ex);
    }

    app.enqueue(() -> {
        if (trigger.getMouseButton() == 0) {
            currentKeyButton.setText("Mouse Left");
        } else if (trigger.getMouseButton() == 1) {
            currentKeyButton.setText("Mouse Right");
        } else if (trigger.getMouseButton() == 2) {
            currentKeyButton.setText("Mouse Middle");
        } else {
            currentKeyButton.setText("Mouse Strange");
        }
        
        currentKeyButton = null;
        currentInputName = null;
        
        return null;
    });

    evt.setConsumed();
}
 
开发者ID:TripleSnail,项目名称:Arkhados,代码行数:40,代码来源:KeySetter.java

示例14: onMouseButtonEventQueued

import com.jme3.input.event.MouseButtonEvent; //导入方法依赖的package包/类
private void onMouseButtonEventQueued(MouseButtonEvent evt, NiftyInputConsumer nic) {
    boolean wasPressed = pressed;
    boolean forwardToNifty = true;
    
    buttonIndex = evt.getButtonIndex();
    pressed = evt.isPressed();
    
    // Mouse button raised. End dragging
    if (wasPressed && !pressed){
        if (!niftyOwnsDragging){
            forwardToNifty = false;
        }
        isDragging = false;
        niftyOwnsDragging = false;
    }

    boolean consumed = false;
    if (forwardToNifty){
        consumed = nic.processMouseEvent(x, y, 0, buttonIndex, pressed);
        if (consumed){
            evt.setConsumed();
        }
    }
    
    // Mouse button pressed. Begin dragging
    if (!wasPressed && pressed){
        isDragging = true;
        niftyOwnsDragging = consumed;
    }
}
 
开发者ID:chototsu,项目名称:MikuMikuStudio,代码行数:31,代码来源:InputSystemJme.java

示例15: dispatch

import com.jme3.input.event.MouseButtonEvent; //导入方法依赖的package包/类
protected void dispatch( MouseButtonEvent evt ) {
    if( getSession().buttonEvent(evt.getButtonIndex(), evt.getX(), evt.getY(), evt.isPressed()) ) {
        evt.setConsumed();
    }
}
 
开发者ID:jMonkeyEngine-Contributions,项目名称:Lemur,代码行数:6,代码来源:MouseAppState.java


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