brf.j2me.dynaworks.ui
Class ScrollTextBox

java.lang.Object
  |
  +--brf.j2me.dynaworks.ui.BasicWidget
        |
        +--brf.j2me.dynaworks.ui.TextBox
              |
              +--brf.j2me.dynaworks.ui.ScrollTextBox
All Implemented Interfaces:
UserWidget

public class ScrollTextBox
extends TextBox

Text box with a border and a scrollbar.

This class extends a simple TextBox widget and has a sub-widget as an attribute.

Version:
1.0
Author:
Bernd R. Fix
See Also:
TextBox, UserWidget

Field Summary
private  int height
          height of control.
private  ScrollBar sb
          ScrollBar widget.
private  int width
          width of control.
private  int xPos
          x-coordinate of upper-left corner of control.
private  int yPos
          y-coordinate of upper-left corner of control.
 
Fields inherited from class brf.j2me.dynaworks.ui.TextBox
breakWidth, delimiters, lineBreaks, startLine, text
 
Fields inherited from class brf.j2me.dynaworks.ui.BasicWidget
g, h, w, x, y
 
Constructor Summary
ScrollTextBox(java.lang.String s, int x, int y, int w, int h)
          constructor.
 
Method Summary
 ActionEvent handlePenDown(int xc, int yc)
          Handle a "pen down" event.
 ActionEvent handlePenMove(int xc, int yc)
          Handle a "pen move" event.
 void paint()
          Paint the user control.
 
Methods inherited from class brf.j2me.dynaworks.ui.TextBox
computeLineBreaks, getBreakPos, getNumLines, getText, setText
 
Methods inherited from class brf.j2me.dynaworks.ui.BasicWidget
, contains, handleKeyDown, handlePenUp, handleSysKeyDown, hasFocus, loseFocus, setFocus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

xPos

private int xPos
x-coordinate of upper-left corner of control.


yPos

private int yPos
y-coordinate of upper-left corner of control.


width

private int width
width of control.


height

private int height
height of control.


sb

private ScrollBar sb
ScrollBar widget.

Constructor Detail

ScrollTextBox

public ScrollTextBox(java.lang.String s,
                     int x,
                     int y,
                     int w,
                     int h)
constructor.

Parameters:
text - String - content of the text box.
x - int - x coordinate of upper-left corner.
y - int - y coordinate of upper-left corner.
w - int - width of the control.
h - int - height of the control.
Method Detail

handlePenDown

public ActionEvent handlePenDown(int xc,
                                 int yc)
Handle a "pen down" event. Return an ActionEvent if neccessary.

The method is dispatched to the associated scrollbar if neccessary.

Overrides:
handlePenDown in class BasicWidget
Parameters:
xc - int - x coordinate of hit point.
yc - int - y coordinate of hit point.
Returns:
ActionEvent - event triggered by PenDown (or null).
See Also:
ActionEvent, ScrollBar

handlePenMove

public ActionEvent handlePenMove(int xc,
                                 int yc)
Handle a "pen move" event. Return an ActionEvent if neccessary.

The method is dispatched to the associated scrollbar if neccessary.

Overrides:
handlePenMove in class BasicWidget
Parameters:
xc - int - x coordinate of pen point.
yc - int - y coordinate of pen point.
Returns:
ActionEvent - event triggered by PenMove (or null).
See Also:
ActionEvent, ScrollBar

paint

public void paint()
Paint the user control.

Overrides:
paint in class TextBox