All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class crw.awt.UpDown

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Canvas
                   |
                   +----crw.awt.UpDown

public class UpDown
extends Canvas
Arrows pointing Up and Down. Full implementation is done in the subclass within the event handling model. UpDown10 implements the Java1.0 event model and UpDown11 implements Java1.1 event model. Client classes using this custom-made AWT component uses upArrowPressed() or downArrowPressed() methods to find if any arrow is pressed. Its listener is a class that implements CustomAWT interface which should start a Thread if the arrow is pressed, and stop the Thread when released.

Version:
0.0
Author:
C.R.Wie

Variable Index

 o bottomPressed
 o dxArrow
 o dyArrow
 o height
 o listener
 o topPressed
 o width

Constructor Index

 o UpDown(int, int, Color, Color)

Method Index

 o addListener(CustomAWT)
Registers a listener object that listens to the mouse-press of the arrows.
 o downArrowPressed()
Returns true if the down-arrow is pressed.
 o paint(Graphics)
 o upArrowPressed()
Returns true if up-arrow is pressed.
 o update(Graphics)

Variables

 o width
 protected int width
 o height
 protected int height
 o dxArrow
 protected int dxArrow
 o dyArrow
 protected int dyArrow
 o topPressed
 protected boolean topPressed
 o bottomPressed
 protected boolean bottomPressed
 o listener
 protected CustomAWT listener

Constructors

 o UpDown
 public UpDown(int width,
               int height,
               Color cArrow,
               Color cBack)
Parameters:
width - the width
height - the total height of this comp
cArrow - the Color of arrows
cBack - the background Color of this component.

Methods

 o downArrowPressed
 public boolean downArrowPressed()
Returns true if the down-arrow is pressed.

Returns:
true if down-arrow is pressed.
 o upArrowPressed
 public boolean upArrowPressed()
Returns true if up-arrow is pressed.

Returns:
true if up-arrow is pressed.
 o update
 public void update(Graphics g)
Overrides:
update in class Component
 o paint
 public void paint(Graphics g)
Overrides:
paint in class Canvas
 o addListener
 public void addListener(CustomAWT custom)
Registers a listener object that listens to the mouse-press of the arrows. The CustomAWT listener is either a Thread (or Runnable) object that runs all the time or that starts running when pressed and stops the mouse is released.

Parameters:
custom - the Listener object.

All Packages  Class Hierarchy  This Package  Previous  Next  Index