APIdia Launch Partner
Top Description Inners Fields Constructors Methods
com.sun.java.swing.plaf.motif

public Class MotifTextUI

extends Object
Class Inheritance
Imports
java.awt.Color, .Graphics, .Rectangle, java.awt.event.FocusEvent, .FocusListener, .InputEvent, .KeyEvent, javax.swing.KeyStroke, javax.swing.plaf.TextUI, .UIResource, javax.swing.text.BadLocationException, .Caret, .DefaultCaret, .DefaultEditorKit, .JTextComponent

Provides the look and feel features that are common across the Motif/CDE text LAF implementations.
Author
Timothy Prinzing

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
MotifTextUI.MotifCaret

The motif caret is rendered as an I beam.

Field Summary

Modifier and TypeField and Description
pack-priv static final JTextComponent.KeyBinding[]
defaultBindings

Default bindings all keymaps implementing the Motif feel.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static Caret

Returns:

the caret object
createCaret
()

Creates the object to use for a caret for all of the Motif text components.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

defaultBindingsback to summary
pack-priv static final JTextComponent.KeyBinding[] defaultBindings

Default bindings all keymaps implementing the Motif feel.

Annotations
@SuppressWarnings:deprecation

Constructor Detail

MotifTextUIback to summary
public MotifTextUI()

Method Detail

createCaretback to summary
public static Caret createCaret()

Creates the object to use for a caret for all of the Motif text components. The caret is rendered as an I-beam on Motif.

Returns:Caret

the caret object

com.sun.java.swing.plaf.motif back to summary

public Class MotifTextUI.MotifCaret

extends DefaultCaret
implements UIResource
Class Inheritance
All Implemented Interfaces
javax.swing.plaf.UIResource
Annotations
@SuppressWarnings:serial

The motif caret is rendered as an I beam.

Field Summary

Modifier and TypeField and Description
pack-priv static final int
Inherited from javax.swing.text.DefaultCaret:
ALWAYS_UPDATEchangeEventlistenerListNEVER_UPDATEUPDATE_WHEN_ON_EDT

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected void
damage(Rectangle
the current location of the caret, does nothing if null
r
)

Overrides javax.swing.text.DefaultCaret.damage.

Damages the area surrounding the caret to cause it to be repainted.

public void
focusGained(FocusEvent
the focus event
e
)

Overrides javax.swing.text.DefaultCaret.focusGained.

Implements java.awt.event.FocusListener.focusGained.

Called when the component containing the caret gains focus.

public void
focusLost(FocusEvent
the focus event
e
)

Overrides javax.swing.text.DefaultCaret.focusLost.

Implements java.awt.event.FocusListener.focusLost.

Called when the component containing the caret loses focus.

public void
paint(Graphics
the graphics context
g
)

Overrides javax.swing.text.DefaultCaret.paint.

Implements javax.swing.text.Caret.paint.

Renders the caret as a vertical line.

Inherited from javax.swing.text.DefaultCaret:
addChangeListeneradjustVisibilitydeinstallequalsfireStateChangedgetBlinkRategetChangeListenersgetComponentgetDotgetDotBiasgetListenersgetMagicCaretPositiongetMarkgetMarkBiasgetSelectionPaintergetUpdatePolicyinstallisActiveisSelectionVisibleisVisiblemouseClickedmouseDraggedmouseEnteredmouseExitedmouseMovedmousePressedmouseReleasedmoveCaretmoveDotmoveDotpositionCaretremoveChangeListenerrepaintsetBlinkRatesetDotsetDotsetMagicCaretPositionsetSelectionVisiblesetUpdatePolicysetVisibletoString

Field Detail

IBeamOverhangback to summary
pack-priv static final int IBeamOverhang

Constructor Detail

MotifCaretback to summary
public MotifCaret()

Method Detail

damageback to summary
protected void damage(Rectangle r)

Overrides javax.swing.text.DefaultCaret.damage.

Damages the area surrounding the caret to cause it to be repainted. If paint() is reimplemented, this method should also be reimplemented.

Parameters
r:Rectangle

the current location of the caret, does nothing if null

Annotations
@Override
See Also
paint
focusGainedback to summary
public void focusGained(FocusEvent e)

Overrides javax.swing.text.DefaultCaret.focusGained.

Implements java.awt.event.FocusListener.focusGained.

Called when the component containing the caret gains focus. This is implemented to repaint the component so the focus rectangle will be re-rendered, as well as providing the superclass behavior.

Parameters
e:FocusEvent

the focus event

Annotations
@Override
See Also
FocusListener#focusGained
focusLostback to summary
public void focusLost(FocusEvent e)

Overrides javax.swing.text.DefaultCaret.focusLost.

Implements java.awt.event.FocusListener.focusLost.

Called when the component containing the caret loses focus. This is implemented to set the caret to visibility to false.

Parameters
e:FocusEvent

the focus event

Annotations
@Override
See Also
FocusListener#focusLost
paintback to summary
public void paint(Graphics g)

Overrides javax.swing.text.DefaultCaret.paint.

Implements javax.swing.text.Caret.paint.

Renders the caret as a vertical line. If this is reimplemented the damage method should also be reimplemented as it assumes the shape of the caret is a vertical line. Does nothing if isVisible() is false. The caret color is derived from getCaretColor() if the component has focus, else from getDisabledTextColor().

Parameters
g:Graphics

the graphics context

Annotations
@Override
@SuppressWarnings:deprecation
See Also
damage