BowlerKernel
|
Public Member Functions | |
abstract Controller[] | getControllers () |
void | addControllerListener (ControllerListener l) |
abstract boolean | isSupported () |
void | removeControllerListener (ControllerListener l) |
Static Public Member Functions | |
static ControllerEnvironment | getDefaultEnvironment () |
Protected Member Functions | |
ControllerEnvironment () | |
void | fireControllerAdded (Controller c) |
void | fireControllerRemoved (Controller c) |
Static Protected Member Functions | |
static void | libfix () |
Protected Attributes | |
final ArrayList | controllerListeners = new ArrayList() |
Static Private Attributes | |
static ControllerEnvironment | defaultEnvironment |
A ControllerEnvironment represents a collection of controllers that are physically or logically linked. By default, this corresponds to the environment for the local machine.
In this reference implementation, this class can also be used to register controllers with the default environment as "plug-ins". A plug-in is created by subclassing ControllerEnvironment with a class that has a public no-argument constructor, implements the net.java.games.util.plugins.Plugin interface and has a name ending in "Plugin".
(See net.java.games.input.DirectInputEnvironmentPlugin in the DXplugin part of the source tree for an example.)
When the DefaultControllerEnvrionment is instanced it uses the plugin library to look for Plugins in both [java.home]/lib/controller and [user.dir]/controller. This allows controller plugins to be installed either globally for the entire Java environment or locally for just one particular Java app.
For more information on the organization of plugins within the controller root directories, see net.java.games.util.plugins.Plugins (Note the plural – "Plugins" not "Plugin" which is just a marker interface.)
Definition at line 77 of file ControllerEnvironment.java.
|
protected |
Protected constructor for subclassing.
Definition at line 126 of file ControllerEnvironment.java.
void com.neuronrobotics.sdk.addons.gamepad.ControllerEnvironment.addControllerListener | ( | ControllerListener | l | ) |
Adds a listener for controller state change events.
Definition at line 138 of file ControllerEnvironment.java.
References com.neuronrobotics.sdk.addons.gamepad.ControllerEnvironment.controllerListeners.
|
protected |
Creates and sends an event to the controller listeners that a controller has been added.
Definition at line 162 of file ControllerEnvironment.java.
References com.neuronrobotics.sdk.addons.gamepad.ControllerEnvironment.controllerListeners.
|
protected |
Creates and sends an event to the controller listeners that a controller has been lost.
Definition at line 174 of file ControllerEnvironment.java.
References com.neuronrobotics.sdk.addons.gamepad.ControllerEnvironment.controllerListeners.
|
abstract |
Returns a list of all controllers available to this environment, or an empty array if there are no controllers in this environment.
Referenced by com.neuronrobotics.sdk.addons.gamepad.BowlerJInputDevice.controllers().
|
static |
Returns the default environment for input controllers. This usually corresponds to the environment for the local machine.
Definition at line 186 of file ControllerEnvironment.java.
References com.neuronrobotics.sdk.addons.gamepad.ControllerEnvironment.defaultEnvironment.
Referenced by com.neuronrobotics.sdk.addons.gamepad.BowlerJInputDevice.controllers().
|
abstract |
Returns the isSupported status of this environment. What makes an environment supported or not is up to the particular plugin, but may include OS or available hardware.
|
staticprotected |
Definition at line 85 of file ControllerEnvironment.java.
void com.neuronrobotics.sdk.addons.gamepad.ControllerEnvironment.removeControllerListener | ( | ControllerListener | l | ) |
Removes a listener for controller state change events.
Definition at line 153 of file ControllerEnvironment.java.
References com.neuronrobotics.sdk.addons.gamepad.ControllerEnvironment.controllerListeners.
|
protected |
List of controller listeners
Definition at line 121 of file ControllerEnvironment.java.
Referenced by com.neuronrobotics.sdk.addons.gamepad.ControllerEnvironment.addControllerListener(), com.neuronrobotics.sdk.addons.gamepad.ControllerEnvironment.fireControllerAdded(), com.neuronrobotics.sdk.addons.gamepad.ControllerEnvironment.fireControllerRemoved(), and com.neuronrobotics.sdk.addons.gamepad.ControllerEnvironment.removeControllerListener().
|
staticprivate |
The default controller environment
Definition at line 115 of file ControllerEnvironment.java.
Referenced by com.neuronrobotics.sdk.addons.gamepad.ControllerEnvironment.getDefaultEnvironment().