lcarsbeans
Class LcarsTimer

java.lang.Object
  |
  +--java.awt.Component
        |
        +--lcarsbeans.LcarsTimer

public class LcarsTimer
extends java.awt.Component
implements java.io.Serializable, java.lang.Runnable

A simple (invisible) timer.
This timer is used by LcarsTrackbar, and has only the functionality needed for this purpose.
I wrote it because my browsers didnt find javax.swing.Timer.

Version:
0.9b, January 2002 (March 2001)
Author:
Andrei Scheibner, www.buffalo-as.de, andrei@buffalo-as.de
See Also:
Serialized Form

Inner classes inherited from class java.awt.Component
java.awt.Component.AWTTreeLock
 
Fields inherited from class java.awt.Component
actionListenerK, adjustmentListenerK, appContext, background, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, componentListener, componentListenerK, componentOrientation, containerListenerK, cursor, dropTarget, enabled, eventMask, focusListener, focusListenerK, font, foreground, hasFocus, height, incRate, inputMethodListener, inputMethodListenerK, isInc, isPacked, itemListenerK, keyListener, keyListenerK, LEFT_ALIGNMENT, locale, LOCK, minSize, mouseListener, mouseListenerK, mouseMotionListener, mouseMotionListenerK, newEventsOnly, ownedWindowK, parent, peer, peerFont, popups, prefSize, RIGHT_ALIGNMENT, textListenerK, TOP_ALIGNMENT, valid, visible, width, windowListenerK, x, y
 
Constructor Summary
LcarsTimer()
          Constructs a new instance.
LcarsTimer(int newDelay, int newInitialDelay)
          Another constructor.
 
Method Summary
 void addLcarsTimerFireListener(LcarsTimerFireListener l)
          Adds a listener for the LcarsTimerFireEvent.
protected  void fireLcarsTimerFire()
          Sends the Change-Event to all listeners.
 int getDelay()
          Returns the delay between two timer events.
 int getInitialDelay()
          Returns the delay between the start of the timer and the first timer event.
 boolean isRunning()
          Returns whether the timer is currently running (and firing timer events).
 void removeLcarsTimerFireListener(LcarsTimerFireListener l)
          Removes a listener for the LcarsTimerFireEvent.
 void run()
          the run() method needed for every thread.
 void setDelay(int newDelay)
          Sets the delay between two timer events.
 void setInitialDelay(int newInitialDelay)
          Sets the delay between the start of the timer and the first timer event.
 void start()
          Starts the timer.
 void stop()
          Stops the timer.
 
Methods inherited from class java.awt.Component
, action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, areInputMethodsEnabled, bounds, checkImage, checkImage, coalesceEvents, constructComponentName, contains, contains, createImage, createImage, deliverEvent, disable, disableEvents, dispatchEvent, dispatchEventImpl, doLayout, enable, enable, enableEvents, enableInputMethods, eventEnabled, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentOrientation, getCursor, getDropTarget, getFont_NoClientCode, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getName, getNativeContainer, getParent_NoClientCode, getParent, getPeer, getPreferredSize, getSize, getSize, getToolkit, getToolkitImpl, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isDisplayable, isDoubleBuffered, isEnabled, isEnabledImpl, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, lightweightPrint, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paint, paintAll, paramString, postEvent, postsOldMouseEvents, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFont, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, update, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LcarsTimer

public LcarsTimer()
Constructs a new instance.

LcarsTimer

public LcarsTimer(int newDelay,
                  int newInitialDelay)
Another constructor.
Method Detail

run

public void run()
the run() method needed for every thread.
Specified by:
run in interface java.lang.Runnable

start

public void start()
Starts the timer.

stop

public void stop()
Stops the timer.

getDelay

public int getDelay()
Returns the delay between two timer events.

setDelay

public void setDelay(int newDelay)
Sets the delay between two timer events.

getInitialDelay

public int getInitialDelay()
Returns the delay between the start of the timer and the first timer event.

setInitialDelay

public void setInitialDelay(int newInitialDelay)
Sets the delay between the start of the timer and the first timer event.

isRunning

public boolean isRunning()
Returns whether the timer is currently running (and firing timer events).

fireLcarsTimerFire

protected void fireLcarsTimerFire()
Sends the Change-Event to all listeners.

addLcarsTimerFireListener

public void addLcarsTimerFireListener(LcarsTimerFireListener l)
Adds a listener for the LcarsTimerFireEvent.

removeLcarsTimerFireListener

public void removeLcarsTimerFireListener(LcarsTimerFireListener l)
Removes a listener for the LcarsTimerFireEvent.