javax.swing.plaf
Class TextUI
An abstract base class for delegates that provide the user
interface for text editors.
JTextComponent
TextUI() - Constructs a new
TextUI .
|
void | damageRange(JTextComponent tc, int start, int end) - Repaints a range of characters.
|
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.
|
EditorKit | getEditorKit(JTextComponent tc) - Retrieves the
EditorKit managing policies and
persistent state.
|
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.
|
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.
|
Rectangle | modelToView(JTextComponent tc, int pos) - Calculates the geometric extent of the character at the
given offset.
|
Rectangle | modelToView(JTextComponent tc, int pos, Position.Bias bias) - Calculates the geometric extent of the character at the
given offset.
|
int | viewToModel(JTextComponent t, Point pt) - Finds the caret position which is closest to the specified visual
location.
|
int | viewToModel(JTextComponent tc, Point loc, Position.Bias outBias) - Finds the caret position which is closest to the specified visual
location.
|
contains , createUI , getAccessibleChild , getAccessibleChildrenCount , getMaximumSize , getMinimumSize , getPreferredSize , installUI , paint , uninstallUI , update |
clone , equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait |
TextUI
public TextUI()
Constructs a new TextUI
.
damageRange
public void damageRange(JTextComponent tc,
int start,
int end)
Repaints a range of characters.
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
.
damageRange
public 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.
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
.
getEditorKit
public EditorKit getEditorKit(JTextComponent tc)
Retrieves the EditorKit
managing policies and
persistent state.
tc
- the JTextComponent
for which this
delegate object provides the user interface.
- the
EditorKit
used by tc
.
getRootView
public View getRootView(JTextComponent tc)
Retrieves the root of the view tree that visually presents
the text.
tc
- the JTextComponent
for which this
delegate object provides the user interface.
- the root
View
used by tc
.
getToolTipText
public String getToolTipText(JTextComponent tc,
Point loc)
Returns a String for presenting a tool tip at the specified
location.
tc
- the JTextComponent
for which this
delegate object provides the user interface.loc
- the location for which the tool tip is requested.
- the text for the tool tip, or
null
to
display no tool tip.
- 1.4
viewToModel
public int viewToModel(JTextComponent t,
Point pt)
Finds the caret position which is closest to the specified visual
location.
t
- the JTextComponent
for which this
delegate object provides the user interface.pt
- the position in view coordinates.
- the caret position which is closest to
loc
.
viewToModel(JTextComponent, Point, Position.Bias[])
viewToModel
public int viewToModel(JTextComponent tc,
Point loc,
Position.Bias outBias)
Finds the caret position which is closest to the specified visual
location.
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.
- the caret position which is closest to
loc
.
TextUI.java --
Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version.