aboutsummaryrefslogtreecommitdiffstats
path: root/ardor3d-ui
diff options
context:
space:
mode:
authorJulien Gouesse <[email protected]>2019-05-26 15:00:19 +0200
committerJulien Gouesse <[email protected]>2019-05-26 15:00:19 +0200
commit1225afad397a89a2dc35fc8fd83fb6dd9ea91750 (patch)
treec53c971f776af696f454bcc720f655fa36f05814 /ardor3d-ui
parenta92a4b9678caf7a7604729dd6130703305839e91 (diff)
Replaces Guava's Predicate by Java 8 Predicate (issue #13)
Diffstat (limited to 'ardor3d-ui')
-rw-r--r--ardor3d-ui/src/main/java/com/ardor3d/extension/ui/UIHud.java20
1 files changed, 12 insertions, 8 deletions
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<TwoInputStates>() {
@Override
- public boolean apply(final TwoInputStates arg0) {
+ public boolean test(final TwoInputStates arg0) {
// always trigger this.
return true;
}