Class org.aswing.JTextArea

Implemented Interfaces

Viewportable

Description

A JTextArea is a multi-line area that displays text.

With JScrollPane, it's easy to be a scrollable text area, for example:

 var ta:JTextArea = new JTextArea();
 
 var sp:JScrollPane = new JScrollPane(ta); 
 //or 
 //var sp:JScrollPane = new JScrollPane(); 
 //sp.setView(ta);
 

See Also

Field Index

ON_STATE_CHANGED

Inherited from JTextComponent

Inherited from Component

Inherited from EventDispatcher

Method Index

new JTextArea()
addChangeListener(), getColumns(), getExtentSize(), getHorizontalBlockIncrement(), getHorizontalUnitIncrement(), getRows(), getUIClassID(), getVerticalBlockIncrement(), getVerticalUnitIncrement(), getViewportPane(), getViewPosition(), getViewSize(), getVisibleRows(), isMultiline(), isWordWrap(), scrollRectToVisible(), scrollToBottomLeft(), scrollToBottomRight(), scrollToTopLeft(), scrollToTopRight(), setColumns(), setMultiline(), setRows(), setViewportTestSize(), setViewPosition(), setWordWrap(), updateUI()

Inherited from JTextComponent

Inherited from Component

Inherited from EventDispatcher

Constructor Detail

JTextArea

public function JTextArea(text:String, rows:Number, columns:Number)

JTextArea(text:String, rows:Number, columns:Number)
JTextArea(text:String, rows:Number) columns default to 0
JTextArea(text:String) rows and columns default to 0
JTextArea() text default to 0, rows and columns default to 0

See Also

Field Detail

ON_STATE_CHANGED

static public ON_STATE_CHANGED:String
When the JTextArea Viewportable state changed.
onStateChanged Event{source:JTextArea}

Method Detail

updateUI

public function updateUI():Void

Description copied from JTextComponent

Resets the UI property to a value from the current look and feel. Subtypes of JTextComponent should override this to update the UI. For example, JTextField might do the following:

      setUI(TextUI(UIManager.getUI(this)));
 

Overrides

updateUI() in org.aswing.JTextComponent

getUIClassID

public function getUIClassID():String

Description copied from Component

Returns the UIDefaults key used to look up the name of the org.aswing.plaf.ComponentUI class that defines the look and feel for this component. Most applications will never need to call this method. Subclasses of Component that support pluggable look and feel should override this method to return a UIDefaults key that maps to the ComponentUI subclass that defines their look and feel.

Overrides

getUIClassID() in org.aswing.Component

setWordWrap

public function setWordWrap(wrap:Boolean):Void

isWordWrap

public function isWordWrap():Boolean

Description copied from JTextComponent

Subclass override this to change Text's wordWrap ability

Overrides

isWordWrap() in org.aswing.JTextComponent

setColumns

public function setColumns(columns:Number):Void

Sets the number of columns in this JTextArea, if it changed then call parent to do layout.

Parameters

columnsthe number of columns to use to calculate the preferred width; if columns is set to zero or min than zero, the preferred width will be matched just to view all of the text. default value is zero if missed this param.

getColumns

public function getColumns():Number

See Also

setRows

public function setRows(rows:Number):Void

Sets the number of rows in this JTextArea, if it changed then call parent to do layout.

Parameters

rowsthe number of rows to use to calculate the preferred width; if columns is set to zero or min than zero, the preferred width will be matched just to view all of the text. default value is zero if missed this param.

getRows

public function getRows():Number

See Also

setMultiline

public function setMultiline(b:Boolean):Void

Sets if the text is multiline, by default it is true.

Parameters

btrue to support multiline, otherwise false.

isMultiline

public function isMultiline():Boolean

Returns is the text support multiline.

addChangeListener

public function addChangeListener(func:Function, obj:Object):Object

the Viewportable state change listener adding method implementation.

Specified By

addChangeListener() in org.aswing.Viewportable

getVerticalUnitIncrement

public function getVerticalUnitIncrement():Number

Returns the unit value for the Vertical scrolling.

Specified By

getVerticalUnitIncrement() in org.aswing.Viewportable

getVerticalBlockIncrement

public function getVerticalBlockIncrement():Number

Return the block value for the Vertical scrolling.

Specified By

getVerticalBlockIncrement() in org.aswing.Viewportable

getHorizontalUnitIncrement

public function getHorizontalUnitIncrement():Number

Returns the unit value for the Horizontal scrolling.

Specified By

getHorizontalUnitIncrement() in org.aswing.Viewportable

getHorizontalBlockIncrement

public function getHorizontalBlockIncrement():Number

Return the block value for the Horizontal scrolling.

Specified By

getHorizontalBlockIncrement() in org.aswing.Viewportable

setViewportTestSize

public function setViewportTestSize(s:Dimension):Void

Description copied from Viewportable

Before JScrollPane analyse the scroll properties(call getExtentSize and getViewSize), it will call this method to set the size of viewport will be to test.

Specified By

setViewportTestSize() in org.aswing.Viewportable

getExtentSize

public function getExtentSize():Dimension

Returns the size of the visible part of the view in view logic coordinates.

Return

a Dimension object giving the size of the view

Specified By

getExtentSize() in org.aswing.Viewportable

getViewSize

public function getViewSize():Dimension

Returns the viewportable view's amount size if view all content in view logic coordinates.

Return

the view's size.

Specified By

getViewSize() in org.aswing.Viewportable

getViewPosition

public function getViewPosition():Point

Returns the view coordinates that appear in the upper left hand corner of the viewport, or 0,0 if there's no view. in view logic coordinates.

Return

a Point object giving the upper left coordinates

Specified By

getViewPosition() in org.aswing.Viewportable

setViewPosition

public function setViewPosition(p:Point):Void

Sets the view coordinates that appear in the upper left hand corner of the viewport. in view logic coordinates.

Parameters

pa Point object giving the upper left coordinates

Specified By

setViewPosition() in org.aswing.Viewportable

getVisibleRows

public function getVisibleRows():Number

Returns visible row count.

Return

how many rows can see

scrollRectToVisible

public function scrollRectToVisible(contentRect:Rectangle):Void

Scrolls the view so that Rectangle within the view becomes visible. in view logic coordinates.

Note that this method will not scroll outside of the valid viewport; for example, if contentRect is larger than the viewport, scrolling will be confined to the viewport's bounds.

Parameters

contentRectthe Rectangle to display

Specified By

scrollRectToVisible() in org.aswing.Viewportable

scrollToBottomLeft

public function scrollToBottomLeft():Void

Scrolls to view bottom left content. This will make the scrollbars of JScrollPane scrolled automatically, if it is located in a JScrollPane.

scrollToBottomRight

public function scrollToBottomRight():Void

Scrolls to view bottom right content. This will make the scrollbars of JScrollPane scrolled automatically, if it is located in a JScrollPane.

scrollToTopLeft

public function scrollToTopLeft():Void

Scrolls to view top left content. This will make the scrollbars of JScrollPane scrolled automatically, if it is located in a JScrollPane.

scrollToTopRight

public function scrollToTopRight():Void

Scrolls to view to right content. This will make the scrollbars of JScrollPane scrolled automatically, if it is located in a JScrollPane.

getViewportPane

public function getViewportPane():Component

Return the component of the viewportable's pane which would added to displayed on the stage.

Return

the component of the viewportable pane.

Specified By

getViewportPane() in org.aswing.Viewportable