wiiremotej.event
Class WREvent

java.lang.Object
  extended by java.util.EventObject
      extended by wiiremotej.event.WREvent
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
WRAccelerationEvent, WRButtonEvent, WRCombinedEvent, WRDataEvent, WRExtensionEvent, WRIREvent, WRStatusEvent

public class WREvent
extends java.util.EventObject

Event for Nintendo (R) Wii Remote (TM). Super-class for all events. WREvents are immutable and all subclasses should be immutable as well. All subclasses should also try to provide a user-friendly constructor for testing purposes. For instance, if an event takes an array of bytes and turns it into a String representing a name, the event should provide a constructor where the user can specify a String for the name directly. Note that these test constructors may allow the user to create events with impossible data (such as a WRIREvent with an X position greater than 100% (1) of the screen). These constructors are primarily for testing. If the user uses them for any other purpose, then it is the user's responsibility to ensure that valid data is provided. Otherwise, the expected results are not guaranteed.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
WREvent(WiiRemote source)
          Creates a new WREvent with the WiiRemote source.
 
Method Summary
 WiiRemote getSource()
          The WiiRemote on which the Event initially occurred.
 
Methods inherited from class java.util.EventObject
toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WREvent

public WREvent(WiiRemote source)
Creates a new WREvent with the WiiRemote source.

Parameters:
source - the WiiRemote triggering this event.
Method Detail

getSource

public WiiRemote getSource()
The WiiRemote on which the Event initially occurred.

Overrides:
getSource in class java.util.EventObject
Returns:
the WiiRemote on which the Event initially occurred.