Java Platform 1.2
Beta 4

Class java.awt.font.TextLayout.CaretPolicy


public static class TextLayout.CaretPolicy
extends Object
Define a policy for determining the strong caret location. This class contains one method, getStrongCaret, which is used to specify the policy which determines the strong caret in dual-caret text. The strong caret is used to move the caret to the left or right. Instances of this class can be passed to getCaretShapes, getNextLeftHit and getNextRightHit to customize strong caret selection. To specify alternate caret policies, subclass CaretPolicy and override getStrongCaret. getStrongCaret should inspect the two TextHitInfo arguments and choose one of them as the strong caret. Most clients clients do not need to use this class.

Method Summary
 TextHitInfo getStrongCaret(TextHitInfo hit1, TextHitInfo hit2, TextLayout layout)
          Choose one of the given TextHitInfo instances as a strong caret in the given TextLayout.
Methods inherited from class java.lang.Object
clone , equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait

Method Detail


public TextHitInfo getStrongCaret(TextHitInfo hit1,
                                  TextHitInfo hit2,
                                  TextLayout layout)
Choose one of the given TextHitInfo instances as a strong caret in the given TextLayout.
hit1 - A valid hit in layout
hit2 - A valid hit in layout
layout - The TextLayout in which hit1 and hit2 are used
either hit1 or hit2 (or an equivalent TextHitInfo), indicating the strong caret

Java Platform 1.2
Beta 4

Submit a bug or feature
Submit comments/suggestions about new javadoc look
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-1998 Sun Microsystems, Inc. 901 San Antonio Road,
Palo Alto, California, 94303, U.S.A. All Rights Reserved.
This documentation was generated with a post-Beta4 version of Javadoc.