public class MultiTextUI extends TextUI
TextUI
instances, one from the primary look and feel, and one or more from the
auxiliary look and feel(s).| Modifier and Type | Field and Description |
|---|---|
protected Vector |
uis
A list of references to the actual component UIs.
|
| Constructor and Description |
|---|
MultiTextUI()
Creates a new
MultiTextUI instance. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(JComponent c,
int x,
int y)
Calls the
ComponentUI.contains(JComponent, int, int) method for all
the UI delegates managed by this MultiTextUI,
returning the result for the UI delegate from the primary look and
feel. |
static ComponentUI |
createUI(JComponent target)
Creates a delegate object for the specified component.
|
void |
damageRange(JTextComponent tc,
int start,
int end)
Calls the
TextUI.damageRange(JTextComponent, int, int) method for
all the UI delegates managed by this MultiTextUI. |
void |
damageRange(JTextComponent tc,
int start,
int end,
Position.Bias startBias,
Position.Bias endBias)
Calls the
TextUI.damageRange(JTextComponent, int, int,
Position.Bias, Position.Bias) method for all the UI delegates managed by
this MultiTextUI. |
Accessible |
getAccessibleChild(JComponent c,
int i)
Calls the
ComponentUI.getAccessibleChild(JComponent, int) method
for all the UI delegates managed by this MultiTextUI,
returning the child for the UI delegate from the primary look and
feel. |
int |
getAccessibleChildrenCount(JComponent c)
Calls the
ComponentUI.getAccessibleChildrenCount(JComponent) method
for all the UI delegates managed by this MultiTextUI,
returning the count for the UI delegate from the primary look and
feel. |
EditorKit |
getEditorKit(JTextComponent tc)
Calls the
TextUI.getEditorKit(JTextComponent) method for all
the UI delegates managed by this MultiTextUI,
returning the editor kit for the UI delegate from the primary look and
feel. |
Dimension |
getMaximumSize(JComponent c)
Calls the
ComponentUI.getMaximumSize(JComponent) method for all
the UI delegates managed by this MultiTextUI,
returning the maximum size for the UI delegate from the primary look and
feel. |
Dimension |
getMinimumSize(JComponent c)
Calls the
ComponentUI.getMinimumSize(JComponent) method for all
the UI delegates managed by this MultiTextUI,
returning the minimum size for the UI delegate from the primary look and
feel. |
int |
getNextVisualPositionFrom(JTextComponent tc,
int pos,
Position.Bias bias,
int direction,
Position.Bias[] outBias)
Calls the
TextUI.getNextVisualPositionFrom(JTextComponent, int,
Position.Bias, int, Position.Bias[]) method for all
the UI delegates managed by this MultiTextUI,
returning the position for the UI delegate from the primary look and
feel. |
Dimension |
getPreferredSize(JComponent c)
Calls the
ComponentUI.getPreferredSize(JComponent) method for all
the UI delegates managed by this MultiTextUI,
returning the preferred size for the UI delegate from the primary look and
feel. |
View |
getRootView(JTextComponent tc)
Calls the
TextUI.getRootView(JTextComponent) method for all
the UI delegates managed by this MultiTextUI,
returning the view for the UI delegate from the primary look and
feel. |
ComponentUI[] |
getUIs()
Returns an array containing the UI delegates managed by this
MultiTextUI. |
void |
installUI(JComponent c)
Calls the
ComponentUI.installUI(JComponent) method for all
the UI delegates managed by this MultiTextUI. |
Rectangle |
modelToView(JTextComponent tc,
int pos)
Calls the
TextUI.modelToView(JTextComponent, int) method for all
the UI delegates managed by this MultiTextUI,
returning the bounds for the UI delegate from the primary look and
feel. |
Rectangle |
modelToView(JTextComponent tc,
int pos,
Position.Bias bias)
Calls the
TextUI.modelToView(JTextComponent, int, Position.Bias)
method for all the UI delegates managed by this MultiTextUI,
returning the bounds for the UI delegate from the primary look and
feel. |
void |
paint(Graphics g,
JComponent c)
Calls the
paint(Graphics, JComponent) method for all the UI
delegates managed by this MultiTextUI. |
void |
uninstallUI(JComponent c)
Calls the
ComponentUI.uninstallUI(JComponent) method for all
the UI delegates managed by this MultiTextUI. |
void |
update(Graphics g,
JComponent c)
Calls the
ComponentUI.update(Graphics, JComponent) method for all
the UI delegates managed by this MultiTextUI. |
int |
viewToModel(JTextComponent t,
Point pt)
Calls the
TextUI.viewToModel(JTextComponent, Point) method for all
the UI delegates managed by this MultiTextUI,
returning the position for the UI delegate from the primary look and
feel. |
int |
viewToModel(JTextComponent tc,
Point loc,
Position.Bias[] outBias)
Calls the
TextUI#viewToModel(JTextComponent, Point, Bias[]) method
for all the UI delegates managed by this MultiTextUI,
returning the position for the UI delegate from the primary look and
feel. |
getToolTipTextpublic MultiTextUI()
MultiTextUI instance.createUI(JComponent)public static ComponentUI createUI(JComponent target)
MultiTextUI is
returned, otherwise the UI from the default look and feel is returned.target - the component.MultiLookAndFeel.createUIs(ComponentUI, Vector, JComponent)public void installUI(JComponent c)
ComponentUI.installUI(JComponent) method for all
the UI delegates managed by this MultiTextUI.installUI in class ComponentUIc - the component.ComponentUI.uninstallUI(javax.swing.JComponent),
JComponent.setUI(javax.swing.plaf.ComponentUI),
JComponent.updateUI()public void uninstallUI(JComponent c)
ComponentUI.uninstallUI(JComponent) method for all
the UI delegates managed by this MultiTextUI.uninstallUI in class ComponentUIc - the component.ComponentUI.installUI(javax.swing.JComponent),
JComponent.setUI(javax.swing.plaf.ComponentUI),
JComponent.updateUI()public ComponentUI[] getUIs()
MultiTextUI. The first item in the array is always
the UI delegate from the installed default look and feel.public boolean contains(JComponent c, int x, int y)
ComponentUI.contains(JComponent, int, int) method for all
the UI delegates managed by this MultiTextUI,
returning the result for the UI delegate from the primary look and
feel.contains in class ComponentUIc - the component.x - the x-coordinate.y - the y-coordinate.true if the specified (x, y) coordinate falls within
the bounds of the component as rendered by the UI delegate in the
primary look and feel, and false otherwise.public void update(Graphics g, JComponent c)
ComponentUI.update(Graphics, JComponent) method for all
the UI delegates managed by this MultiTextUI.update in class ComponentUIg - the graphics device.c - the component.ComponentUI.paint(java.awt.Graphics, javax.swing.JComponent),
JComponent.paintComponent(java.awt.Graphics)public void paint(Graphics g, JComponent c)
paint(Graphics, JComponent) method for all the UI
delegates managed by this MultiTextUI.paint in class ComponentUIg - the graphics device.c - the component.public Dimension getPreferredSize(JComponent c)
ComponentUI.getPreferredSize(JComponent) method for all
the UI delegates managed by this MultiTextUI,
returning the preferred size for the UI delegate from the primary look and
feel.getPreferredSize in class ComponentUIc - the component.public Dimension getMinimumSize(JComponent c)
ComponentUI.getMinimumSize(JComponent) method for all
the UI delegates managed by this MultiTextUI,
returning the minimum size for the UI delegate from the primary look and
feel.getMinimumSize in class ComponentUIc - the component.public Dimension getMaximumSize(JComponent c)
ComponentUI.getMaximumSize(JComponent) method for all
the UI delegates managed by this MultiTextUI,
returning the maximum size for the UI delegate from the primary look and
feel.getMaximumSize in class ComponentUIc - the component.public int getAccessibleChildrenCount(JComponent c)
ComponentUI.getAccessibleChildrenCount(JComponent) method
for all the UI delegates managed by this MultiTextUI,
returning the count for the UI delegate from the primary look and
feel.getAccessibleChildrenCount in class ComponentUIc - the component.public Accessible getAccessibleChild(JComponent c, int i)
ComponentUI.getAccessibleChild(JComponent, int) method
for all the UI delegates managed by this MultiTextUI,
returning the child for the UI delegate from the primary look and
feel.getAccessibleChild in class ComponentUIc - the componenti - the child index.public Rectangle modelToView(JTextComponent tc, int pos) throws BadLocationException
TextUI.modelToView(JTextComponent, int) method for all
the UI delegates managed by this MultiTextUI,
returning the bounds for the UI delegate from the primary look and
feel.modelToView in class TextUItc - the text component.pos - the zero-based index of the character into the
document model.BadLocationException - if pos does not
designate a valid position in the document model.ComponentView.modelToView(int, Shape, Position.Bias)public Rectangle modelToView(JTextComponent tc, int pos, Position.Bias bias) throws BadLocationException
TextUI.modelToView(JTextComponent, int, Position.Bias)
method for all the UI delegates managed by this MultiTextUI,
returning the bounds for the UI delegate from the primary look and
feel.modelToView in class TextUItc - the text component.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.BadLocationException - if pos does not
designate a valid position in the document model.ComponentView.modelToView(int, Shape, Position.Bias)public int viewToModel(JTextComponent t, Point pt)
TextUI.viewToModel(JTextComponent, Point) method for all
the UI delegates managed by this MultiTextUI,
returning the position for the UI delegate from the primary look and
feel.viewToModel in class TextUIt - the text component.pt - the point.TextUI.viewToModel(JTextComponent, Point, Position.Bias[])public int viewToModel(JTextComponent tc, Point loc, Position.Bias[] outBias)
TextUI#viewToModel(JTextComponent, Point, Bias[]) method
for all the UI delegates managed by this MultiTextUI,
returning the position for the UI delegate from the primary look and
feel.viewToModel in class TextUItc - the text component.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.public int getNextVisualPositionFrom(JTextComponent tc, int pos, Position.Bias bias, int direction, Position.Bias[] outBias) throws BadLocationException
TextUI.getNextVisualPositionFrom(JTextComponent, int,
Position.Bias, int, Position.Bias[]) method for all
the UI delegates managed by this MultiTextUI,
returning the position for the UI delegate from the primary look and
feel.getNextVisualPositionFrom in class TextUItc - the text component.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.public void damageRange(JTextComponent tc, int start, int end)
TextUI.damageRange(JTextComponent, int, int) method for
all the UI delegates managed by this MultiTextUI.damageRange in class TextUItc - the component.start - the start position.end - the end position.public void damageRange(JTextComponent tc, int start, int end, Position.Bias startBias, Position.Bias endBias)
TextUI.damageRange(JTextComponent, int, int,
Position.Bias, Position.Bias) method for all the UI delegates managed by
this MultiTextUI.damageRange in class TextUItc - the component.start - the start position.end - the end position.startBias - the start bias.endBias - the end bias.public EditorKit getEditorKit(JTextComponent tc)
TextUI.getEditorKit(JTextComponent) method for all
the UI delegates managed by this MultiTextUI,
returning the editor kit for the UI delegate from the primary look and
feel.getEditorKit in class TextUItc - the text component.public View getRootView(JTextComponent tc)
TextUI.getRootView(JTextComponent) method for all
the UI delegates managed by this MultiTextUI,
returning the view for the UI delegate from the primary look and
feel.getRootView in class TextUItc - the text component.