APIdia Launch Partner
Top Description Inners Fields Constructors Methods
javax.swing.plaf.synth

public Class SynthTextAreaUI

extends BasicTextAreaUI
implements SynthUI
Class Inheritance
All Implemented Interfaces
javax.swing.plaf.synth.SynthUI, javax.swing.plaf.synth.SynthConstants
Imports
javax.swing.*, javax.swing.text.*, javax.swing.plaf.*, javax.swing.plaf.basic.BasicTextAreaUI, java.awt.*, java.awt.event.FocusListener, .FocusEvent, java.beans.PropertyChangeEvent

Provides the look and feel for a plain text editor in the Synth look and feel. In this implementation the default UI is extended to act as a simple view factory.

Warning

Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. As of 1.4, support for long term storage of all JavaBeans has been added to the java.beans package. Please see java.beans.XMLEncoder.

Author
Shannon Hickey
Since
1.7

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class

Field Summary

Modifier and TypeField and Description
private SynthTextAreaUI.Handler
private SynthStyle
private boolean

Constructor Summary

AccessConstructor and Description
public
SynthTextAreaUI()

Constructs a SynthTextAreaUI.

Method Summary

Modifier and TypeMethod and Description
public static ComponentUI

Returns:

the UI object
createUI
(JComponent
a text area
ta
)

Hides javax.swing.plaf.basic.BasicTextAreaUI.createUI.

Creates a UI object for a JTextArea.

public SynthContext
getContext(JComponent c)

Implements javax.swing.plaf.synth.SynthUI.getContext.

Returns the Context for the specified component.

private SynthContext
getContext(JComponent c, int state)

protected void
installDefaults()

Overrides javax.swing.plaf.basic.BasicTextAreaUI.installDefaults.

Initializes component properties, such as font, foreground, background, caret color, selection color, selected text color, disabled text color, border, and margin.

protected void
paint(SynthContext
context for the component being painted
context
,
Graphics
the Graphics object used for painting
g
)

Paints the specified component.

protected void
paintBackground(Graphics g)

Overrides javax.swing.plaf.basic.BasicTextUI.paintBackground.

Paints a background for the view.

public void
paintBorder(SynthContext context, Graphics g, int x, int y, int w, int h)

Implements javax.swing.plaf.synth.SynthUI.paintBorder.

Paints the border.

protected void
propertyChange(PropertyChangeEvent
the property change event
evt
)

Overrides javax.swing.plaf.basic.BasicTextAreaUI.propertyChange.

This method gets called when a bound property is changed on the associated JTextComponent.

protected void
uninstallDefaults()

Overrides javax.swing.plaf.basic.BasicTextUI.uninstallDefaults.

Sets the component properties that have not been explicitly overridden to null.

public void
update(Graphics
the Graphics object used for painting
g
,
JComponent
the component being painted
c
)

Overrides javax.swing.plaf.basic.BasicTextUI.update.

Notifies this UI delegate to repaint the specified component.

private void
updateStyle(JTextComponent comp, boolean updateKBAction)

Inherited from javax.swing.plaf.basic.BasicTextAreaUI:
creategetBaselinegetBaselineResizeBehaviorgetMinimumSizegetPreferredSizegetPropertyPrefix

Field Detail

handlerback to summary
private SynthTextAreaUI.Handler handler
styleback to summary
private SynthStyle style
updateKBActionback to summary
private boolean updateKBAction

Constructor Detail

SynthTextAreaUIback to summary
public SynthTextAreaUI()

Constructs a SynthTextAreaUI.

Method Detail

createUIback to summary
public static ComponentUI createUI(JComponent ta)

Hides javax.swing.plaf.basic.BasicTextAreaUI.createUI.

Creates a UI object for a JTextArea.

Parameters
ta:JComponent

a text area

Returns:ComponentUI

the UI object

getContextback to summary
public SynthContext getContext(JComponent c)

Implements javax.swing.plaf.synth.SynthUI.getContext.

Doc from javax.swing.plaf.synth.SynthUI.getContext.

Returns the Context for the specified component.

Annotations
@Override
getContextback to summary
private SynthContext getContext(JComponent c, int state)
installDefaultsback to summary
protected void installDefaults()

Overrides javax.swing.plaf.basic.BasicTextAreaUI.installDefaults.

Doc from javax.swing.plaf.basic.BasicTextUI.installDefaults.

Initializes component properties, such as font, foreground, background, caret color, selection color, selected text color, disabled text color, border, and margin. Each property is set if its current value is either null or a UIResource.

Annotations
@Override
paintback to summary
protected void paint(SynthContext context, Graphics g)

Paints the specified component.

Parameters
context:SynthContext

context for the component being painted

g:Graphics

the Graphics object used for painting

See Also
update(Graphics, JComponent)
paintBackgroundback to summary
protected void paintBackground(Graphics g)

Overrides javax.swing.plaf.basic.BasicTextUI.paintBackground.

Doc from javax.swing.plaf.basic.BasicTextUI.paintBackground.

Paints a background for the view. This will only be called if isOpaque() on the associated component is true. The default is to paint the background color of the component. Overridden to do nothing.

Annotations
@Override
paintBorderback to summary
public void paintBorder(SynthContext context, Graphics g, int x, int y, int w, int h)

Implements javax.swing.plaf.synth.SynthUI.paintBorder.

Doc from javax.swing.plaf.synth.SynthUI.paintBorder.

Paints the border.

Annotations
@Override
propertyChangeback to summary
protected void propertyChange(PropertyChangeEvent evt)

Overrides javax.swing.plaf.basic.BasicTextAreaUI.propertyChange.

This method gets called when a bound property is changed on the associated JTextComponent. This is a hook which UI implementations may change to reflect how the UI displays bound properties of JTextComponent subclasses. This is implemented to rebuild the View when the WrapLine or the WrapStyleWord property changes.

Parameters
evt:PropertyChangeEvent

the property change event

Annotations
@Override
uninstallDefaultsback to summary
protected void uninstallDefaults()

Overrides javax.swing.plaf.basic.BasicTextUI.uninstallDefaults.

Doc from javax.swing.plaf.basic.BasicTextUI.uninstallDefaults.

Sets the component properties that have not been explicitly overridden to null. A property is considered overridden if its current value is not a UIResource.

Annotations
@Override
updateback to summary
public void update(Graphics g, JComponent c)

Overrides javax.swing.plaf.basic.BasicTextUI.update.

Notifies this UI delegate to repaint the specified component. This method paints the component background, then calls the paint(SynthContext, Graphics) method.

In general, this method does not need to be overridden by subclasses. All Look and Feel rendering code should reside in the paint method.

Parameters
g:Graphics

the Graphics object used for painting

c:JComponent

the component being painted

Annotations
@Override
See Also
paint(SynthContext, Graphics)
updateStyleback to summary
private void updateStyle(JTextComponent comp, boolean updateKBAction)
javax.swing.plaf.synth back to summary

private final Class SynthTextAreaUI.Handler

extends Object
implements FocusListener
Class Inheritance
All Implemented Interfaces
java.awt.event.FocusListener, java.util.EventListener

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public void
focusGained(FocusEvent e)

Implements java.awt.event.FocusListener.focusGained.

Invoked when a component gains the keyboard focus.

public void
focusLost(FocusEvent e)

Implements java.awt.event.FocusListener.focusLost.

Invoked when a component loses the keyboard focus.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

Handlerback to summary
private Handler()

Method Detail

focusGainedback to summary
public void focusGained(FocusEvent e)

Implements java.awt.event.FocusListener.focusGained.

Doc from java.awt.event.FocusListener.focusGained.

Invoked when a component gains the keyboard focus.

focusLostback to summary
public void focusLost(FocusEvent e)

Implements java.awt.event.FocusListener.focusLost.

Doc from java.awt.event.FocusListener.focusLost.

Invoked when a component loses the keyboard focus.