com.ibm.tspaces.examples.services
Class Demo.StatusLight

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Canvas
              |
              +--com.ibm.tspaces.examples.services.Demo.StatusLight
Enclosing class:
Demo

public class Demo.StatusLight
extends java.awt.Canvas

This inner class represents that status of a component: either not running (in which case the status light is a dimmed color) or running (in which case the status light is a green color).

Author:
Joseph Gebis
See Also:
Demo, Serialized Form

Inner Class Summary
 class Demo.StatusLight.StatusLightUpdater
          This inner class actually updates the status light.
 
Field Summary
protected  Demo.ActionButton actionButton
           
protected  Demo.ButtonInterface lightButton
           
protected  boolean oldStatus
           
protected  boolean status
           
protected  Demo.StatusLight.StatusLightUpdater statusLightUpdater
           
protected  Demo.URLButton urlButton
           
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Constructor Summary
Demo.StatusLight()
          Constructor for Status Light
Demo.StatusLight(boolean status, java.awt.event.ActionListener al)
          The heart of the status light updater thread.
 
Method Summary
 Demo.ButtonInterface getButton()
          Returns the button with which this light is associated.
 java.awt.Dimension getMaximumSize()
          AWT Function
 java.awt.Dimension getMinimumSize()
          AWT Function
 boolean getOldStatus()
          Gets the old status of the light.
 java.awt.Dimension getPreferredSize()
          AWT Function
 void paint(java.awt.Graphics g)
          Paints the light
 void setOldStatus(boolean oldStatus)
          Sets the old status of the light
 void setStatus(boolean status)
          Sets the status of the light
 
Methods inherited from class java.awt.Canvas
addNotify
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, 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
 

Field Detail

status

protected boolean status

oldStatus

protected boolean oldStatus

lightButton

protected Demo.ButtonInterface lightButton

actionButton

protected Demo.ActionButton actionButton

statusLightUpdater

protected Demo.StatusLight.StatusLightUpdater statusLightUpdater

urlButton

protected Demo.URLButton urlButton
Constructor Detail

Demo.StatusLight

public Demo.StatusLight()
Constructor for Status Light

Demo.StatusLight

public Demo.StatusLight(boolean status,
                        java.awt.event.ActionListener al)
The heart of the status light updater thread.
Parameters:
status - the initial status of the light
actionButton - the action button associated with this light
Method Detail

getButton

public Demo.ButtonInterface getButton()
Returns the button with which this light is associated.
Returns:
the button with which this light is associated

setStatus

public void setStatus(boolean status)
Sets the status of the light
Parameters:
status - the status of the light

setOldStatus

public void setOldStatus(boolean oldStatus)
Sets the old status of the light
Parameters:
oldStatus - the old status of the light

getPreferredSize

public java.awt.Dimension getPreferredSize()
AWT Function
Overrides:
getPreferredSize in class java.awt.Component
Returns:
the preferred size of the light

getOldStatus

public boolean getOldStatus()
Gets the old status of the light.
Returns:
the old status of the light.

getMinimumSize

public java.awt.Dimension getMinimumSize()
AWT Function
Overrides:
getMinimumSize in class java.awt.Component
Returns:
the minimum size of the light

getMaximumSize

public java.awt.Dimension getMaximumSize()
AWT Function
Overrides:
getMaximumSize in class java.awt.Component
Returns:
the maximum size of the light

paint

public void paint(java.awt.Graphics g)
Paints the light
Overrides:
paint in class java.awt.Canvas
Parameters:
g - the graphics associated with this light