edu.princeton.swing.text
public class HighlightedDocument.PositionTriplet extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected HighlightedDocument.Position |
caretPosition |
static int |
NO_CHANGE
The value to pass to set so that the specified position's offset will not change.
|
protected HighlightedDocument.Position |
selectionDot |
protected HighlightedDocument.Position |
selectionMark |
Modifier | Constructor and Description |
---|---|
protected |
HighlightedDocument.PositionTriplet(HighlightedDocument.Position selectionDot,
HighlightedDocument.Position selectionMark,
HighlightedDocument.Position caretPosition)
Creates a new PositionTriplet.
|
Modifier and Type | Method and Description |
---|---|
int |
getCaretPositionOffset()
Returns the offset of the caretPosition.
|
int |
getSelectionDotOffset()
Returns the offset of the selectionDot.
|
int |
getSelectionEndOffset()
Returns the greater of the offsets of the selectionDot and selectionMark.
|
int |
getSelectionMarkOffset()
Returns the offset of the selectionMark.
|
int |
getSelectionStartOffset()
Returns the lesser of the offsets of the selectionDot and selectionMark.
|
void |
set(int selectionDotOffset,
int selectionMarkOffset,
int caretPositionOffset)
Moves the offsets of the triplets to the valid position nearest to the specified offset.
|
public static final int NO_CHANGE
protected HighlightedDocument.Position selectionDot
protected HighlightedDocument.Position selectionMark
protected HighlightedDocument.Position caretPosition
protected HighlightedDocument.PositionTriplet(HighlightedDocument.Position selectionDot, HighlightedDocument.Position selectionMark, HighlightedDocument.Position caretPosition)
public void set(int selectionDotOffset, int selectionMarkOffset, int caretPositionOffset)
selectionDotOffset
- The new offset for the selectionDot.selectionMarkOffset
- The new offset for the selectionMark.caretPositionOffset
- The new offset for the caretPosition.public int getSelectionDotOffset()
public int getSelectionMarkOffset()
public int getCaretPositionOffset()
public int getSelectionStartOffset()
public int getSelectionEndOffset()