Class DefaultCaret
- All Implemented Interfaces:
FocusListener, MouseListener, MouseMotionListener, Shape, Serializable, Cloneable, EventListener, Caret
- Direct Known Subclasses:
BasicTextUI.BasicCaret
public class DefaultCaret extends Rectangle implements Caret, FocusListener, MouseListener, MouseMotionListener
This implementation expects two sources of asynchronous notification. The timer thread fires asynchronously, and causes the caret to simply repaint the most recent bounding box. The caret also tracks change as the document is modified. Typically this will happen on the event dispatch thread as a result of some mouse or keyboard event. The caret behavior on both synchronous and asynchronous documents updates is controlled by UpdatePolicy property. The repaint of the new caret location will occur on the event thread in any case, as calls to modelToView are only safe on the event thread.
The caret acts as a mouse and focus listener on the text component it has been installed in, and defines the caret semantics based upon those events. The listener methods can be reimplemented to change the semantics. By default, the first mouse button will be used to set focus and caret position. Dragging the mouse pointer with the first mouse button will sweep out a selection that is contiguous in the model. If the associated text component is editable, the caret will become visible when focus is gained, and invisible when focus is lost.
The Highlighter bound to the associated text component is used to render the selection by default. Selection appearance can be customized by supplying a painter to use for the highlights. By default a painter is used that will render a solid color as specified in the associated text component in the SelectionColor property. This can easily be changed by reimplementing the getSelectionPainter method.
A customized caret appearance can be achieved by reimplementing the paint method. If the paint method is changed, the damage method should also be reimplemented to cause a repaint for the area needed to render the caret. The caret extends the Rectangle class which is used to hold the bounding box for where the caret was last rendered. This enables the caret to repaint in a thread-safe manner when the caret moves without making a call to modelToView which is unstable between model updates and view repair (i.e. the order of delivery to DocumentListeners is not guaranteed).
The magic caret position is set to null when the caret position changes. A timer is used to determine the new location (after the caret change). When the timer fires, if the magic caret position is still null it is reset to the current caret position. Any actions that change the caret position and want the magic caret position to remain the same, must remember the magic caret position, change the cursor, and then set the magic caret position to its original value. This has the benefit that only actions that want the magic caret position to persist (such as open/down) need to know about it.
Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. As of 1.4, support for long term storage of all JavaBeans has been added to the java.beans package. Please see XMLEncoder.
- See Also:
Nested Class Summary
Nested classes/interfaces declared in class Rectangle2D
Rectangle2D.Double, Rectangle2D.Float | Modifier and Type | Class | Description |
|---|---|---|
static class |
Rectangle2D.Double |
The Double class defines a rectangle specified in double coordinates. |
static class |
Rectangle2D.Float |
The Float class defines a rectangle specified in float coordinates. |
Field Summary
| Modifier and Type | Field | Description |
|---|---|---|
static final int |
ALWAYS_UPDATE |
Indicates that the caret position is to be always updated accordingly to the document changes regardless whether the document updates are performed on the Event Dispatching Thread or not. |
protected ChangeEvent |
changeEvent |
The change event for the model. |
protected EventListenerList |
listenerList |
The event listener list. |
static final int |
NEVER_UPDATE |
Indicates that the caret should remain at the same absolute position in the document regardless of any document updates, except when the document length becomes less than the current caret position due to removal. |
static final int |
UPDATE_WHEN_ON_EDT |
Indicates that the caret position is to be updated only when document changes are performed on the Event Dispatching Thread. |
Fields declared in class Rectangle
height, width, x, y | Modifier and Type | Field | Description |
|---|---|---|
int |
height |
The height of the Rectangle. |
int |
width |
The width of the Rectangle. |
int |
x |
The X coordinate of the upper-left corner of the Rectangle. |
int |
y |
The Y coordinate of the upper-left corner of the Rectangle. |
Fields declared in class Rectangle2D
OUT_BOTTOM, OUT_LEFT, OUT_RIGHT, OUT_TOP | Modifier and Type | Field | Description |
|---|---|---|
static final int |
OUT_BOTTOM |
The bitmask that indicates that a point lies below this Rectangle2D. |
static final int |
OUT_LEFT |
The bitmask that indicates that a point lies to the left of this Rectangle2D. |
static final int |
OUT_RIGHT |
The bitmask that indicates that a point lies to the right of this Rectangle2D. |
static final int |
OUT_TOP |
The bitmask that indicates that a point lies above this Rectangle2D. |
Constructor Summary
| Constructor | Description |
|---|---|
DefaultCaret() |
Constructs a default caret. |
Method Summary
| Modifier and Type | Method | Description |
|---|---|---|
void |
addChangeListener |
Adds a listener to track whenever the caret position has been changed. |
protected void |
adjustVisibility |
Scrolls the associated view (if necessary) to make the caret visible. |
protected void |
damage |
Damages the area surrounding the caret to cause it to be repainted in a new location. |
void |
deinstall |
Called when the UI is being removed from the interface of a JTextComponent. |
boolean |
equals |
Compares this object to the specified object. |
protected void |
fireStateChanged() |
Notifies all listeners that have registered interest for notification on this event type. |
void |
focusGained |
Called when the component containing the caret gains focus. |
void |
focusLost |
Called when the component containing the caret loses focus. |
int |
getBlinkRate() |
Gets the caret blink rate. |
ChangeListener[] |
getChangeListeners() |
Returns an array of all the change listeners registered on this caret. |
protected final JTextComponent |
getComponent() |
Gets the text editor component that this caret is bound to. |
int |
getDot() |
Fetches the current position of the caret. |
Position.Bias |
getDotBias() |
Returns the bias of the caret position. |
<T extends EventListener> |
getListeners |
Returns an array of all the objects currently registered as FooListeners upon this caret. |
Point |
getMagicCaretPosition() |
Gets the saved caret position. |
int |
getMark() |
Fetches the current position of the mark. |
Position.Bias |
getMarkBias() |
Returns the bias of the mark. |
protected Highlighter.HighlightPainter |
getSelectionPainter() |
Gets the painter for the Highlighter. |
int |
getUpdatePolicy() |
Gets the caret movement policy on document updates. |
void |
install |
Called when the UI is being installed into the interface of a JTextComponent. |
boolean |
isActive() |
Determines if the caret is currently active. |
boolean |
isSelectionVisible() |
Checks whether the current selection is visible. |
boolean |
isVisible() |
Indicates whether or not the caret is currently visible. |
void |
mouseClicked |
Called when the mouse is clicked. |
void |
mouseDragged |
Moves the caret position according to the mouse pointer's current location. |
void |
mouseEntered |
Called when the mouse enters a region. |
void |
mouseExited |
Called when the mouse exits a region. |
void |
mouseMoved |
Called when the mouse is moved. |
void |
mousePressed |
If button 1 is pressed, this is implemented to request focus on the associated text component, and to set the caret position. |
void |
mouseReleased |
Called when the mouse is released. |
protected void |
moveCaret |
Tries to move the position of the caret from the coordinates of a mouse event, using viewToModel(). |
void |
moveDot |
Moves the caret position to the specified position, with a forward bias. |
void |
moveDot |
Moves the caret position to the specified position, with the specified bias. |
void |
paint |
Renders the caret as a vertical line. |
protected void |
positionCaret |
Tries to set the position of the caret from the coordinates of a mouse event, using viewToModel(). |
void |
removeChangeListener |
Removes a listener that was tracking caret position changes. |
protected final void |
repaint() |
Cause the caret to be painted. |
void |
setBlinkRate |
Sets the caret blink rate. |
void |
setDot |
Sets the caret position and mark to the specified position, with a forward bias. |
void |
setDot |
Sets the caret position and mark to the specified position, with the specified bias. |
void |
setMagicCaretPosition |
Saves the current caret position. |
void |
setSelectionVisible |
Changes the selection visibility. |
void |
setUpdatePolicy |
Sets the caret movement policy on the document updates. |
void |
setVisible |
Sets the caret visibility, and repaints the caret. |
Methods declared in class Rectangle
add, add, add, contains, contains, contains, contains, createIntersection, createUnion, getBounds, getBounds2D, getHeight, getLocation, getSize, getWidth, getX, getY, grow, inside, intersection, intersects, isEmpty, move, outcode, reshape, resize, setBounds, setBounds, setLocation, setLocation, setRect, setSize, setSize, toString, translate, union | Modifier and Type | Method | Description |
|---|---|---|
void |
add |
Adds a point, specified by the integer arguments newx,newy to the bounds of this Rectangle. |
void |
add |
Adds the specified Point to the bounds of this Rectangle. |
void |
add |
Adds a Rectangle to this Rectangle. |
boolean |
contains |
Checks whether or not this Rectangle contains the point at the specified location (x,y). |
boolean |
contains |
Checks whether this Rectangle entirely contains the Rectangle at the specified location (X,Y) with the specified dimensions (W,H). |
boolean |
contains |
Checks whether or not this Rectangle contains the specified Point. |
boolean |
contains |
Checks whether or not this Rectangle entirely contains the specified Rectangle. |
Rectangle2D |
createIntersection |
Returns a new Rectangle2D object representing the intersection of this Rectangle2D with the specified Rectangle2D. |
Rectangle2D |
createUnion |
Returns a new Rectangle2D object representing the union of this Rectangle2D with the specified Rectangle2D. |
Rectangle |
getBounds() |
Gets the bounding Rectangle of this Rectangle. |
Rectangle2D |
getBounds2D() |
Returns a high precision and more accurate bounding box of the Shape than the getBounds method. |
double |
getHeight() |
Returns the height of the bounding Rectangle in double precision. |
Point |
getLocation() |
Returns the location of this Rectangle. |
Dimension |
getSize() |
Gets the size of this Rectangle, represented by the returned Dimension. |
double |
getWidth() |
Returns the width of the bounding Rectangle in double precision. |
double |
getX() |
Returns the X coordinate of the bounding Rectangle in double precision. |
double |
getY() |
Returns the Y coordinate of the bounding Rectangle in double precision. |
void |
grow |
Resizes the Rectangle both horizontally and vertically. |
boolean |
inside |
Deprecated. |
Rectangle |
intersection |
Computes the intersection of this Rectangle with the specified Rectangle. |
boolean |
intersects |
Determines whether or not this Rectangle and the specified Rectangle intersect. |
boolean |
isEmpty() |
Determines whether the RectangularShape is empty. |
void |
move |
Deprecated. As of JDK version 1.1, replaced by setLocation(int, int). |
int |
outcode |
Determines where the specified coordinates lie with respect to this Rectangle2D. |
void |
reshape |
Deprecated. As of JDK version 1.1, replaced by setBounds(int, int, int, int). |
void |
resize |
Deprecated. As of JDK version 1.1, replaced by setSize(int, int). |
void |
setBounds |
Sets the bounding Rectangle of this Rectangle to the specified x, y, width, and height. |
void |
setBounds |
Sets the bounding Rectangle of this Rectangle to match the specified Rectangle. |
void |
setLocation |
Moves this Rectangle to the specified location. |
void |
setLocation |
Moves this Rectangle to the specified location. |
void |
setRect |
Sets the bounds of this Rectangle to the integer bounds which encompass the specified x, y, width, and height. |
void |
setSize |
Sets the size of this Rectangle to the specified width and height. |
void |
setSize |
Sets the size of this Rectangle to match the specified Dimension. |
String |
toString() |
Returns a String representing this Rectangle and its values. |
void |
translate |
Translates this Rectangle the indicated distance, to the right along the X coordinate axis, and downward along the Y coordinate axis. |
Rectangle |
union |
Computes the union of this Rectangle with the specified Rectangle. |
Methods declared in class Rectangle2D
add, add, add, contains, contains, getPathIterator, getPathIterator, hashCode, intersect, intersects, intersectsLine, intersectsLine, outcode, setFrame, setRect, union | Modifier and Type | Method | Description |
|---|---|---|
void |
add |
Adds a point, specified by the double precision arguments newx and newy, to this Rectangle2D. |
void |
add |
Adds the Point2D object pt to this Rectangle2D. |
void |
add |
Adds a Rectangle2D object to this Rectangle2D. |
boolean |
contains |
Tests if the specified coordinates are inside the boundary of the Shape, as described by the definition of insideness. |
boolean |
contains |
Tests if the interior of the Shape entirely contains the specified rectangular area. |
PathIterator |
getPathIterator |
Returns an iteration object that defines the boundary of this Rectangle2D. |
PathIterator |
getPathIterator |
Returns an iteration object that defines the boundary of the flattened Rectangle2D. |
int |
hashCode() |
Returns the hashcode for this Rectangle2D. |
static void |
intersect |
Intersects the pair of specified source Rectangle2D objects and puts the result into the specified destination Rectangle2D object. |
boolean |
intersects |
Tests if the interior of the Shape intersects the interior of a specified rectangular area. |
boolean |
intersectsLine |
Tests if the specified line segment intersects the interior of this Rectangle2D. |
boolean |
intersectsLine |
Tests if the specified line segment intersects the interior of this Rectangle2D. |
int |
outcode |
Determines where the specified Point2D lies with respect to this Rectangle2D. |
void |
setFrame |
Sets the location and size of the outer bounds of this Rectangle2D to the specified rectangular values. |
void |
setRect |
Sets this Rectangle2D to be the same as the specified Rectangle2D. |
static void |
union |
Unions the pair of source Rectangle2D objects and puts the result into the specified destination Rectangle2D object. |
Methods declared in class RectangularShape
clone, contains, contains, getCenterX, getCenterY, getFrame, getMaxX, getMaxY, getMinX, getMinY, intersects, setFrame, setFrame, setFrameFromCenter, setFrameFromCenter, setFrameFromDiagonal, setFrameFromDiagonal | Modifier and Type | Method | Description |
|---|---|---|
Object |
clone() |
Creates a new object of the same class and with the same contents as this object. |
boolean |
contains |
Tests if a specified Point2D is inside the boundary of the Shape, as described by the definition of insideness. |
boolean |
contains |
Tests if the interior of the Shape entirely contains the specified Rectangle2D. |
double |
getCenterX() |
Returns the X coordinate of the center of the framing rectangle of the Shape in double precision. |
double |
getCenterY() |
Returns the Y coordinate of the center of the framing rectangle of the Shape in double precision. |
Rectangle2D |
getFrame() |
Returns the framing Rectangle2D that defines the overall shape of this object. |
double |
getMaxX() |
Returns the largest X coordinate of the framing rectangle of the Shape in double precision. |
double |
getMaxY() |
Returns the largest Y coordinate of the framing rectangle of the Shape in double precision. |
double |
getMinX() |
Returns the smallest X coordinate of the framing rectangle of the Shape in double precision. |
double |
getMinY() |
Returns the smallest Y coordinate of the framing rectangle of the Shape in double precision. |
boolean |
intersects |
Tests if the interior of the Shape intersects the interior of a specified Rectangle2D. |
void |
setFrame |
Sets the location and size of the framing rectangle of this Shape to the specified Point2D and Dimension2D, respectively. |
void |
setFrame |
Sets the framing rectangle of this Shape to be the specified Rectangle2D. |
void |
setFrameFromCenter |
Sets the framing rectangle of this Shape based on the specified center point coordinates and corner point coordinates. |
void |
setFrameFromCenter |
Sets the framing rectangle of this Shape based on a specified center Point2D and corner Point2D. |
void |
setFrameFromDiagonal |
Sets the diagonal of the framing rectangle of this Shape based on the two specified coordinates. |
void |
setFrameFromDiagonal |
Sets the diagonal of the framing rectangle of this Shape based on two specified Point2D objects. |
Methods declared in class Object
finalize, getClass, notify, notifyAll, wait, wait, wait | Modifier and Type | Method | Description |
|---|---|---|
protected void |
finalize() |
Deprecated, for removal: This API element is subject to removal in a future version. Finalization is deprecated and subject to removal in a future release. |
final Class |
getClass() |
Returns the runtime class of this Object. |
final void |
notify() |
Wakes up a single thread that is waiting on this object's monitor. |
final void |
notifyAll() |
Wakes up all threads that are waiting on this object's monitor. |
final void |
wait() |
Causes the current thread to wait until it is awakened, typically by being notified or interrupted. |
final void |
wait |
Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed. |
final void |
wait |
Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed. |
Field Details
UPDATE_WHEN_ON_EDT
public static final int UPDATE_WHEN_ON_EDT
- Since:
- 1.5
- See Also:
NEVER_UPDATE
public static final int NEVER_UPDATE
- Since:
- 1.5
- See Also:
ALWAYS_UPDATE
public static final int ALWAYS_UPDATE
- Since:
- 1.5
- See Also:
listenerList
protected EventListenerList listenerList
changeEvent
protected transient ChangeEvent changeEvent
Constructor Details
DefaultCaret
public DefaultCaret()
Method Details
setUpdatePolicy
public void setUpdatePolicy(int policy)
BACKSPACE is typed then caret decreases its absolute position due to removal of a character before it. Sometimes it may be useful to turn off the caret position updates so that the caret stays at the same absolute position within the document position regardless of any document updates. The following update policies are allowed:
-
NEVER_UPDATE: the caret stays at the same absolute position in the document regardless of any document updates, except when document length becomes less than the current caret position due to removal. In that case caret position is adjusted to the end of the document. The caret doesn't try to keep itself visible by scrolling the associated view when using this policy. -
ALWAYS_UPDATE: the caret always tracks document changes. For regular changes it increases its position if an insertion occurs before or at its current position, and decreases position if a removal occurs before its current position. For undo/redo updates it is always moved to the position where update occurred. The caret also tries to keep itself visible by callingadjustVisibilitymethod. -
UPDATE_WHEN_ON_EDT: acts likeALWAYS_UPDATEif the document updates are performed on the Event Dispatching Thread and likeNEVER_UPDATEif updates are performed on other thread.
The default property value is UPDATE_WHEN_ON_EDT.
- Parameters:
-
policy- one of the following values :UPDATE_WHEN_ON_EDT,NEVER_UPDATE,ALWAYS_UPDATE - Throws:
-
IllegalArgumentException- if invalid value is passed - Since:
- 1.5
- See Also:
getUpdatePolicy
public int getUpdatePolicy()
- Returns:
- one of the following values :
UPDATE_WHEN_ON_EDT,NEVER_UPDATE,ALWAYS_UPDATE - Since:
- 1.5
- See Also:
getComponent
protected final JTextComponent getComponent()
- Returns:
- the component
repaint
protected final void repaint()
This method is thread safe, although most Swing methods are not. Please see Concurrency in Swing for more information.
damage
protected void damage(Rectangle r)
- Parameters:
-
r- the current location of the caret - See Also:
adjustVisibility
protected void adjustVisibility(Rectangle nloc)
- Parameters:
-
nloc- the new position to scroll to
getSelectionPainter
protected Highlighter.HighlightPainter getSelectionPainter()
- Returns:
- the painter
positionCaret
protected void positionCaret(MouseEvent e)
- Parameters:
-
e- the mouse event
moveCaret
protected void moveCaret(MouseEvent e)
- Parameters:
-
e- the mouse event
focusGained
public void focusGained(FocusEvent e)
- Specified by:
-
focusGainedin interfaceFocusListener - Parameters:
-
e- the focus event - See Also:
focusLost
public void focusLost(FocusEvent e)
- Specified by:
-
focusLostin interfaceFocusListener - Parameters:
-
e- the focus event - See Also:
mouseClicked
public void mouseClicked(MouseEvent e)
- Specified by:
-
mouseClickedin interfaceMouseListener - Parameters:
-
e- the mouse event - See Also:
mousePressed
public void mousePressed(MouseEvent e)
- Specified by:
-
mousePressedin interfaceMouseListener - Parameters:
-
e- the mouse event - See Also:
mouseReleased
public void mouseReleased(MouseEvent e)
- Specified by:
-
mouseReleasedin interfaceMouseListener - Parameters:
-
e- the mouse event - See Also:
mouseEntered
public void mouseEntered(MouseEvent e)
- Specified by:
-
mouseEnteredin interfaceMouseListener - Parameters:
-
e- the mouse event - See Also:
mouseExited
public void mouseExited(MouseEvent e)
- Specified by:
-
mouseExitedin interfaceMouseListener - Parameters:
-
e- the mouse event - See Also:
mouseDragged
public void mouseDragged(MouseEvent e)
- Specified by:
-
mouseDraggedin interfaceMouseMotionListener - Parameters:
-
e- the mouse event - See Also:
mouseMoved
public void mouseMoved(MouseEvent e)
- Specified by:
-
mouseMovedin interfaceMouseMotionListener - Parameters:
-
e- the mouse event - See Also:
paint
public void paint(Graphics g)
If there are multiple text directions present in the associated document, a flag indicating the caret bias will be rendered. This will occur only if the associated document is a subclass of AbstractDocument and there are multiple bidi levels present in the bidi element structure (i.e. the text has multiple directions associated with it).
install
public void install(JTextComponent c)
deinstall
addChangeListener
public void addChangeListener(ChangeListener l)
- Specified by:
-
addChangeListenerin interfaceCaret - Parameters:
-
l- the listener - See Also:
removeChangeListener
public void removeChangeListener(ChangeListener l)
- Specified by:
-
removeChangeListenerin interfaceCaret - Parameters:
-
l- the listener - See Also:
getChangeListeners
public ChangeListener[] getChangeListeners()
- Returns:
- all of this caret's
ChangeListeners or an empty array if no change listeners are currently registered - Since:
- 1.4
- See Also:
fireStateChanged
protected void fireStateChanged()
- See Also:
getListeners
public <T extends EventListener> T[] getListeners(Class<T> listenerType)
FooListeners upon this caret. FooListeners are registered using the addFooListener method. You can specify the listenerType argument with a class literal, such as FooListener.class. For example, you can query a DefaultCaret c for its change listeners with the following code:
ChangeListener[] cls = (ChangeListener[])(c.getListeners(ChangeListener.class));If no such listeners exist, this method returns an empty array.
- Type Parameters:
T- the listener type- Parameters:
-
listenerType- the type of listeners requested - Returns:
- an array of all objects registered as
FooListeners on this component, or an empty array if no such listeners have been added - Throws:
-
ClassCastException- iflistenerTypedoesn't specify a class or interface that implementsjava.util.EventListener - Since:
- 1.3
- See Also:
setSelectionVisible
public void setSelectionVisible(boolean vis)
- Specified by:
-
setSelectionVisiblein interfaceCaret - Parameters:
-
vis- the new visibility
isSelectionVisible
public boolean isSelectionVisible()
- Specified by:
-
isSelectionVisiblein interfaceCaret - Returns:
- true if the selection is visible
isActive
public boolean isActive()
This method returns whether or not the Caret is currently in a blinking state. It does not provide information as to whether it is currently blinked on or off. To determine if the caret is currently painted use the isVisible method.
- Returns:
-
trueif active elsefalse - Since:
- 1.5
- See Also:
isVisible
public boolean isVisible()
isActive indicates whether or not the caret is in a blinking state, such that it can be visible, and isVisible indicates whether or not the caret is actually visible. Subclasses that wish to render a different flashing caret should override paint and only paint the caret if this method returns true.
setVisible
public void setVisible(boolean e)
isVisible and isActive. Calling this method with a value of true activates the caret blinking. Setting it to false turns it completely off. To determine whether the blinking is active, you should call isActive. In effect, isActive is an appropriate corresponding "getter" method for this one. isVisible can be used to fetch the current visibility status of the caret, meaning whether or not it is currently painted. This status will change as the caret blinks on and off. Here's a list showing the potential return values of both isActive and isVisible after calling this method:
setVisible(true):
- isActive(): true
- isVisible(): true or false depending on whether or not the caret is blinked on or off
setVisible(false):
- isActive(): false
- isVisible(): false
- Specified by:
-
setVisiblein interfaceCaret - Parameters:
-
e- the visibility specifier - See Also:
setBlinkRate
public void setBlinkRate(int rate)
- Specified by:
-
setBlinkRatein interfaceCaret - Parameters:
-
rate- the rate in milliseconds, 0 to stop blinking - See Also:
getBlinkRate
public int getBlinkRate()
- Specified by:
-
getBlinkRatein interfaceCaret - Returns:
- the delay in milliseconds. If this is zero the caret will not blink.
- See Also:
getDot
getMark
setDot
moveDot
moveDot
public void moveDot(int dot, Position.Bias dotBias)
- Parameters:
-
dot- the position >= 0 -
dotBias- the bias for this position, notnull - Throws:
-
IllegalArgumentException- if the bias isnull - Since:
- 1.6
- See Also:
setDot
public void setDot(int dot, Position.Bias dotBias)
- Parameters:
-
dot- the position >= 0 -
dotBias- the bias for this position, notnull - Throws:
-
IllegalArgumentException- if the bias isnull - Since:
- 1.6
- See Also:
getDotBias
public Position.Bias getDotBias()
- Returns:
- the bias of the caret position
- Since:
- 1.6
getMarkBias
public Position.Bias getMarkBias()
- Returns:
- the bias of the mark
- Since:
- 1.6
setMagicCaretPosition
public void setMagicCaretPosition(Point p)
- Specified by:
-
setMagicCaretPositionin interfaceCaret - Parameters:
-
p- the position - See Also:
getMagicCaretPosition
public Point getMagicCaretPosition()
- Specified by:
-
getMagicCaretPositionin interfaceCaret - Returns:
- the position see #setMagicCaretPosition
- See Also:
equals
public boolean equals(Object obj)
© 1993, 2025, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
contains(int, int).