All Packages Class Hierarchy This Package Previous Next Index
Class jp.kyasu.graphics.TextListScanner
java.lang.Object
|
+----jp.kyasu.graphics.TextScanner
|
+----jp.kyasu.graphics.TextListScanner
- public class TextListScanner
- extends TextScanner
The TextListScanner
class scans text list to lay out text list,
to draw text list, and to compute the position of text list.
- Version:
- 22 Jun 1998
- Author:
- Kazuki YASUMATSU
-
LIST_COLUMN
- The stop condition constant that shows the character encountered
is a list tab.
-
LIST_COLUMN_STOPS
- The stop conditions for the first 256 characters.
-
TextListScanner(RichText, int, Locale, int[])
- Constructs a text list scanner with the rich text to be scanned, line
wrapping style, locale of the text, and column widths.
-
TextListScanner(Text, RichTextStyle, int, Locale, int[])
- Constructs a text list scanner with the text to be scanned, rich text
style, line wrapping style, locale of the text, and column widths.
-
doLayoutLine(int, int, int, int, int, int, ParagraphStyle, int[], TextLineInfo)
- Breaks text into a line.
-
drawLineFromTo(Graphics, Point, int, int, int, int, int, int, int, int[])
- Draws a line from the beginning index to the ending index of text.
-
linePositionAt(Point, int, int, int, int, int, int[])
- Computes the positin of the character in the text.
-
setClipRect(Rectangle)
- Sets the clipping rectangle.
LIST_COLUMN
public static final int LIST_COLUMN
- The stop condition constant that shows the character encountered
is a list tab.
- See Also:
- LIST_COL_SEPARATOR_CHAR
LIST_COLUMN_STOPS
public static final int LIST_COLUMN_STOPS[]
- The stop conditions for the first 256 characters. This constant is
used for scanning list items with list tabs.
- See Also:
- LIST_SEPARATOR_CHAR, LIST_COL_SEPARATOR_CHAR, isListSeparator
TextListScanner
public TextListScanner(RichText richText,
int lineWrap,
Locale locale,
int colWidths[])
- Constructs a text list scanner with the rich text to be scanned, line
wrapping style, locale of the text, and column widths.
- Parameters:
- richText - the rich text style.
- lineWrap - the line wrapping style.
- locale - the locale of the text.
- colWidths - the column widths.
TextListScanner
public TextListScanner(Text text,
RichTextStyle richTextStyle,
int lineWrap,
Locale locale,
int colWidths[])
- Constructs a text list scanner with the text to be scanned, rich text
style, line wrapping style, locale of the text, and column widths.
- Parameters:
- text - the text to be scanned.
- richTextStyle - the rich text style.
- lineWrap - the line wrapping style.
- locale - the locale of the text.
- colWidths - the column widths.
setClipRect
public void setClipRect(Rectangle clipRect)
- Sets the clipping rectangle.
doLayoutLine
public int doLayoutLine(int beginIndex,
int startX,
int leftMgn,
int rightMgn,
int tabW,
int lineTop,
ParagraphStyle pStyle,
int stops[],
TextLineInfo lineInfo)
- Breaks text into a line.
- Parameters:
- beginIndex - the beginning index of text to scan.
- startX - the starting x position to scan.
- leftMgn - the left margin of a line.
- rightMgn - the right margin (edge) of a line.
- tabW - the tab width used to scan.
- lineTop - the top position of a line.
- pStyle - the paragraph style of a line.
- stops - the stop conditions for scanning.
- lineInfo - the line information into which the scanning
results are stored.
- Returns:
- the next line top position, or
-1
if no more
layout needed.
- Overrides:
- doLayoutLine in class TextScanner
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
linePositionAt
public int[] linePositionAt(Point point,
int startX,
int beginIndex,
int endIndex,
int leftMgn,
int tabW,
int stops[])
- Computes the positin of the character in the text.
- Parameters:
- point - the character position in the text.
- startX - the starting x position to scan.
- beginIndex - the beginning index of a line where the character
is in.
- endIndex - the ending index of a line where the character is in.
- leftMgn - the left margin of a line.
- tabW - the tab width used to scan.
- stops - the stop conditions for scanning.
- Returns:
- the computed index and x position of the character.
- Overrides:
- linePositionAt in class TextScanner
All Packages Class Hierarchy This Package Previous Next Index