net.jhid.impl.generic
Class AbstractDevice

java.lang.Object
  extended bynet.jhid.impl.generic.AbstractDevice
All Implemented Interfaces:
IDevice
Direct Known Subclasses:
LinuxDevice

public abstract class AbstractDevice
extends java.lang.Object
implements IDevice

Helper base implementation for devices.

  • Handles listeners.
  • Handles axes and buttons.


    Constructor Summary
    AbstractDevice()
               
     
    Method Summary
     void addListener(IDeviceListener aListener)
              Adds a listener that will be notified of all the events occuring on the buttons and axes of this device.
     IAxis[] getAxes()
               
     IAxis getAxis(AxisId aId)
               
     IButton getButton(ButtonId aId)
               
     IButton[] getButtons()
               
     java.util.Iterator getListenersIterator()
               
     void removeListener(IDeviceListener aListener)
              Removes a previously added listener.
     void setAxes(IAxis[] aAxes)
               
     void setButtons(IButton[] aButtons)
               
     java.lang.String toString()
               
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
     
    Methods inherited from interface net.jhid.core.devices.IDevice
    getDeviceInfo
     

    Constructor Detail

    AbstractDevice

    public AbstractDevice()
    Method Detail

    toString

    public java.lang.String toString()

    addListener

    public void addListener(IDeviceListener aListener)
    Description copied from interface: IDevice
    Adds a listener that will be notified of all the events occuring on the buttons and axes of this device.

    Specified by:
    addListener in interface IDevice

    removeListener

    public void removeListener(IDeviceListener aListener)
    Description copied from interface: IDevice
    Removes a previously added listener.

    Specified by:
    removeListener in interface IDevice

    getListenersIterator

    public java.util.Iterator getListenersIterator()

    getAxes

    public IAxis[] getAxes()
    Specified by:
    getAxes in interface IDevice
    Returns:
    All the axes of this device.

    getButtons

    public IButton[] getButtons()
    Specified by:
    getButtons in interface IDevice
    Returns:
    All the buttons of this device.

    getAxis

    public IAxis getAxis(AxisId aId)
    Specified by:
    getAxis in interface IDevice
    Returns:
    The axis with the specified identifier, or null if absent.

    getButton

    public IButton getButton(ButtonId aId)
    Specified by:
    getButton in interface IDevice
    Returns:
    The button with the specified identifier, or null if absent.

    setAxes

    public void setAxes(IAxis[] aAxes)

    setButtons

    public void setButtons(IButton[] aButtons)