A place within a document view that represents where
things can be inserted into the document model. A caret
has a position in the document referred to as a dot.
The dot is where the caret is currently located in the
model. There is
a second position maintained by the caret that represents
the other end of a selection called mark. If there is
no selection the dot and mark will be equal. If a selection
exists, the two values will be different.
The dot can be placed by either calling
setDot or moveDot. Setting
the dot has the effect of removing any selection that may
have previously existed. The dot and mark will be equal.
Moving the dot has the effect of creating a selection as
the mark is left at whatever position it previously had.
author: Timothy Prinzing version: 1.38 05/05/07
Called when the UI is being removed from the
interface of a JTextComponent. This is used to
unregister any listeners that were attached.
Parameters: c - the JTextComponent
Gets the blink rate of the caret. This determines if
and how fast the caret blinks, commonly used as one
way to attract attention to the caret.
the delay in milliseconds >= 0. If this iszero the caret will not blink.
Called when the UI is being installed into the
interface of a JTextComponent. This can be used
to gain access to the model that is being navigated
by the implementation of this interface.
Parameters: c - the JTextComponent
Moves the caret position (dot) to some other position,
leaving behind the mark. This is useful for
making selections.
Parameters: dot - the new position to move the caret to >= 0
Sets the blink rate of the caret. This determines if
and how fast the caret blinks, commonly used as one
way to attract attention to the caret.
Parameters: rate - the delay in milliseconds >= 0. If this iszero the caret will not blink.
Sets the caret position to some position. This
causes the mark to become the same as the dot,
effectively setting the selection range to zero.
If the parameter is negative or beyond the length of the document,
the caret is placed at the beginning or at the end, respectively.
Parameters: dot - the new position to set the caret to
Set the current caret visual location. This can be used when
moving between lines that have uneven end positions (such as
when caret up or down actions occur). If text flows
left-to-right or right-to-left the x-coordinate will indicate
the desired navigation location for vertical movement. If
the text flow is top-to-bottom, the y-coordinate will indicate
the desired navigation location for horizontal movement.
Parameters: p - the Point to use for the saved position. Thiscan be null to indicate there is no visual location.