| java.lang.Object org.apache.harmony.awt.gl.font.TextRunBreaker
TextRunBreaker | public class TextRunBreaker implements Cloneable(Code) | | This class is responsible for breaking the text into the run segments
with constant font, style, other text attributes and direction.
It also stores the created text run segments and covers functionality
related to the operations on the set of segments, like calculating metrics,
rendering, justification, hit testing, etc.
|
Inner Class :class JustificationInfo | |
Method Summary | |
public Object | clone() | public void | createAllSegments() Checks if text run segments are up to date and creates the new segments if not. | public void | createSegments(int runStart, int runEnd) | void | createStyleRuns() Breaks the text into separate style runs. | public void | deleteChar(AttributedCharacterIterator newParagraph, int deletePos) Deletes character from the managed text. | public void | drawSegments(Graphics2D g2d, float xOffset, float yOffset) | public boolean | equals(Object obj) | public AttributedCharacterIterator | getACI() | public int | getBaseLevel() | public Shape | getBlackBoxBounds(int firstEndpoint, int secondEndpoint) | public char | getChar(int index) | public int | getCharCount() | public float | getJustification() | public int | getLastNonWhitespace() Calculates position of the last non whitespace character
in the managed text. | public byte | getLevel(int idx) | int | getLevelRunLimit(int runStart, int runEnd) Calculates the end index of the level run, limited by the given text run. | public int | getLineBreakIndex(int start, float maxAdvance) Calculates position where line should be broken without
taking into account word boundaries. | public Rectangle2D | getLogicalBounds() | int | getLogicalFromVisual(int visual) Visual order of the characters may differ from the logical order. | public GeneralPath | getOutline() | int | getSegmentFromVisualOrder(int visual) Visual order of text segments may differ from the logical order. | int | getStyleRunLimit(int runStart, int maxPos) Starting from the current position looks for the end of the text run with
constant text attributes. | public Rectangle2D | getVisualBounds() | int | getVisualFromLogical(int logical) Visual order of the characters may differ from the logical order. | int | getVisualFromSegmentOrder(int segmentNum) Visual order of text segments may differ from the logical order. | public int | hashCode() | public TextHitInfo | hitTest(float x, float y) Calculates text hit info from the screen coordinates. | public void | insertChar(AttributedCharacterIterator newParagraph, int insertPos) Inserts character into the managed text. | public boolean | isLTR() | public void | justify(float gap) Performs justification of the managed text by changing segment positions
and positions of the glyphs inside of the segments. | public void | popSegments() | public void | pushSegments(int newSegStart, int newSegEnd) | Map<? extends Attribute, ?> | unpackAttributes(Map<? extends Attribute, ?> attrs) |
forcedFontRunStarts | int forcedFontRunStarts(Code) | | |
justification | float justification(Code) | | |
logical2segment | int logical2segment(Code) | | |
logical2visual | int logical2visual(Code) | | |
segment2visual | int segment2visual(Code) | | |
segmentsStartsegmentsEnd | int segmentsStartsegmentsEnd(Code) | | |
storedSegments | SegmentsInfo storedSegments(Code) | | |
visual2logical | int visual2logical(Code) | | |
visual2segment | int visual2segment(Code) | | |
createAllSegments | public void createAllSegments()(Code) | | Checks if text run segments are up to date and creates the new segments if not.
|
createSegments | public void createSegments(int runStart, int runEnd)(Code) | | Creates segments for the text run with
constant decoration, font and bidi level
Parameters: runStart - - run start Parameters: runEnd - - run end |
createStyleRuns | void createStyleRuns()(Code) | | Breaks the text into separate style runs.
|
deleteChar | public void deleteChar(AttributedCharacterIterator newParagraph, int deletePos)(Code) | | Deletes character from the managed text.
Parameters: newParagraph - - new character iterator Parameters: deletePos - - deletion position |
drawSegments | public void drawSegments(Graphics2D g2d, float xOffset, float yOffset)(Code) | | Renders the managed text
Parameters: g2d - - graphics where to render Parameters: xOffset - - offset in X direction to the upper left cornerof the layout from the origin of the graphics Parameters: yOffset - - offset in Y direction to the upper left cornerof the layout from the origin of the graphics |
getBaseLevel | public int getBaseLevel()(Code) | | |
getBlackBoxBounds | public Shape getBlackBoxBounds(int firstEndpoint, int secondEndpoint)(Code) | | Creates the black box bounds shape
Parameters: firstEndpoint - - start position Parameters: secondEndpoint - - end position black box bounds shape |
getChar | public char getChar(int index)(Code) | | |
getCharCount | public int getCharCount()(Code) | | |
getJustification | public float getJustification()(Code) | | |
getLastNonWhitespace | public int getLastNonWhitespace()(Code) | | Calculates position of the last non whitespace character
in the managed text.
position of the last non whitespace character |
getLevel | public byte getLevel(int idx)(Code) | | |
getLevelRunLimit | int getLevelRunLimit(int runStart, int runEnd)(Code) | | Calculates the end index of the level run, limited by the given text run.
Parameters: runStart - - run start Parameters: runEnd - - run end end index of the level run |
getLineBreakIndex | public int getLineBreakIndex(int start, float maxAdvance)(Code) | | Calculates position where line should be broken without
taking into account word boundaries.
Parameters: start - - start index Parameters: maxAdvance - - maximum advance, width of the line position where to break |
getLogicalBounds | public Rectangle2D getLogicalBounds()(Code) | | Creates logical bounds shape
logical bounds rectangle |
getLogicalFromVisual | int getLogicalFromVisual(int visual)(Code) | | Visual order of the characters may differ from the logical order.
This method calculates logical position of the character from its visual position.
Parameters: visual - - visual position logical position |
getOutline | public GeneralPath getOutline()(Code) | | Creates outline shape for the managed text
outline |
getSegmentFromVisualOrder | int getSegmentFromVisualOrder(int visual)(Code) | | Visual order of text segments may differ from the logical order.
This method calculates logical position of the segment from its visual position.
Parameters: visual - - visual position of the segment logical position of the segment |
getStyleRunLimit | int getStyleRunLimit(int runStart, int maxPos)(Code) | | Starting from the current position looks for the end of the text run with
constant text attributes.
Parameters: runStart - - start position Parameters: maxPos - - position where to stop if no run limit found style run limit |
getVisualBounds | public Rectangle2D getVisualBounds()(Code) | | Creates visual bounds shape
visual bounds rectangle |
getVisualFromLogical | int getVisualFromLogical(int logical)(Code) | | Visual order of the characters may differ from the logical order.
This method calculates visual position of the character from its logical position.
Parameters: logical - - logical position of the character visual position |
getVisualFromSegmentOrder | int getVisualFromSegmentOrder(int segmentNum)(Code) | | Visual order of text segments may differ from the logical order.
This method calculates visual position of the segment from its logical position.
Parameters: segmentNum - - logical position of the segment visual position of the segment |
hashCode | public int hashCode()(Code) | | |
hitTest | public TextHitInfo hitTest(float x, float y)(Code) | | Calculates text hit info from the screen coordinates.
Current implementation totally ignores Y coordinate.
If X coordinate is outside of the layout boundaries, this
method returns leftmost or rightmost hit.
Parameters: x - - x coordinate of the hit Parameters: y - - y coordinate of the hit hit info |
insertChar | public void insertChar(AttributedCharacterIterator newParagraph, int insertPos)(Code) | | Inserts character into the managed text.
Parameters: newParagraph - - new character iterator Parameters: insertPos - - insertion position |
isLTR | public boolean isLTR()(Code) | | |
justify | public void justify(float gap)(Code) | | Performs justification of the managed text by changing segment positions
and positions of the glyphs inside of the segments.
Parameters: gap - - amount of space which should be compensated by justification |
popSegments | public void popSegments()(Code) | | Restores the internal state of the class
|
pushSegments | public void pushSegments(int newSegStart, int newSegEnd)(Code) | | Saves the internal state of the class
Parameters: newSegStart - - new start index in the text Parameters: newSegEnd - - new end index in the text |
unpackAttributes | Map<? extends Attribute, ?> unpackAttributes(Map<? extends Attribute, ?> attrs)(Code) | | Adds InputMethodHighlight to the attributes
Parameters: attrs - - text attributes patched text attributes |
|
|