24 */
25 package javax.swing.text;
26
27 import java.awt.Graphics;
28 import java.awt.Point;
29 import javax.swing.Action;
30 import javax.swing.event.ChangeListener;
31
32 /**
33 * A place within a document view that represents where
34 * things can be inserted into the document model. A caret
35 * has a position in the document referred to as a dot.
36 * The dot is where the caret is currently located in the
37 * model. There is
38 * a second position maintained by the caret that represents
39 * the other end of a selection called mark. If there is
40 * no selection the dot and mark will be equal. If a selection
41 * exists, the two values will be different.
42 * <p>
43 * The dot can be placed by either calling
44 * <code>setDot</code> or <code>moveDot</code>. Setting
45 * the dot has the effect of removing any selection that may
46 * have previously existed. The dot and mark will be equal.
47 * Moving the dot has the effect of creating a selection as
48 * the mark is left at whatever position it previously had.
49 *
50 * @author Timothy Prinzing
51 */
52 public interface Caret {
53
54 /**
55 * Called when the UI is being installed into the
56 * interface of a JTextComponent. This can be used
57 * to gain access to the model that is being navigated
58 * by the implementation of this interface.
59 *
60 * @param c the JTextComponent
61 */
62 public void install(JTextComponent c);
63
64 /**
|
24 */
25 package javax.swing.text;
26
27 import java.awt.Graphics;
28 import java.awt.Point;
29 import javax.swing.Action;
30 import javax.swing.event.ChangeListener;
31
32 /**
33 * A place within a document view that represents where
34 * things can be inserted into the document model. A caret
35 * has a position in the document referred to as a dot.
36 * The dot is where the caret is currently located in the
37 * model. There is
38 * a second position maintained by the caret that represents
39 * the other end of a selection called mark. If there is
40 * no selection the dot and mark will be equal. If a selection
41 * exists, the two values will be different.
42 * <p>
43 * The dot can be placed by either calling
44 * {@code setDot} or {@code moveDot}. Setting
45 * the dot has the effect of removing any selection that may
46 * have previously existed. The dot and mark will be equal.
47 * Moving the dot has the effect of creating a selection as
48 * the mark is left at whatever position it previously had.
49 *
50 * @author Timothy Prinzing
51 */
52 public interface Caret {
53
54 /**
55 * Called when the UI is being installed into the
56 * interface of a JTextComponent. This can be used
57 * to gain access to the model that is being navigated
58 * by the implementation of this interface.
59 *
60 * @param c the JTextComponent
61 */
62 public void install(JTextComponent c);
63
64 /**
|