Xj3D 2.0 VRML/X3D Code API

org.xj3d.ui.swt.widgets
Class Alarm

java.lang.Object
  extended by java.util.TimerTask
      extended by org.xj3d.ui.swt.widgets.Alarm
All Implemented Interfaces:
java.lang.Runnable

public class Alarm
extends java.util.TimerTask

An alarm or timer function. This is a simple extension of a TimerTask that generates an event as a result of the Timer expiring. The class was created to separate TimerTask functionality from objects servicing swt ui objects.

Version:
$Revision: 1.1 $
Author:
Rex Melton

Field Summary
protected  AlarmListener[] alarmListenerArray
          The working array of listeners
protected static AlarmListener[] NULL_AL_ARRAY
          Initial null array of AlarmListener's
protected  AlarmEvent theEvent
          The one and only event object
 
Constructor Summary
Alarm()
          Default Constructor
Alarm(AlarmListener listener)
          Constructor
 
Method Summary
 void addAlarmListener(AlarmListener listener)
          Add a listener for AlarmEvents
protected  void fireAlarmEvent(AlarmEvent ae)
          Send a AlarmEvent to all registered listeners
 void removeAlarmListener(AlarmListener listener)
          Remove a listener for AlarmEvents
 void run()
          The Timer has expired, notify the listeners
 
Methods inherited from class java.util.TimerTask
cancel, scheduledExecutionTime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NULL_AL_ARRAY

protected static final AlarmListener[] NULL_AL_ARRAY
Initial null array of AlarmListener's


alarmListenerArray

protected AlarmListener[] alarmListenerArray
The working array of listeners


theEvent

protected AlarmEvent theEvent
The one and only event object

Constructor Detail

Alarm

public Alarm()
Default Constructor


Alarm

public Alarm(AlarmListener listener)
Constructor

Parameters:
listener - - the initial listener
Method Detail

run

public void run()
The Timer has expired, notify the listeners

Specified by:
run in interface java.lang.Runnable
Specified by:
run in class java.util.TimerTask

addAlarmListener

public void addAlarmListener(AlarmListener listener)
Add a listener for AlarmEvents

Parameters:
listener - the listener

removeAlarmListener

public void removeAlarmListener(AlarmListener listener)
Remove a listener for AlarmEvents

Parameters:
listener - the listener

fireAlarmEvent

protected void fireAlarmEvent(AlarmEvent ae)
Send a AlarmEvent to all registered listeners

Parameters:
ae - the AlarmEvent to send

Xj3D 2.0 VRML/X3D Code API

Copyright © 2001 - 2006 Web3D Consortium