From 1225afad397a89a2dc35fc8fd83fb6dd9ea91750 Mon Sep 17 00:00:00 2001 From: Julien Gouesse Date: Sun, 26 May 2019 15:00:19 +0200 Subject: Replaces Guava's Predicate by Java 8 Predicate (issue #13) --- .../main/java/com/ardor3d/extension/ui/UIHud.java | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'ardor3d-ui') diff --git a/ardor3d-ui/src/main/java/com/ardor3d/extension/ui/UIHud.java b/ardor3d-ui/src/main/java/com/ardor3d/extension/ui/UIHud.java index 451c21a..0e23d62 100644 --- a/ardor3d-ui/src/main/java/com/ardor3d/extension/ui/UIHud.java +++ b/ardor3d-ui/src/main/java/com/ardor3d/extension/ui/UIHud.java @@ -16,6 +16,7 @@ import java.util.EnumSet; import java.util.Iterator; import java.util.List; import java.util.Set; +import java.util.function.Predicate; import java.util.logging.Level; import java.util.logging.Logger; @@ -44,7 +45,6 @@ import com.ardor3d.scenegraph.Spatial; import com.ardor3d.scenegraph.hint.CullHint; import com.ardor3d.scenegraph.hint.LightCombineMode; import com.ardor3d.scenegraph.hint.TextureCombineMode; -import com.google.common.base.Predicate; /** * UIHud represents a "Heads Up Display" or the base of a game UI scenegraph. Various UI Input, dragging, events, etc. @@ -507,13 +507,15 @@ public class UIHud extends Node { if (!_mouseInputConsumed) { if (!_keyInputConsumed) { // nothing consumed - forwardTo.getApplier() - .checkAndPerformTriggers(forwardTo.getTriggers(), source, states, tpf); + forwardTo.getApplier().checkAndPerformTriggers(forwardTo.getTriggers(), source, states, + tpf); } else { // only key state consumed final TwoInputStates forwardingState = new TwoInputStates( - new InputState(KeyboardState.NOTHING, prev.getMouseState(), prev.getControllerState()), - new InputState(KeyboardState.NOTHING, curr.getMouseState(), curr.getControllerState())); + new InputState(KeyboardState.NOTHING, prev.getMouseState(), + prev.getControllerState()), + new InputState(KeyboardState.NOTHING, curr.getMouseState(), + curr.getControllerState())); forwardTo.getApplier().checkAndPerformTriggers(forwardTo.getTriggers(), source, forwardingState, tpf); } @@ -521,8 +523,10 @@ public class UIHud extends Node { if (!_keyInputConsumed) { // only mouse consumed final TwoInputStates forwardingState = new TwoInputStates( - new InputState(prev.getKeyboardState(), MouseState.NOTHING, prev.getControllerState()), - new InputState(curr.getKeyboardState(), MouseState.NOTHING, curr.getControllerState())); + new InputState(prev.getKeyboardState(), MouseState.NOTHING, + prev.getControllerState()), + new InputState(curr.getKeyboardState(), MouseState.NOTHING, + curr.getControllerState())); forwardTo.getApplier().checkAndPerformTriggers(forwardTo.getTriggers(), source, forwardingState, tpf); } else { @@ -543,7 +547,7 @@ public class UIHud extends Node { protected void setupLogicalLayer() { _logicalLayer.registerTrigger(new InputTrigger(new Predicate() { @Override - public boolean apply(final TwoInputStates arg0) { + public boolean test(final TwoInputStates arg0) { // always trigger this. return true; } -- cgit v1.2.3