Methods Summary |
---|
public void | addChangeListener(javax.swing.event.ChangeListener l)Adds a listener to track whenever the caret position
has been changed.
|
public void | deinstall(javax.swing.text.JTextComponent c)Called when the UI is being removed from the
interface of a JTextComponent. This is used to
unregister any listeners that were attached.
|
public int | getBlinkRate()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.
|
public int | getDot()Fetches the current position of the caret.
|
public java.awt.Point | getMagicCaretPosition()Gets the current caret visual location.
|
public int | getMark()Fetches the current position of the mark. If there
is a selection, the mark will not be the same as
the dot.
|
public void | install(javax.swing.text.JTextComponent c)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.
|
public boolean | isSelectionVisible()Determines if the selection is currently visible.
|
public boolean | isVisible()Determines if the caret is currently visible.
|
public void | moveDot(int dot)Moves the caret position (dot) to some other position,
leaving behind the mark. This is useful for
making selections.
|
public void | paint(java.awt.Graphics g)Renders the caret.
|
public void | removeChangeListener(javax.swing.event.ChangeListener l)Removes a listener that was tracking caret position changes.
|
public void | setBlinkRate(int rate)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.
|
public void | setDot(int dot)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.
|
public void | setMagicCaretPosition(java.awt.Point p)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.
|
public void | setSelectionVisible(boolean v)Sets the visibility of the selection
|
public void | setVisible(boolean v)Sets the visibility of the caret.
|