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.
| Modifier and Type | Method and Description |
|---|---|
| public void | addChangeListener(ChangeListener
the change listener l)Adds a listener to track whenever the caret position has been changed. |
| public void | deinstall(JTextComponent
the JTextComponent c)Called when the UI is being removed from the interface of a JTextComponent. |
| public int | Returns: the delay in milliseconds >=0. If this is zero the caret will not blink.Gets the blink rate of the caret. |
| public int | |
| public Point | |
| public int | |
| public void | install(JTextComponent
the JTextComponent c)Called when the UI is being installed into the interface of a JTextComponent. |
| public boolean | Returns: true if the caret is visible else falseDetermines if the selection is currently visible. |
| public boolean | Returns: true if the caret is visible else falseDetermines if the caret is currently visible. |
| public void | moveDot(int
the new position to move the caret to >=0 dot)Moves the caret position (dot) to some other position, leaving behind the mark. |
| public void | |
| public void | removeChangeListener(ChangeListener
the change listener l)Removes a listener that was tracking caret position changes. |
| public void | setBlinkRate(int
the delay in milliseconds >=0. If this is
zero the caret will not blink. rate)Sets the blink rate of the caret. |
| public void | |
| public void | setMagicCaretPosition(Point
the Point to use for the saved position. This
can be null to indicate there is no visual location. p)Set the current caret visual location. |
| public void | setSelectionVisible(boolean
true if the caret should be shown,
and false if the caret should be hidden v)Sets the visibility of the selection |
| public void | setVisible(boolean
true if the caret should be shown,
and false if the caret should be hidden v)Sets the visibility of the caret. |
| addChangeListener | back to summary |
|---|---|
| public void addChangeListener(ChangeListener l) Adds a listener to track whenever the caret position has been changed.
| |
| deinstall | back to summary |
|---|---|
| public void deinstall(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.
| |
| getBlinkRate | back to summary |
|---|---|
| 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.
| |
| getDot | back to summary |
|---|---|
| public int getDot() Fetches the current position of the caret.
| |
| getMagicCaretPosition | back to summary |
|---|---|
| public Point getMagicCaretPosition() Gets the current caret visual location.
| |
| getMark | back to summary |
|---|---|
| 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.
| |
| install | back to summary |
|---|---|
| public void install(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.
| |
| isSelectionVisible | back to summary |
|---|---|
| public boolean isSelectionVisible() Determines if the selection is currently visible.
| |
| isVisible | back to summary |
|---|---|
| public boolean isVisible() Determines if the caret is currently visible.
| |
| moveDot | back to summary |
|---|---|
| public void moveDot(int dot) Moves the caret position (dot) to some other position, leaving behind the mark. This is useful for making selections.
| |
| paint | back to summary |
|---|---|
| public void paint(Graphics g) Renders the caret. This method is called by UI classes.
| |
| removeChangeListener | back to summary |
|---|---|
| public void removeChangeListener(ChangeListener l) Removes a listener that was tracking caret position changes.
| |
| setBlinkRate | back to summary |
|---|---|
| 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.
| |
| setDot | back to summary |
|---|---|
| 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. If the parameter is negative or beyond the length of the document, the caret is placed at the beginning or at the end, respectively.
| |
| setMagicCaretPosition | back to summary |
|---|---|
| public void setMagicCaretPosition(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.
| |
| setSelectionVisible | back to summary |
|---|---|
| public void setSelectionVisible(boolean v) Sets the visibility of the selection
| |
| setVisible | back to summary |
|---|---|
| public void setVisible(boolean v) Sets the visibility of the caret.
| |