|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.sun.kjava.TextBox | +--monrovia.client.ui.BasicScrollTextBox
A scrolling TextBox object. This is basically the com.sun.kjava.ScrollTextBox object with the bugs ironed out. I was unable to subclass ScrollTextBox and still get access to the bugs, so this is my interim solution. You need to control this class from a registered Spotlet. In the Spotlet class, implement penDown(), penMove() and keyDown() to call the handlePenDown(), handlePenMove() and handleKeyDown() methods of this class.
Field Summary | |
protected int |
curVal
|
protected int |
maxVal
|
protected int |
minVal
|
protected int |
numLines
|
protected java.lang.StringBuffer |
textBuffer
|
protected int |
visibleLines
|
protected com.sun.kjava.VerticalScrollBar |
vsb
|
Fields inherited from class com.sun.kjava.TextBox |
g, height, heightM, lineEnds, lineStarts, text, width, widthM, xPos, yPos |
Constructor Summary | |
protected |
BasicScrollTextBox()
|
|
BasicScrollTextBox(java.lang.String t,
int x,
int y,
int w,
int h)
Create a new ScrollTextBox2 object. |
Method Summary | |
void |
addText(java.lang.String t)
Add new text to the end of the text box. |
boolean |
contains(int x,
int y)
Is this point inside the bounds of the object? |
java.lang.String |
getText()
|
void |
handleKeyDown(int keyCode)
The user pressed a key. |
void |
handlePenDown(int x,
int y)
The pen has gone down at (x, y). |
void |
handlePenMove(int x,
int y)
The pen has moved at (x, y). |
protected void |
init()
Initialize the object. |
void |
paint(boolean pForce)
Paint the ScrollTextBox2. |
void |
setBounds(int x,
int y,
int w,
int h)
Reset the display bounds of the ScrollTextBox2. |
void |
setScrollValue(int val)
Set the current scroll value and repaint. |
void |
setText(java.lang.String t)
Set the text. |
Methods inherited from class com.sun.kjava.TextBox |
getNumLines, paint |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.lang.StringBuffer textBuffer
protected com.sun.kjava.VerticalScrollBar vsb
protected int minVal
protected int maxVal
protected int curVal
protected int visibleLines
protected int numLines
Constructor Detail |
protected BasicScrollTextBox()
public BasicScrollTextBox(java.lang.String t, int x, int y, int w, int h)
t
- the initial textx
- the X coordinate of the ScrollTextBox2's positiony
- the Y coordinate of the ScrollTextBox2's positionw
- the widthh
- the heightMethod Detail |
public void setBounds(int x, int y, int w, int h)
setBounds
in class com.sun.kjava.TextBox
x
- the new X coordinate of the ScrollTextBox2's positiony
- the new Y coordinate of the ScrollTextBox2's positionw
- the new widthh
- the new heightpublic java.lang.String getText()
public void setText(java.lang.String t)
setText
in class com.sun.kjava.TextBox
t
- a String representing the new text.public void addText(java.lang.String t)
t
- a String representing the new text.public void handleKeyDown(int keyCode)
keyCode
- a code representing the key the user pressedprotected void init()
public boolean contains(int x, int y)
x
- the X coordinate of the position to testy
- the Y coordinate of the position to testpublic void handlePenDown(int x, int y)
x
- the X coordinate of the pen positiony
- the Y coordinate of the pen positionpublic void handlePenMove(int x, int y)
x
- the X coordinate of the pen positiony
- the Y coordinate of the pen positionpublic void paint(boolean pForce)
pForce
- true if we want to paint even if nothing was changed,
false otherwisepublic void setScrollValue(int val)
setScrollValue
in interface com.sun.kjava.ScrollOwner
val
- the new scroll value.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |