Package net.java.games.input
Class AbstractComponent
java.lang.Object
net.java.games.input.AbstractComponent
- All Implemented Interfaces:
- Component
- Direct Known Subclasses:
- LinuxJoystickPOV,- WinTabComponent
Skeleton implementation of a named axis.
- 
Nested Class SummaryNested classes/interfaces inherited from interface net.java.games.input.ComponentComponent.Identifier, Component.POV
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedAbstractComponent(String name, Component.Identifier id) Protected constructor
- 
Method SummaryModifier and TypeMethodDescriptionfloatReturns the suggested dead zone for this axis.Returns the type or identifier of the axis.getName()Returns a human-readable name for this axis.final floatReturns the data from the last time the control has been polled.booleanisAnalog()Returns whether or not the axis is analog, or false if it is digital.protected abstract floatpoll()toString()Returns a non-localized string description of this axis.Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface net.java.games.input.ComponentisRelative
- 
Constructor Details- 
AbstractComponentProtected constructor- Parameters:
- name- A name for the axis
 
 
- 
- 
Method Details- 
getIdentifierReturns the type or identifier of the axis.- Specified by:
- getIdentifierin interface- Component
 
- 
isAnalogpublic boolean isAnalog()Returns whether or not the axis is analog, or false if it is digital.
- 
getDeadZonepublic float getDeadZone()Returns the suggested dead zone for this axis. Dead zone is the amount polled data can vary before considered a significant change in value. An application can safely ignore changes less than this value in the positive or negative direction.- Specified by:
- getDeadZonein interface- Component
- Returns:
- 0.0f by default, can be overridden
- See Also:
 
- 
getPollDatapublic final float getPollData()Returns the data from the last time the control has been polled. If this axis is a button, the value returned will be either 0.0f or 1.0f. If this axis is normalised, the value returned will be between -1.0f and 1.0f.- Specified by:
- getPollDatain interface- Component
- Returns:
- The data from the last time the control has been polled.
- See Also:
 
- 
getNameReturns a human-readable name for this axis.
- 
toStringReturns a non-localized string description of this axis.
- 
poll- Throws:
- IOException
 
 
-