|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.plaf.ComponentUI
javax.swing.plaf.TextUI
public abstract class TextUI
An abstract base class for delegates that provide the user interface for text editors.
JTextComponent
Constructor Summary | |
---|---|
TextUI()
Constructs a new TextUI . |
Method Summary | |
---|---|
abstract void |
damageRange(JTextComponent tc,
int start,
int end)
Repaints a range of characters. |
abstract void |
damageRange(JTextComponent tc,
int start,
int end,
Position.Bias startBias,
Position.Bias endBias)
Repaints a range of characters, also specifying the bias for the start and end of the range. |
abstract EditorKit |
getEditorKit(JTextComponent tc)
Retrieves the EditorKit managing policies and
persistent state. |
abstract int |
getNextVisualPositionFrom(JTextComponent tc,
int pos,
Position.Bias bias,
int direction,
Position.Bias[] outBias)
Calculates the caret position that is visually next to the given position. |
abstract View |
getRootView(JTextComponent tc)
Retrieves the root of the view tree that visually presents the text. |
String |
getToolTipText(JTextComponent tc,
Point loc)
Returns a String for presenting a tool tip at the specified location. |
abstract Rectangle |
modelToView(JTextComponent tc,
int pos)
Calculates the geometric extent of the character at the given offset. |
abstract Rectangle |
modelToView(JTextComponent tc,
int pos,
Position.Bias bias)
Calculates the geometric extent of the character at the given offset. |
abstract int |
viewToModel(JTextComponent t,
Point pt)
Finds the caret position which is closest to the specified visual location. |
abstract int |
viewToModel(JTextComponent tc,
Point loc,
Position.Bias[] outBias)
Finds the caret position which is closest to the specified visual location. |
Methods inherited from class javax.swing.plaf.ComponentUI |
---|
contains, createUI, getAccessibleChild, getAccessibleChildrenCount, getMaximumSize, getMinimumSize, getPreferredSize, installUI, paint, uninstallUI, update |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TextUI()
TextUI
.
Method Detail |
---|
public abstract Rectangle modelToView(JTextComponent tc, int pos) throws BadLocationException
tc
- the JTextComponent
for which this
delegate object provides the user interface.pos
- the zero-based index of the character into the
document model.
pos
, in view coordinates.
BadLocationException
- if pos
does not
designate a valid position in the document model.ComponentView.modelToView(int, Shape, Position.Bias)
public abstract Rectangle modelToView(JTextComponent tc, int pos, Position.Bias bias) throws BadLocationException
tc
- the JTextComponent
for which this
delegate object provides the user interface.pos
- the zero-based index of the character into the
document model.bias
- whether to take the character before or after the
caret position indicated by pos
. The value
must be either Position.Bias.Backward
or Position.Bias.Forward
.
pos
, in view coordinates.
BadLocationException
- if pos
does not
designate a valid position in the document model.ComponentView.modelToView(int, Shape, Position.Bias)
public abstract int viewToModel(JTextComponent t, Point pt)
t
- the JTextComponent
for which this
delegate object provides the user interface.pt
- the position in view coordinates.
loc
.viewToModel(JTextComponent, Point, Position.Bias[])
public abstract int viewToModel(JTextComponent tc, Point loc, Position.Bias[] outBias)
tc
- the JTextComponent
for which this
delegate object provides the user interface.loc
- the position in view coordinates.outBias
- an array whose size must be at least one.
After the call, outBias[0]
will indicate
whether loc
is in the glyph before
(Position.Bias.Backward
) or after
(Position.Bias.Forward
) the returned
caret position.
loc
.public abstract int getNextVisualPositionFrom(JTextComponent tc, int pos, Position.Bias bias, int direction, Position.Bias[] outBias) throws BadLocationException
tc
- the JTextComponent
for which this
delegate object provides the user interface.pos
- the current caret position, a zero-based index
into the document model.bias
- whether to take the character before or after the
caret position indicated by pos
. The value
must be either Position.Bias.Backward
or Position.Bias.Forward
.direction
- the visual direction. Pass
SwingConstants.WEST
for the left
arrow key, SwingConstants.EAST
for the right arrow key, SwingConstants.NORTH
for the up arrow
key, or SwingConstants.SOUTH
for the down arrow key.
BadLocationException
- if pos
does not
designate a valid position in the document model.
IllegalArgumentException
- if direction
is not one of Position.Bias.Forward
or Position.Bias.Backward
.public abstract void damageRange(JTextComponent tc, int start, int end)
tc
- the JTextComponent
for which this
delegate object provides the user interface.start
- the first character in the range that needs
painting, indicated as an index into the document model.end
- the last character in the range that needs
painting, indicated as an index into the document model.
end
must be greater than or equal to
start
.public abstract void damageRange(JTextComponent tc, int start, int end, Position.Bias startBias, Position.Bias endBias)
tc
- the JTextComponent
for which this
delegate object provides the user interface.start
- the first character in the range that needs
painting, indicated as an index into the document model.end
- the last character in the range that needs
painting, indicated as an index into the document model.
end
must be greater than or equal to
start
.public abstract EditorKit getEditorKit(JTextComponent tc)
EditorKit
managing policies and
persistent state.
tc
- the JTextComponent
for which this
delegate object provides the user interface.
EditorKit
used by tc
.public abstract View getRootView(JTextComponent tc)
tc
- the JTextComponent
for which this
delegate object provides the user interface.
View
used by tc
.public String getToolTipText(JTextComponent tc, Point loc)
tc
- the JTextComponent
for which this
delegate object provides the user interface.loc
- the location for which the tool tip is requested.
null
to
display no tool tip.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |