Game Control Plus
1.2.2
|
Public Member Functions | |
abstract Controller[] | getControllers () |
void | addControllerListener (ControllerListener l) |
void | removeControllerListener (ControllerListener l) |
Static Public Member Functions | |
static ControllerEnvironment | getEnvironment () |
Protected Member Functions | |
ControllerEnvironment () | |
void | fireControllerAdded (Controller c) |
void | fireControllerRemoved (Controller c) |
Protected Attributes | |
final ArrayList | controllerListeners = new ArrayList() |
Static Protected Attributes | |
static final byte | MACOSX = 0 |
static final byte | WINDOWS = 1 |
static final byte | LINUX = 2 |
static final byte | OTHER = 3 |
static final byte | os = getOS() |
static final byte | wordsize = getWordSize() |
Static Package Functions | |
static void | logln (String msg) |
static void | log (String msg) |
Static Private Member Functions | |
static byte | getOS () |
static byte | getWordSize () |
Static Private Attributes | |
static ControllerEnvironment | instance |
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.)
|
protected |
Protected constructor for subclassing.
void net.java.games.input.ControllerEnvironment.addControllerListener | ( | ControllerListener | l | ) |
Adds a listener for controller state change events.
|
protected |
Creates and sends an event to the controller listeners that a controller has been added.
|
protected |
Creates and sends an event to the controller listeners that a controller has been lost.
|
pure virtual |
Returns a list of all controllers available to this environment, or an empty array if there are no controllers in this environment.
Implemented in net.java.games.input.DirectInputEnvironmentPlugin, net.java.games.input.OSXEnvironmentPlugin, net.java.games.input.RawInputEnvironmentPlugin, and net.java.games.input.LinuxEnvironmentPlugin.
|
static |
Gives back the Environment fitting for your OS
|
staticprivate |
Returns the Byte for the OS the lib is running on. 0 for MACOSX 1 for WINDOWS 2 for LINUX 3 for OTHER
|
staticprivate |
Returns the platform word size.
32 - for 32 bit OS 64 - for 64 bit OS 0 - unknown
void net.java.games.input.ControllerEnvironment.removeControllerListener | ( | ControllerListener | l | ) |
Removes a listener for controller state change events.
|
protected |
Folder to the native libs List of controller listeners
|
staticprotected |
Standing for LINUX
|
staticprotected |
Standing for MACOSX
|
staticprotected |
System the lib is currently running on, can be MACOSX, WINDOWS, LINUX or OTHER
|
staticprotected |
Standing for any other System
|
staticprotected |
Standing for WINDOWS
|
staticprotected |
Platform specific word size i.e. 32 or 64. If 0 (zero) then it is unknow