| java.lang.Object org.apache.harmony.awt.gl.font.CaretManager
CaretManager | public class CaretManager (Code) | | This class provides functionality for creating caret and highlight shapes
(bidirectional text is also supported, but, unfortunately, not tested yet).
|
Method Summary | |
GeneralPath | connectCarets(Line2D caret1, Line2D caret2) Connects two carets to produce a highlight shape. | public float[] | getCaretInfo(TextHitInfo hitInfo) Creates caret info. | public Line2D | getCaretShape(TextHitInfo hitInfo, TextLayout layout) | public Line2D | getCaretShape(TextHitInfo hitInfo, TextLayout layout, boolean useItalic, boolean useBounds, Rectangle2D bounds) Creates a caret shape. | public Shape[] | getCaretShapes(int offset, Rectangle2D bounds, TextLayout.CaretPolicy policy, TextLayout layout) Creates caret shapes for the specified offset. | public Shape | getLogicalHighlightShape(int firstEndpoint, int secondEndpoint, Rectangle2D bounds, TextLayout layout) Creates a highlight shape from given two endpoints in the logical
representation. | public int[] | getLogicalRangesForVisualSelection(TextHitInfo hit1, TextHitInfo hit2) Suppose that the user visually selected a block of text which has
several different levels (mixed RTL and LTR), so, in the logical
representation of the text this selection may be not contigous. | public TextHitInfo | getNextLeftHit(TextHitInfo hitInfo) | public TextHitInfo | getNextRightHit(TextHitInfo hitInfo) | public Shape | getVisualHighlightShape(TextHitInfo hit1, TextHitInfo hit2, Rectangle2D bounds, TextLayout layout) Creates a highlight shape from given two hits. | public TextHitInfo | getVisualOtherHit(TextHitInfo hitInfo) For each visual caret position there are two hits. |
connectCarets | GeneralPath connectCarets(Line2D caret1, Line2D caret2)(Code) | | Connects two carets to produce a highlight shape.
Parameters: caret1 - - 1st caret Parameters: caret2 - - 2nd caret highlight shape |
getCaretInfo | public float[] getCaretInfo(TextHitInfo hitInfo)(Code) | | Creates caret info. Required for the getCaretInfo
methods of the TextLayout
Parameters: hitInfo - - specifies caret position caret info, see TextLayout.getCaretInfo documentation |
getCaretShape | public Line2D getCaretShape(TextHitInfo hitInfo, TextLayout layout, boolean useItalic, boolean useBounds, Rectangle2D bounds)(Code) | | Creates a caret shape.
Parameters: hitInfo - - hit where to place a caret Parameters: layout - - text layout Parameters: useItalic - - unused for now, was used to createslanted carets for italic text Parameters: useBounds - - true if the cared should fit into the provided bounds Parameters: bounds - - bounds for the caret caret shape |
getCaretShapes | public Shape[] getCaretShapes(int offset, Rectangle2D bounds, TextLayout.CaretPolicy policy, TextLayout layout)(Code) | | Creates caret shapes for the specified offset. On the boundaries where
the text is changing its direction this method may return two shapes
for the strong and the weak carets, in other cases it would return one.
Parameters: offset - - offset in the text. Parameters: bounds - - bounds to fit the carets into Parameters: policy - - caret policy Parameters: layout - - text layout one or two caret shapes |
getLogicalHighlightShape | public Shape getLogicalHighlightShape(int firstEndpoint, int secondEndpoint, Rectangle2D bounds, TextLayout layout)(Code) | | Creates a highlight shape from given two endpoints in the logical
representation. This shape is not always visually contiguous
Parameters: firstEndpoint - - 1st logical endpoint Parameters: secondEndpoint - - 2nd logical endpoint Parameters: bounds - - bounds to fit the shape into Parameters: layout - - text layout highlight shape |
getLogicalRangesForVisualSelection | public int[] getLogicalRangesForVisualSelection(TextHitInfo hit1, TextHitInfo hit2)(Code) | | Suppose that the user visually selected a block of text which has
several different levels (mixed RTL and LTR), so, in the logical
representation of the text this selection may be not contigous.
This methods returns a set of logical ranges for the arbitrary
visual selection represented by two hits.
Parameters: hit1 - - 1st hit Parameters: hit2 - - 2nd hit logical ranges for the selection |
getNextLeftHit | public TextHitInfo getNextLeftHit(TextHitInfo hitInfo)(Code) | | Returns the next position to the left from the current caret position
Parameters: hitInfo - - current position next position to the left |
getNextRightHit | public TextHitInfo getNextRightHit(TextHitInfo hitInfo)(Code) | | Returns the next position to the right from the current caret position
Parameters: hitInfo - - current position next position to the right |
getVisualHighlightShape | public Shape getVisualHighlightShape(TextHitInfo hit1, TextHitInfo hit2, Rectangle2D bounds, TextLayout layout)(Code) | | Creates a highlight shape from given two hits. This shape
will always be visually contiguous
Parameters: hit1 - - 1st hit Parameters: hit2 - - 2nd hit Parameters: bounds - - bounds to fit the shape into Parameters: layout - - text layout highlight shape |
getVisualOtherHit | public TextHitInfo getVisualOtherHit(TextHitInfo hitInfo)(Code) | | For each visual caret position there are two hits. For the simple LTR text one is
a trailing of the previous char and another is the leading of the next char. This
method returns the opposite hit for the given hit.
Parameters: hitInfo - - given hit opposite hit |
|
|