All Packages Class Hierarchy This Package Previous Next Index
Class com.sun.java.swing.text.JTextUI
java.lang.Object
|
+----com.sun.java.swing.text.JTextUI
- public abstract class JTextUI
- extends Object
- implements TextUI
Basis of a text components look-and-feel. This provides the
basic editor view and controller services that may be useful
when creating a look-and-feel for an extension of
JTextComponent.
To use this class, subclasses must at a minimum subclass
JViewFactory and implement the create method, and return it
from the createViewFactory method. This determines how
the model will be represented.
-
editor
-
-
JTextUI(Color, Color)
- The children of the view are all positioned overlayed one
upon another.
-
createCaret(Color, Color)
- Create the object to use for a caret.
-
createController(JTextComponent)
- This is defined to create the controller responsible binding
events to actions in the text component.
-
createHighlighter()
- Create the object to use for adding highlights.
-
createView()
- This is defined to create the component responsible for the
view.
-
createViewFactory()
- Creates the factory to be used for building the
various view fragments that make up the view that
represents the model.
-
createViewport()
- This creates a scrollable component that is the default
view passed out by createView.
-
damageRange(Range)
-
-
deinstallUI(JComponent)
-
-
getActions()
-
-
getHighlights()
-
-
getHorizontalVisibility()
-
-
getInsertPosition()
-
-
getInsets(JComponent)
-
-
getKeymap()
- TextUI#getKeymap
-
getMaximumSize(JComponent)
-
-
getMinimumSize(JComponent)
-
-
getPreferredSize(JComponent)
-
-
getVerticalVisibility()
-
-
installUI(JComponent)
-
-
modelToView(Position)
-
-
paint(Graphics, JComponent)
- This view uses child components to represent the view
so these methods are not needed.
-
setHorizontalVisibility(BoundedRangeModel)
-
-
setKeymap(Keymap)
- TextUI#setKeymap
-
setVerticalVisibility(BoundedRangeModel)
-
-
viewToModel(Point)
-
editor
protected JTextComponent editor
JTextUI
public JTextUI(Color select,
Color caret)
- The children of the view are all positioned overlayed one
upon another. For this to be useful, only lightweight components
are used in the construction of the view. If other planes are
desired for a particular view, they can simply be added as
additional children of the update batcher.
- Parameters:
- f - The factory used to populate the interior of the editor
with components that have a mapping to an associated text model.
- select - The highlight color to use for selections.
- caret - The color to use for rendering the insert position.
createView
protected Component createView()
- This is defined to create the component responsible for the
view. It is expected that this will be reimplemented to be
more useful, but super.createView() should be called and
the component returned should be decorated by the actual
container that is enhancing the look. The result of this
call is what gets installed into the associated JTextComponent
as the implementation of the look-and-feel.
createViewport
protected JTextUI. JTextView createViewport()
- This creates a scrollable component that is the default
view passed out by createView.
createViewFactory
protected abstract JTextUI. JViewFactory createViewFactory()
- Creates the factory to be used for building the
various view fragments that make up the view that
represents the model. This is what determines
how the model will be represented.
- See Also:
- create
createController
protected TextController createController(JTextComponent c)
- This is defined to create the controller responsible binding
events to actions in the text component. By default this
is an instance of JTextController.
createCaret
protected InsertPosition createCaret(Color caret,
Color select)
- Create the object to use for a caret. By default an
instance of JInsertPosition is created. This method
can be redefined to provide something else that implements
the InputPosition interface or a subclass of JInsertPosition.
- Parameters:
- select - The highlight color to use for selections.
- caret - The color to use for rendering the insert position.
createHighlighter
protected Highlighter createHighlighter()
- Create the object to use for adding highlights. By default
an instance of JHighlighter is created. This method
can be redefined to provide something else that implements
the Highlighter interface or a subclass of JHighlighter.
installUI
public void installUI(JComponent c)
- See Also:
- installUI
deinstallUI
public void deinstallUI(JComponent c)
- See Also:
- deinstallUI
paint
public void paint(Graphics g,
JComponent c)
- This view uses child components to represent the view
so these methods are not needed.
getPreferredSize
public Dimension getPreferredSize(JComponent c)
getMinimumSize
public Dimension getMinimumSize(JComponent c)
getMaximumSize
public Dimension getMaximumSize(JComponent c)
getInsets
public Insets getInsets(JComponent c)
modelToView
public Rectangle modelToView(Position pos) throws BadLocation
- Throws: BadLocation
- If the given position does not represent a
valid location in the associated document.
- See Also:
- modelToView
viewToModel
public Position viewToModel(Point pt)
- See Also:
- viewToModel
damageRange
public void damageRange(Range rng)
- See Also:
- damageRange
getInsertPosition
public InsertPosition getInsertPosition()
- See Also:
- getInsertPosition
getHighlights
public Highlighter getHighlights()
- See Also:
- getHighlights
setHorizontalVisibility
public void setHorizontalVisibility(BoundedRangeModel vis)
- See Also:
- setHorizontalVisibility
getHorizontalVisibility
public BoundedRangeModel getHorizontalVisibility()
- See Also:
- getHorizontalVisibility
setVerticalVisibility
public void setVerticalVisibility(BoundedRangeModel vis)
- See Also:
- setVerticalVisibility
getVerticalVisibility
public BoundedRangeModel getVerticalVisibility()
- See Also:
- getVerticalVisibility
getActions
public Action[] getActions()
- See Also:
- getActions
setKeymap
public void setKeymap(Keymap map)
- TextUI#setKeymap
getKeymap
public Keymap getKeymap()
- TextUI#getKeymap
All Packages Class Hierarchy This Package Previous Next Index