BowlerKernel
Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Private Attributes | List of all members
com.neuronrobotics.sdk.addons.gamepad.ControllerEnvironment Class Referenceabstract
Inheritance diagram for com.neuronrobotics.sdk.addons.gamepad.ControllerEnvironment:
Inheritance graph
[legend]
Collaboration diagram for com.neuronrobotics.sdk.addons.gamepad.ControllerEnvironment:
Collaboration graph
[legend]

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
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ ControllerEnvironment()

com.neuronrobotics.sdk.addons.gamepad.ControllerEnvironment.ControllerEnvironment ( )
protected

Protected constructor for subclassing.

Definition at line 126 of file ControllerEnvironment.java.

Member Function Documentation

◆ addControllerListener()

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.

◆ fireControllerAdded()

void com.neuronrobotics.sdk.addons.gamepad.ControllerEnvironment.fireControllerAdded ( Controller  c)
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.

◆ fireControllerRemoved()

void com.neuronrobotics.sdk.addons.gamepad.ControllerEnvironment.fireControllerRemoved ( Controller  c)
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.

◆ getControllers()

abstract Controller [] com.neuronrobotics.sdk.addons.gamepad.ControllerEnvironment.getControllers ( )
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().

◆ getDefaultEnvironment()

static ControllerEnvironment com.neuronrobotics.sdk.addons.gamepad.ControllerEnvironment.getDefaultEnvironment ( )
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().

◆ isSupported()

abstract boolean com.neuronrobotics.sdk.addons.gamepad.ControllerEnvironment.isSupported ( )
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.

◆ libfix()

static void com.neuronrobotics.sdk.addons.gamepad.ControllerEnvironment.libfix ( )
staticprotected

Definition at line 85 of file ControllerEnvironment.java.

◆ removeControllerListener()

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.

Member Data Documentation

◆ controllerListeners

final ArrayList com.neuronrobotics.sdk.addons.gamepad.ControllerEnvironment.controllerListeners = new ArrayList()
protected

◆ defaultEnvironment

ControllerEnvironment com.neuronrobotics.sdk.addons.gamepad.ControllerEnvironment.defaultEnvironment
staticprivate
Initial value:
=
new DefaultControllerEnvironment()

The default controller environment

Definition at line 115 of file ControllerEnvironment.java.

Referenced by com.neuronrobotics.sdk.addons.gamepad.ControllerEnvironment.getDefaultEnvironment().


The documentation for this class was generated from the following file: