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
-
bottomPressed
-
-
dxArrow
-
-
dyArrow
-
-
height
-
-
listener
-
-
topPressed
-
-
width
-
-
UpDown(int, int, Color, Color)
-
-
addListener(CustomAWT)
- Registers a listener object that listens to the mouse-press of the
arrows.
-
downArrowPressed()
- Returns true if the down-arrow is pressed.
-
paint(Graphics)
-
-
upArrowPressed()
- Returns true if up-arrow is pressed.
-
update(Graphics)
-
width
protected int width
height
protected int height
dxArrow
protected int dxArrow
dyArrow
protected int dyArrow
topPressed
protected boolean topPressed
bottomPressed
protected boolean bottomPressed
listener
protected CustomAWT listener
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.
downArrowPressed
public boolean downArrowPressed()
- Returns true if the down-arrow is pressed.
- Returns:
- true if down-arrow is pressed.
upArrowPressed
public boolean upArrowPressed()
- Returns true if up-arrow is pressed.
- Returns:
- true if up-arrow is pressed.
update
public void update(Graphics g)
- Overrides:
- update in class Component
paint
public void paint(Graphics g)
- Overrides:
- paint in class Canvas
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