本文整理汇总了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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
}
示例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);
}
}
}
示例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();
}
示例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();
}
示例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();
}
示例10: onMouseRightReleased
import com.jme3.input.event.MouseButtonEvent; //导入方法依赖的package包/类
@Override
public void onMouseRightReleased(MouseButtonEvent evt) {
if (isEnabled) {
onButtonMouseRightUp(evt, isToggled);
}
evt.setConsumed();
}
示例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();
}
示例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();
}
示例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();
}
示例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;
}
}
示例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();
}
}