ch.randelshofer.quaqua
Class QuaquaTextFieldUI
java.lang.Object
javax.swing.plaf.ComponentUI
javax.swing.plaf.TextUI
javax.swing.plaf.basic.BasicTextUI
javax.swing.plaf.basic.BasicTextFieldUI
ch.randelshofer.quaqua.QuaquaTextFieldUI
- All Implemented Interfaces:
- VisuallyLayoutable, javax.swing.text.ViewFactory
public class QuaquaTextFieldUI
- extends javax.swing.plaf.basic.BasicTextFieldUI
- implements VisuallyLayoutable
QuaquaTextFieldUI.
- Version:
- $Id: QuaquaTextFieldUI.java 416 2011-07-30 14:12:52Z wrandelshofer $
- Author:
- Werner Randelshofer
Nested classes/interfaces inherited from class javax.swing.plaf.basic.BasicTextUI |
javax.swing.plaf.basic.BasicTextUI.BasicCaret, javax.swing.plaf.basic.BasicTextUI.BasicHighlighter |
Method Summary |
protected javax.swing.text.Caret |
createCaret()
|
protected java.awt.event.FocusListener |
createFocusListener()
|
protected javax.swing.text.Highlighter |
createHighlighter()
|
protected javax.swing.text.Keymap |
createKeymap()
Creates the keymap to use for the text component, and installs
any necessary bindings into it. |
protected java.awt.event.MouseListener |
createPopupListener()
|
static javax.swing.plaf.ComponentUI |
createUI(javax.swing.JComponent jcomponent)
|
int |
getBaseline(javax.swing.JComponent c,
int width,
int height)
Returns the baseline for the specified component, or -1 if the
baseline can not be determined. |
javax.swing.text.EditorKit |
getEditorKit(javax.swing.text.JTextComponent tc)
Fetches the EditorKit for the UI. |
java.awt.Dimension |
getPreferredSize(javax.swing.JComponent c)
|
java.awt.Rectangle |
getVisualBounds(javax.swing.JComponent c,
int type,
int width,
int height)
Returns the visual bounds for the specified component, or null if the
visual bounds can not be determined. |
java.awt.Insets |
getVisualMargin(javax.swing.text.JTextComponent tc)
|
protected void |
installDefaults()
|
protected void |
installListeners()
|
void |
installUI(javax.swing.JComponent c)
|
protected void |
paintSafely(java.awt.Graphics g)
|
void |
propertyChange(java.beans.PropertyChangeEvent event)
|
protected void |
uninstallDefaults()
|
protected void |
uninstallListeners()
|
Methods inherited from class javax.swing.plaf.basic.BasicTextFieldUI |
create, getBaselineResizeBehavior, getPropertyPrefix |
Methods inherited from class javax.swing.plaf.basic.BasicTextUI |
create, damageRange, damageRange, getComponent, getKeymapName, getMaximumSize, getMinimumSize, getNextVisualPositionFrom, getRootView, getToolTipText, getVisibleEditorRect, installKeyboardActions, modelChanged, modelToView, modelToView, paint, paintBackground, setView, uninstallKeyboardActions, uninstallUI, update, viewToModel, viewToModel |
Methods inherited from class javax.swing.plaf.ComponentUI |
contains, getAccessibleChild, getAccessibleChildrenCount |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
QuaquaTextFieldUI
public QuaquaTextFieldUI()
createUI
public static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent jcomponent)
installUI
public void installUI(javax.swing.JComponent c)
- Overrides:
installUI
in class javax.swing.plaf.basic.BasicTextUI
installDefaults
protected void installDefaults()
- Overrides:
installDefaults
in class javax.swing.plaf.basic.BasicTextUI
uninstallDefaults
protected void uninstallDefaults()
- Overrides:
uninstallDefaults
in class javax.swing.plaf.basic.BasicTextUI
installListeners
protected void installListeners()
- Overrides:
installListeners
in class javax.swing.plaf.basic.BasicTextUI
uninstallListeners
protected void uninstallListeners()
- Overrides:
uninstallListeners
in class javax.swing.plaf.basic.BasicTextUI
createFocusListener
protected java.awt.event.FocusListener createFocusListener()
createPopupListener
protected java.awt.event.MouseListener createPopupListener()
getEditorKit
public javax.swing.text.EditorKit getEditorKit(javax.swing.text.JTextComponent tc)
- Fetches the EditorKit for the UI.
- Overrides:
getEditorKit
in class javax.swing.plaf.basic.BasicTextUI
- Parameters:
tc
- the text component for which this UI is installed
- Returns:
- the editor capabilities
- See Also:
TextUI.getEditorKit(javax.swing.text.JTextComponent)
getVisualMargin
public java.awt.Insets getVisualMargin(javax.swing.text.JTextComponent tc)
paintSafely
protected void paintSafely(java.awt.Graphics g)
- Overrides:
paintSafely
in class javax.swing.plaf.basic.BasicTextUI
propertyChange
public void propertyChange(java.beans.PropertyChangeEvent event)
- Overrides:
propertyChange
in class javax.swing.plaf.basic.BasicTextUI
createCaret
protected javax.swing.text.Caret createCaret()
- Overrides:
createCaret
in class javax.swing.plaf.basic.BasicTextUI
createHighlighter
protected javax.swing.text.Highlighter createHighlighter()
- Overrides:
createHighlighter
in class javax.swing.plaf.basic.BasicTextUI
createKeymap
protected javax.swing.text.Keymap createKeymap()
- Creates the keymap to use for the text component, and installs
any necessary bindings into it. By default, the keymap is
shared between all instances of this type of TextUI. The
keymap has the name defined by the getKeymapName method. If the
keymap is not found, then DEFAULT_KEYMAP from JTextComponent is used.
The set of bindings used to create the keymap is fetched
from the UIManager using a key formed by combining the
BasicTextFieldUI.getPropertyPrefix()
method
and the string .keyBindings
. The type is expected
to be JTextComponent.KeyBinding[]
.
- Overrides:
createKeymap
in class javax.swing.plaf.basic.BasicTextUI
- Returns:
- the keymap
- See Also:
BasicTextUI.getKeymapName()
,
JTextComponent
getBaseline
public int getBaseline(javax.swing.JComponent c,
int width,
int height)
- Description copied from interface:
VisuallyLayoutable
- Returns the baseline for the specified component, or -1 if the
baseline can not be determined. The baseline is measured from
the top of the component.
- Specified by:
getBaseline
in interface VisuallyLayoutable
- Overrides:
getBaseline
in class javax.swing.plaf.basic.BasicTextFieldUI
- Parameters:
c
- JComponent to calculate baseline forwidth
- Width of the component to determine baseline for.height
- Height of the component to determine baseline for.
- Returns:
- baseline for the specified component
getVisualBounds
public java.awt.Rectangle getVisualBounds(javax.swing.JComponent c,
int type,
int width,
int height)
- Description copied from interface:
VisuallyLayoutable
- Returns the visual bounds for the specified component, or null if the
visual bounds can not be determined.
- Specified by:
getVisualBounds
in interface VisuallyLayoutable
- Parameters:
c
- JComponent to calculate visual margin fortype
- The type of the visual margin.width
- Width of the componentheight
- Height of the component
- Returns:
- The visual bounds in component coordinates.
getPreferredSize
public java.awt.Dimension getPreferredSize(javax.swing.JComponent c)
- Overrides:
getPreferredSize
in class javax.swing.plaf.basic.BasicTextUI