|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.mot.lnf.TextView
The TextView class encapsulates all the logic needed to render multiple and single line text. To that end, this class helps maintain a separation of data from the view of that data. Static or edited text can be displayed with this class. Included is support for cursor rendering, masked text, and text selection. Also supported is cursor movement on a line to line basis per the current view of text rendered.
Method Summary | |
int |
getAvailableWidth()
Get the width available to display this text view |
char[] |
getChars()
Get the character array displayed by this TextView |
int |
getCursorIndex()
Get the index of the cursor location |
int |
getFirstRowHeight()
Get the height of the first row in this text view |
int |
getFirstRowIndent()
This method returns the number of pixels the first row of text is indented. |
abstract int |
getFirstRowWidth()
This method returns the width of the first row of text |
int |
getFitPolicy()
Get the fit policy being used by this TextView |
javax.microedition.lcdui.Font |
getFont()
Get the font being used to render characters in this TextView |
abstract int |
getHeight()
Get the height required to display all the characters in this TextView |
int |
getLastRowHeight()
Get the height of the last row in this text view |
abstract int |
getLastRowWidth()
This method returns the width of the last row of text |
int |
getLayout()
Get the layout of this TextView |
int |
getNumChars()
Get the number of characters contained in this TextView |
abstract boolean |
isMultiLine()
Find out if this TextView is displayed on multiple lines |
abstract boolean |
moveCursor(int direction)
Move the cursor up or down |
abstract void |
paint(javax.microedition.lcdui.Graphics g)
This method is used to paint the TextView to a Graphics object. |
abstract void |
reformatRow(int index)
Reformat text starting at the beginning of the row containing the given index |
void |
reformatText()
Reformat text which needs updating |
abstract void |
reformatText(int index)
Reformat the contents of this TextView |
void |
setAvailableWidth(int w)
Set the width available for this TextView |
void |
setChars(char[] c,
int num)
Set the characters to be displayed in this TextView |
void |
setCursorIndex(int idx)
Set the index of where the cursor is located in this TextField |
void |
setDecimalMode(boolean dec,
char decChar)
Turn decimal mode on or off |
void |
setFirstRowHeight(int rowHeight)
This method is used to manually set row heights. |
void |
setFirstRowIndent(int inset)
This method sets the horizontal inset of the first row for this TextView. |
void |
setFitPolicy(int newPolicy)
Set the fit policy for this TextView. |
void |
setFont(javax.microedition.lcdui.Font f)
This method sets the font for the TextView. |
void |
setLastRowHeight(int rowHeight)
This method is used to manually set row heights. |
void |
setLayout(int lyt)
Set the layout for this TextView |
void |
setNumChars(int num)
Set the number of valid characters in the character array |
void |
setPasswordMode(boolean hide)
Turn password mode on or off |
void |
setXPosition(int newX)
Set the x position for contents of this TextView |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public abstract int getFirstRowWidth()
public abstract int getHeight()
public abstract int getLastRowWidth()
public abstract boolean isMultiLine()
public abstract boolean moveCursor(int direction)
direction
- to move the cursor, one of Canvas.UP or Canvas.DOWNpublic abstract void paint(javax.microedition.lcdui.Graphics g)
g
- the graphics object to be painted to.public abstract void reformatText(int index)
index
- of character to start updatingpublic abstract void reformatRow(int index)
index
- which needs updatingpublic int getAvailableWidth()
public char[] getChars()
public int getCursorIndex()
public int getFirstRowHeight()
public int getFirstRowIndent()
public int getFitPolicy()
public javax.microedition.lcdui.Font getFont()
public int getLastRowHeight()
public int getLayout()
public int getNumChars()
public void reformatText()
public void setAvailableWidth(int w)
w
- the new width to be used in this TextViewpublic void setChars(char[] c, int num)
c
- the characters to be displayedpublic void setCursorIndex(int idx)
idx
- new index of the cursorpublic void setFirstRowHeight(int rowHeight)
rowHeight
- the height for that row.public void setFirstRowIndent(int inset)
inset
- the width in pixels of the inset for the first row.public void setFitPolicy(int newPolicy)
newPolicy
- the fit policy to be used in this TextViewpublic void setFont(javax.microedition.lcdui.Font f)
f
- the new font to use to render characters on this TextView.public void setLastRowHeight(int rowHeight)
rowHeight
- the height for that row.public void setLayout(int lyt)
lyt
- new layout directive for this TextView, a combination of
layout directives, as specified in javax.microedition.lcdui.Item.public void setNumChars(int num)
num
- How many valid chars are in the current char arraypublic void setPasswordMode(boolean hide)
hide
- true if contents should be hiddenpublic void setDecimalMode(boolean dec, char decChar)
dec
- true if the text is under DECIMAL constraintsdecChar
- character to use to display the decimalpublic void setXPosition(int newX)
newX
- New x position
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |