Liking cljdoc? Tell your friends :D

javax.swing.text.Caret

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.

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.
raw docstring

add-change-listenerclj

(add-change-listener this l)

Adds a listener to track whenever the caret position has been changed.

l - the change listener - javax.swing.event.ChangeListener

Adds a listener to track whenever the caret position
 has been changed.

l - the change listener - `javax.swing.event.ChangeListener`
raw docstring

deinstallclj

(deinstall this c)

Called when the UI is being removed from the interface of a JTextComponent. This is used to unregister any listeners that were attached.

c - the JTextComponent - javax.swing.text.JTextComponent

Called when the UI is being removed from the
 interface of a JTextComponent.  This is used to
 unregister any listeners that were attached.

c - the JTextComponent - `javax.swing.text.JTextComponent`
raw docstring

(get-blink-rate this)

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.

returns: the delay in milliseconds >=0. If this is zero the caret will not blink. - int

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.

returns: the delay in milliseconds >=0.  If this is
  zero the caret will not blink. - `int`
raw docstring

get-dotclj

(get-dot this)

Fetches the current position of the caret.

returns: the position >=0 - int

Fetches the current position of the caret.

returns: the position >=0 - `int`
raw docstring

get-magic-caret-positionclj

(get-magic-caret-position this)

Gets the current caret visual location.

returns: the visual position. - java.awt.Point

Gets the current caret visual location.

returns: the visual position. - `java.awt.Point`
raw docstring

get-markclj

(get-mark this)

Fetches the current position of the mark. If there is a selection, the mark will not be the same as the dot.

returns: the position >=0 - int

Fetches the current position of the mark.  If there
 is a selection, the mark will not be the same as
 the dot.

returns: the position >=0 - `int`
raw docstring

installclj

(install this 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.

c - the JTextComponent - javax.swing.text.JTextComponent

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.

c - the JTextComponent - `javax.swing.text.JTextComponent`
raw docstring

move-dotclj

(move-dot this dot)

Moves the caret position (dot) to some other position, leaving behind the mark. This is useful for making selections.

dot - the new position to move the caret to >=0 - int

Moves the caret position (dot) to some other position,
 leaving behind the mark.  This is useful for
 making selections.

dot - the new position to move the caret to >=0 - `int`
raw docstring

paintclj

(paint this g)

Renders the caret. This method is called by UI classes.

g - the graphics context - java.awt.Graphics

Renders the caret. This method is called by UI classes.

g - the graphics context - `java.awt.Graphics`
raw docstring

remove-change-listenerclj

(remove-change-listener this l)

Removes a listener that was tracking caret position changes.

l - the change listener - javax.swing.event.ChangeListener

Removes a listener that was tracking caret position changes.

l - the change listener - `javax.swing.event.ChangeListener`
raw docstring

selection-visible?clj

(selection-visible? this)

Determines if the selection is currently visible.

returns: true if the caret is visible else false - boolean

Determines if the selection is currently visible.

returns: true if the caret is visible else false - `boolean`
raw docstring

(set-blink-rate this 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.

rate - the delay in milliseconds >=0. If this is zero the caret will not blink. - int

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.

rate - the delay in milliseconds >=0. If this is zero the caret will not blink. - `int`
raw docstring

set-dotclj

(set-dot this 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.

dot - the new position to set the caret to - int

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.

dot - the new position to set the caret to - `int`
raw docstring

set-magic-caret-positionclj

(set-magic-caret-position this 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.

p - the Point to use for the saved position. This can be null to indicate there is no visual location. - java.awt.Point

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.

p - the Point to use for the saved position. This can be null to indicate there is no visual location. - `java.awt.Point`
raw docstring

set-selection-visibleclj

(set-selection-visible this v)

Sets the visibility of the selection

v - true if the caret should be shown, and false if the caret should be hidden - boolean

Sets the visibility of the selection

v - true if the caret should be shown, and false if the caret should be hidden - `boolean`
raw docstring

set-visibleclj

(set-visible this v)

Sets the visibility of the caret.

v - true if the caret should be shown, and false if the caret should be hidden - boolean

Sets the visibility of the caret.

v - true if the caret should be shown, and false if the caret should be hidden - `boolean`
raw docstring

visible?clj

(visible? this)

Determines if the caret is currently visible.

returns: true if the caret is visible else false - boolean

Determines if the caret is currently visible.

returns: true if the caret is visible else false - `boolean`
raw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close