All Packages Class Hierarchy This Package Previous Next Index
Class jp.kyasu.graphics.EchoTextScanner
java.lang.Object
|
+----jp.kyasu.graphics.TextScanner
|
+----jp.kyasu.graphics.EchoTextScanner
- public class EchoTextScanner
- extends TextScanner
The EchoTextScanner
class scans text to lay out text, to draw
text, and to compute the position of text. Each character in the text is
treated as the specified echo character. The EchoTextScanner
class is useful when the user input shouldn't be echoed to the screen,
as in the case of a password field.
- Version:
- 22 Jun 1998
- Author:
- Kazuki YASUMATSU
-
EchoTextScanner(RichText, int, char, Locale)
- Constructs a echo text scanner with the rich text to be scanned,
the line wrapping style, the echo character, and the locale of
the text.
-
EchoTextScanner(Text, RichTextStyle, int, char, Locale)
- Constructs a echo text scanner with the text to be scanned, the
rich text style, the line wrapping style, the echo character, and
the locale of the text.
-
charWidth(char)
- Returns the advance width of the specified character in the text.
-
charWidthAt(int, int, int, TextLineInfo, ParagraphStyle)
- Returns the advance width of a character in the specified index of text
with the specified scanning context.
-
drawLineFromTo(Graphics, Point, int, int, int, int, int, int, int, int[])
- Draws a line from the beginning index to the ending index of text.
EchoTextScanner
public EchoTextScanner(RichText richText,
int lineWrap,
char echoChar,
Locale locale)
- Constructs a echo text scanner with the rich text to be scanned,
the line wrapping style, the echo character, and the locale of
the text.
- Parameters:
- richText - the rich text to be scanned.
- lineWrap - the line wrapping style.
- echoChar - the echo character.
- locale - the locale of the text.
EchoTextScanner
public EchoTextScanner(Text text,
RichTextStyle richTextStyle,
int lineWrap,
char echoChar,
Locale locale)
- Constructs a echo text scanner with the text to be scanned, the
rich text style, the line wrapping style, the echo character, and
the locale of the text.
- Parameters:
- text - the text to be scanned.
- richTextStyle - the rich text style.
- lineWrap - the line wrapping style.
- echoChar - the echo character.
- locale - the locale of the text.
drawLineFromTo
public void drawLineFromTo(Graphics g,
Point offset,
int startX,
int beginIndex,
int endIndex,
int lineHeight,
int baseline,
int leftMgn,
int tabW,
int stops[])
- Draws a line from the beginning index to the ending index of text.
- Parameters:
- g - the graphics.
- offset - the offset position to draw.
- startX - the starting x position to draw.
- beginIndex - the beginning index of text to draw. (inclusive)
- endIndex - the ending index of text to draw. (exclusive)
- lineHeight - the height of a line.
- baseline - the baseline of a line.
- leftMgn - the left margin of a line.
- tabW - the tab width used to scan.
- stops - the stop conditions for scanning.
- Overrides:
- drawLineFromTo in class TextScanner
charWidth
public int charWidth(char ch)
- Returns the advance width of the specified character in the text.
- Parameters:
- ch - the character to be measured.
- Returns:
- the advance width of the specified character.
- Overrides:
- charWidth in class TextScanner
charWidthAt
public int charWidthAt(int textIndex,
int startX,
int layoutWidth,
TextLineInfo lineInfo,
ParagraphStyle pStyle)
- Returns the advance width of a character in the specified index of text
with the specified scanning context.
- Parameters:
- textIndex - the index of a character to be measured.
- startX - the starting x position to scan.
- layoutWidth - the composition width.
- lineInfo - the information of a line where a character is in.
- pStyle - the paragraph style of a line.
- Returns:
- the advance width of the specified character.
- Overrides:
- charWidthAt in class TextScanner
All Packages Class Hierarchy This Package Previous Next Index