Package jme3utilities
Class SignalTracker
java.lang.Object
jme3utilities.SignalTracker
Track the active/inactive status of named signals. A signal may originate
from multiple sources such as buttons or hotkeys. A signal is active as long
as any of its sources is active.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
logger
message logger for this class
-
-
Constructor Details
-
SignalTracker
public SignalTracker()A no-arg constructor to avoid javadoc warnings from JDK 18.
-
-
Method Details
-
add
Add a new signal with all of its sources inactive. If the signal name is already in use, this has no effect.- Parameters:
name- the name for the signal (not null)
-
setActive
Update whether a named signal source is active.- Parameters:
signalName- the signal's name (not null)sourceIndex- the index of the signal source (key or button) which is being updatednewState- true if the source has gone active; false if the source has gone inactive
-
test
Test whether the named signal is active.- Parameters:
signalName- the name of the signal (not null)- Returns:
- true if any of the signal's sources is active, otherwise false
-