|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectnet.java.games.input.AbstractController
public abstract class AbstractController
An AbstractController is a skeleton implementation of a controller that contains a fixed number of axes, controllers, and rumblers.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface net.java.games.input.Controller |
|---|
Controller.PortType, Controller.Type |
| Constructor Summary | |
|---|---|
protected |
AbstractController(java.lang.String name,
Component[] components,
Controller[] children,
Rumbler[] rumblers)
Protected constructor for a controller containing the specified axes, child controllers, and rumblers |
| Method Summary | |
|---|---|
Component |
getComponent(Component.Identifier id)
Returns a single component based on its identifier, or null if no component with the specified type could be found. |
Component[] |
getComponents()
Returns the components on this controller, in order of assignment priority. |
Controller[] |
getControllers()
Returns the controllers connected to make up this controller, or an empty array if this controller contains no child controllers. |
EventQueue |
getEventQueue()
Get the device event queue |
java.lang.String |
getName()
Returns a human-readable name for this Controller. |
protected abstract boolean |
getNextDeviceEvent(Event event)
|
int |
getPortNumber()
Returns the zero-based port number for this Controller. |
Controller.PortType |
getPortType()
Returns the port type for this Controller. |
Rumbler[] |
getRumblers()
Returns the rumblers for sending feedback to this controller, or an empty array if there are no rumblers on this controller. |
Controller.Type |
getType()
Returns the type of the Controller. |
boolean |
poll()
Polls axes for data. |
protected void |
pollDevice()
|
protected void |
setDeviceEventQueueSize(int size)
Plugins override this method to adjust their internal event queue size |
void |
setEventQueueSize(int size)
Creates a new EventQueue. |
java.lang.String |
toString()
Returns a non-localized string description of this controller. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
protected AbstractController(java.lang.String name,
Component[] components,
Controller[] children,
Rumbler[] rumblers)
name - name for the controllercomponents - components for the controllerchildren - child controllers for the controllerrumblers - rumblers for the controller| Method Detail |
|---|
public final Controller[] getControllers()
getControllers in interface Controllerpublic final Component[] getComponents()
getComponents in interface Controllerpublic final Component getComponent(Component.Identifier id)
getComponent in interface Controllerpublic final Rumbler[] getRumblers()
getRumblers in interface Controllerpublic Controller.PortType getPortType()
getPortType in interface Controllerpublic int getPortNumber()
getPortNumber in interface Controllerpublic final java.lang.String getName()
getName in interface Controllerpublic java.lang.String toString()
toString in class java.lang.Objectpublic Controller.Type getType()
getType in interface Controllerpublic final void setEventQueueSize(int size)
setEventQueueSize in interface Controller
protected void setDeviceEventQueueSize(int size)
throws java.io.IOException
java.io.IOExceptionpublic final EventQueue getEventQueue()
Controller
getEventQueue in interface Controller
protected abstract boolean getNextDeviceEvent(Event event)
throws java.io.IOException
java.io.IOException
protected void pollDevice()
throws java.io.IOException
java.io.IOExceptionpublic boolean poll()
Controller
poll in interface Controller
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||