public class

BasicTextAreaUI

extends BasicTextUI
java.lang.Object
   ↳ javax.swing.plaf.ComponentUI
     ↳ javax.swing.plaf.TextUI
       ↳ javax.swing.plaf.basic.BasicTextUI
         ↳ javax.swing.plaf.basic.BasicTextAreaUI
Known Direct Subclasses

Class Overview

Provides the look and feel for a plain text editor. 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 JavaBeansTM has been added to the java.beans package. Please see XMLEncoder.

Summary

Public Constructors
BasicTextAreaUI()
Constructs a new BasicTextAreaUI object.
Public Methods
View create(Element elem)
Creates the view for an element.
static ComponentUI createUI(JComponent ta)
Creates a UI for a JTextArea.
int getBaseline(JComponent c, int width, int height)
Returns the baseline.
Component.BaselineResizeBehavior getBaselineResizeBehavior(JComponent c)
Returns an enum indicating how the baseline of the component changes as the size changes.
Dimension getMinimumSize(JComponent c)
The method is overridden to take into account caret width.
Dimension getPreferredSize(JComponent c)
The method is overridden to take into account caret width.
Protected Methods
String getPropertyPrefix()
Fetches the name used as a key to look up properties through the UIManager.
void installDefaults()
Initializes component properties, e.g.
void propertyChange(PropertyChangeEvent evt)
This method gets called when a bound property is changed on the associated JTextComponent.
[Expand]
Inherited Methods
From class javax.swing.plaf.basic.BasicTextUI
From class javax.swing.plaf.TextUI
From class javax.swing.plaf.ComponentUI
From class java.lang.Object
From interface javax.swing.text.ViewFactory

Public Constructors

public BasicTextAreaUI ()

Constructs a new BasicTextAreaUI object.

Public Methods

public View create (Element elem)

Creates the view for an element. Returns a WrappedPlainView or PlainView.

Parameters
elem the element
Returns
  • the view

public static ComponentUI createUI (JComponent ta)

Creates a UI for a JTextArea.

Parameters
ta a text area
Returns
  • the UI

public int getBaseline (JComponent c, int width, int height)

Returns the baseline.

Parameters
c JComponent baseline is being requested for
width the width to get the baseline for
height the height to get the baseline for
Returns
  • baseline or a value < 0 indicating there is no reasonable baseline

public Component.BaselineResizeBehavior getBaselineResizeBehavior (JComponent c)

Returns an enum indicating how the baseline of the component changes as the size changes.

Parameters
c JComponent to return baseline resize behavior for
Returns
  • an enum indicating how the baseline changes as the component size changes

public Dimension getMinimumSize (JComponent c)

The method is overridden to take into account caret width.

Parameters
c the editor component
Returns
  • the minimum size
Throws
IllegalArgumentException if invalid value is passed

public Dimension getPreferredSize (JComponent c)

The method is overridden to take into account caret width.

Parameters
c the editor component
Returns
  • the preferred size
Throws
IllegalArgumentException if invalid value is passed

Protected Methods

protected String getPropertyPrefix ()

Fetches the name used as a key to look up properties through the UIManager. This is used as a prefix to all the standard text properties.

Returns
  • the name ("TextArea")

protected void installDefaults ()

Initializes component properties, e.g. font, foreground, background, caret color, selection color, selected text color, disabled text color, and border color. The font, foreground, and background properties are only set if their current value is either null or a UIResource, other properties are set if the current value is null.

protected void propertyChange (PropertyChangeEvent evt)

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 the property change event