public class TextListScanner extends TextScanner
TextListScanner class scans text list to lay out text list,
to draw text list, and to compute the position of text list.| 修飾子とタイプ | フィールドと説明 |
|---|---|
protected java.awt.Rectangle |
clipRect
The clipping rectangle.
|
protected int |
colIndex
The column index.
|
protected static int |
COLUMN_SPACE
The column white space length.
|
protected int[] |
colWidths
The column width.
|
protected int |
colX
The column x position.
|
static int |
LIST_COLUMN
The stop condition constant that shows the character encountered
is a list tab.
|
static int[] |
LIST_COLUMN_STOPS
The stop conditions for the first 256 characters.
|
ATTACHMENT, attachments, baseline, CHAR_NOT_IN_FONT, CROSSED_X, destX, END_OF_RUN, IGNORE, JAVA_BREAK_STOPS, JAVA_STOPS, lastCondition, lastIndex, leftMargin, LINE_BREAK, LINE_SEPARATOR, lineBegin, lineEnd, lineHeight, lineWrap, LIST_STOPS, locale, metrics, NO_STOPS, notInFontChar, notInFontCharString, notInFontCharWidth, richTextStyle, rightMargin, runEnd, SIMPLE_STOPS, TAB, tabWidth, text, widths| コンストラクタと説明 |
|---|
TextListScanner(RichText richText,
int lineWrap,
java.util.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.
|
TextListScanner(Text text,
RichTextStyle richTextStyle,
int lineWrap,
java.util.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.
|
| 修飾子とタイプ | メソッドと説明 |
|---|---|
protected int |
doDrawLineStop(int stop,
java.awt.Graphics g,
java.awt.Point offset,
int drawY,
int rStart,
int rEnd,
TextStyle tStyle)
Handles the stop condition for drawing a line.
|
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.
|
protected int |
doLayoutLineStop(int stop)
Handles the stop condition for breaking text into a line.
|
protected int |
doTextPositionStop(int stop)
Handles the stop condition for computing a position of character.
|
void |
drawLineFromTo(java.awt.Graphics g,
java.awt.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.
|
protected int[] |
getStops()
Returns the stop conditions.
|
int[] |
linePositionAt(java.awt.Point point,
int startX,
int beginIndex,
int endIndex,
int leftMgn,
int tabW,
int[] stops)
Computes the positin of the character in the text.
|
void |
setClipRect(java.awt.Rectangle clipRect)
Sets the clipping rectangle.
|
charWidth, charWidth, charWidthAt, doLayoutLine, doLayoutLine, doLayoutLine, drawLine, drawLineFromTo, drawLineFromTo, drawLineFromTo, drawLineTo, drawLineTo, fastScanChars, fastScanCharsForMultiBytes, linePositionAt, linePositionAt, linePositionAt, nextTab, prevTab, scanChars, setFontMetrics, setLineWrap, setNotInFontChar, slowScanCharsprotected int[] colWidths
protected int colIndex
protected int colX
protected java.awt.Rectangle clipRect
protected static final int COLUMN_SPACE
public static final int LIST_COLUMN
public static final int[] LIST_COLUMN_STOPS
public TextListScanner(RichText richText, int lineWrap, java.util.Locale locale, int[] colWidths)
richText - the rich text style.lineWrap - the line wrapping style.locale - the locale of the text.colWidths - the column widths.public TextListScanner(Text text, RichTextStyle richTextStyle, int lineWrap, java.util.Locale locale, int[] colWidths)
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.public void setClipRect(java.awt.Rectangle clipRect)
public int doLayoutLine(int beginIndex,
int startX,
int leftMgn,
int rightMgn,
int tabW,
int lineTop,
ParagraphStyle pStyle,
int[] stops,
TextLineInfo lineInfo)
doLayoutLine クラス内 TextScannerbeginIndex - 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.-1 if no more
layout needed.public void drawLineFromTo(java.awt.Graphics g,
java.awt.Point offset,
int startX,
int beginIndex,
int endIndex,
int lineHeight,
int baseline,
int leftMgn,
int tabW,
int[] stops)
drawLineFromTo クラス内 TextScannerg - 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.public int[] linePositionAt(java.awt.Point point,
int startX,
int beginIndex,
int endIndex,
int leftMgn,
int tabW,
int[] stops)
linePositionAt クラス内 TextScannerpoint - 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.protected int doLayoutLineStop(int stop)
doLayoutLineStop クラス内 TextScannerstop - the stop condition.-1 if the scanning runs to the end;
1 if the scanning runs across the right edge or
the scanning encounters a line separator or a line break;
0 otherwise.protected int doDrawLineStop(int stop,
java.awt.Graphics g,
java.awt.Point offset,
int drawY,
int rStart,
int rEnd,
TextStyle tStyle)
doDrawLineStop クラス内 TextScannerstop - the stop condition.g - the graphics.offset - the offset position to draw.drawY - the current y position.rStart - the run start index.rEnd - the run end index.tStyle - the current text style.-1 if the scanning runs to the end;
0 otherwise.protected int doTextPositionStop(int stop)
doTextPositionStop クラス内 TextScannerstop - the stop condition.-1 if the scanning runs to the end;
1 if the scanning runs across the right edge or
the scanning encounters a line separator or a line break;
0 otherwise.protected int[] getStops()
getStops クラス内 TextScanner