javax.swing.plaf.multi

Class MultiTextUI

public class MultiTextUI extends TextUI

A UI delegate that that coordinates multiple {@link TextUI} instances, one from the primary look and feel, and one or more from the auxiliary look and feel(s).

See Also: addAuxiliaryLookAndFeel

Field Summary
protected Vectoruis
A list of references to the actual component UIs.
Constructor Summary
MultiTextUI()
Creates a new MultiTextUI instance.
Method Summary
booleancontains(JComponent c, int x, int y)
Calls the {@link 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 ComponentUIcreateUI(JComponent target)
Creates a delegate object for the specified component.
voiddamageRange(JTextComponent tc, int start, int end)
Calls the {@link TextUI#damageRange(JTextComponent, int, int)} method for all the UI delegates managed by this MultiTextUI.
voiddamageRange(JTextComponent tc, int start, int end, Position.Bias startBias, Position.Bias endBias)
Calls the {@link TextUI#damageRange(JTextComponent, int, int, Position.Bias, Position.Bias)} method for all the UI delegates managed by this MultiTextUI.
AccessiblegetAccessibleChild(JComponent c, int i)
Calls the {@link 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.
intgetAccessibleChildrenCount(JComponent c)
Calls the {@link 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.
EditorKitgetEditorKit(JTextComponent tc)
Calls the {@link 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.
DimensiongetMaximumSize(JComponent c)
Calls the {@link 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.
DimensiongetMinimumSize(JComponent c)
Calls the {@link 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.
intgetNextVisualPositionFrom(JTextComponent tc, int pos, Position.Bias bias, int direction, Position.Bias[] outBias)
Calls the {@link 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.
DimensiongetPreferredSize(JComponent c)
Calls the {@link 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.
ViewgetRootView(JTextComponent tc)
Calls the {@link 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.
voidinstallUI(JComponent c)
Calls the {@link ComponentUI#installUI(JComponent)} method for all the UI delegates managed by this MultiTextUI.
RectanglemodelToView(JTextComponent tc, int pos)
Calls the {@link 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.
RectanglemodelToView(JTextComponent tc, int pos, Position.Bias bias)
Calls the {@link 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.
voidpaint(Graphics g, JComponent c)
Calls the paint(Graphics, JComponent) method for all the UI delegates managed by this MultiTextUI.
voiduninstallUI(JComponent c)
Calls the {@link ComponentUI#uninstallUI(JComponent)} method for all the UI delegates managed by this MultiTextUI.
voidupdate(Graphics g, JComponent c)
Calls the {@link ComponentUI#update(Graphics, JComponent)} method for all the UI delegates managed by this MultiTextUI.
intviewToModel(JTextComponent t, Point pt)
Calls the {@link 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.
intviewToModel(JTextComponent tc, Point loc, Position.Bias[] outBias)
Calls the {@link 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.

Field Detail

uis

protected Vector uis
A list of references to the actual component UIs.

Constructor Detail

MultiTextUI

public MultiTextUI()
Creates a new MultiTextUI instance.

See Also: createUI

Method Detail

contains

public boolean contains(JComponent c, int x, int y)
Calls the {@link 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.

Parameters: c the component. x the x-coordinate. y the y-coordinate.

Returns: 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.

createUI

public static ComponentUI createUI(JComponent target)
Creates a delegate object for the specified component. If any auxiliary look and feels support this component, a MultiTextUI is returned, otherwise the UI from the default look and feel is returned.

Parameters: target the component.

See Also: MultiLookAndFeel

damageRange

public void damageRange(JTextComponent tc, int start, int end)
Calls the {@link TextUI#damageRange(JTextComponent, int, int)} method for all the UI delegates managed by this MultiTextUI.

Parameters: tc the component. start the start position. end the end position.

damageRange

public void damageRange(JTextComponent tc, int start, int end, Position.Bias startBias, Position.Bias endBias)
Calls the {@link TextUI#damageRange(JTextComponent, int, int, Position.Bias, Position.Bias)} method for all the UI delegates managed by this MultiTextUI.

Parameters: tc the component. start the start position. end the end position. startBias the start bias. endBias the end bias.

getAccessibleChild

public Accessible getAccessibleChild(JComponent c, int i)
Calls the {@link 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.

Parameters: c the component i the child index.

Returns: The child returned by the UI delegate from the primary look and feel.

getAccessibleChildrenCount

public int getAccessibleChildrenCount(JComponent c)
Calls the {@link 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.

Parameters: c the component.

Returns: The count returned by the UI delegate from the primary look and feel.

getEditorKit

public EditorKit getEditorKit(JTextComponent tc)
Calls the {@link 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.

Parameters: tc the text component.

Returns: The editor kit returned by the UI delegate from the primary look and feel.

getMaximumSize

public Dimension getMaximumSize(JComponent c)
Calls the {@link 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.

Parameters: c the component.

Returns: The maximum size returned by the UI delegate from the primary look and feel.

getMinimumSize

public Dimension getMinimumSize(JComponent c)
Calls the {@link 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.

Parameters: c the component.

Returns: The minimum size returned by the UI delegate from the primary look and feel.

getNextVisualPositionFrom

public int getNextVisualPositionFrom(JTextComponent tc, int pos, Position.Bias bias, int direction, Position.Bias[] outBias)
Calls the {@link 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.

Parameters: tc the text component.

Returns: The position returned by the UI delegate from the primary look and feel.

getPreferredSize

public Dimension getPreferredSize(JComponent c)
Calls the {@link 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.

Parameters: c the component.

Returns: The preferred size returned by the UI delegate from the primary look and feel.

getRootView

public View getRootView(JTextComponent tc)
Calls the {@link 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.

Parameters: tc the text component.

Returns: The view returned by the UI delegate from the primary look and feel.

getUIs

public ComponentUI[] getUIs()
Returns an array containing the UI delegates managed by this MultiTextUI. The first item in the array is always the UI delegate from the installed default look and feel.

Returns: An array of UI delegates.

installUI

public void installUI(JComponent c)
Calls the {@link ComponentUI#installUI(JComponent)} method for all the UI delegates managed by this MultiTextUI.

Parameters: c the component.

modelToView

public Rectangle modelToView(JTextComponent tc, int pos)
Calls the {@link 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.

Parameters: tc the text component.

Returns: The bounds returned by the UI delegate from the primary look and feel.

modelToView

public Rectangle modelToView(JTextComponent tc, int pos, Position.Bias bias)
Calls the {@link 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.

Parameters: tc the text component.

Returns: The bounds returned by the UI delegate from the primary look and feel.

paint

public void paint(Graphics g, JComponent c)
Calls the paint(Graphics, JComponent) method for all the UI delegates managed by this MultiTextUI.

Parameters: g the graphics device. c the component.

uninstallUI

public void uninstallUI(JComponent c)
Calls the {@link ComponentUI#uninstallUI(JComponent)} method for all the UI delegates managed by this MultiTextUI.

Parameters: c the component.

update

public void update(Graphics g, JComponent c)
Calls the {@link ComponentUI#update(Graphics, JComponent)} method for all the UI delegates managed by this MultiTextUI.

Parameters: g the graphics device. c the component.

viewToModel

public int viewToModel(JTextComponent t, Point pt)
Calls the {@link 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.

Parameters: t the text component. pt the point.

Returns: The position returned by the UI delegate from the primary look and feel.

viewToModel

public int viewToModel(JTextComponent tc, Point loc, Position.Bias[] outBias)
Calls the {@link 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.

Parameters: tc the text component.

Returns: The position returned by the UI delegate from the primary look and feel.