Top Description Fields Constructors Methods
net.java.games.input

public abstract Class AbstractComponent

extends Object
implements Component
Class Inheritance
All Implemented Interfaces
net.java.games.input.Component
Imports
java.io.IOException

Skeleton implementation of a named axis.

Field Summary

Modifier and TypeField and Description
private float
private boolean
private final Component.Identifier
private final String
name

Human-readable name for this Axis

private float

Constructor Summary

AccessConstructor and Description
protected
AbstractComponent(String
A name for the axis
name
,
Component.Identifier id)

Protected constructor

Method Summary

Modifier and TypeMethod and Description
public float

Returns:

0.0f by default, can be overridden
getDeadZone
()

Implements net.java.games.input.Component.getDeadZone.

Returns the suggested dead zone for this axis.
pack-priv final float
public Component.Identifier
getIdentifier()

Implements net.java.games.input.Component.getIdentifier.

Returns the type or identifier of the axis.
public String
getName()

Implements net.java.games.input.Component.getName.

Returns a human-readable name for this axis.
public final float

Returns:

The data from the last time the control has been polled.
getPollData
()

Implements net.java.games.input.Component.getPollData.

Returns the data from the last time the control has been polled.
public boolean

Returns:

false by default, can be overridden
isAnalog
()

Implements net.java.games.input.Component.isAnalog.

Returns whether or not the axis is analog, or false if it is digital.
protected abstract float
poll()

pack-priv final void
pack-priv final void
setEventValue(float event_value)

pack-priv final void
setPollData(float value)

public String
toString()

Overrides java.lang.Object.toString.

Returns a non-localized string description of this axis.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

event_valueback to summary
private float event_value
has_polledback to summary
private boolean has_polled
idback to summary
private final Component.Identifier id
nameback to summary
private final String name

Human-readable name for this Axis

valueback to summary
private float value

Constructor Detail

AbstractComponentback to summary
protected AbstractComponent(String name, Component.Identifier id)

Protected constructor

Parameters
name:String

A name for the axis

Method Detail

getDeadZoneback to summary
public float getDeadZone()

Implements net.java.games.input.Component.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.

Returns:float

0.0f by default, can be overridden

getEventValueback to summary
pack-priv final float getEventValue()
getIdentifierback to summary
public Component.Identifier getIdentifier()

Implements net.java.games.input.Component.getIdentifier.

Returns the type or identifier of the axis.

getNameback to summary
public String getName()

Implements net.java.games.input.Component.getName.

Returns a human-readable name for this axis.

getPollDataback to summary
public final float getPollData()

Implements net.java.games.input.Component.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.

Returns:float

The data from the last time the control has been polled.

isAnalogback to summary
public boolean isAnalog()

Implements net.java.games.input.Component.isAnalog.

Returns whether or not the axis is analog, or false if it is digital.

Returns:boolean

false by default, can be overridden

pollback to summary
protected abstract float poll() throws IOException
resetHasPolledback to summary
pack-priv final void resetHasPolled()
setEventValueback to summary
pack-priv final void setEventValue(float event_value)
setPollDataback to summary
pack-priv final void setPollData(float value)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Returns a non-localized string description of this axis.

Returns:String

Doc from java.lang.Object.toString.

a string representation of the object