charvax.swing
Class JTextArea

java.lang.Object
  extended bycharva.awt.Component
      extended bycharvax.swing.JComponent
          extended bycharvax.swing.text.JTextComponent
              extended bycharvax.swing.JTextArea
All Implemented Interfaces:
Scrollable

public class JTextArea
extends JTextComponent
implements Scrollable

Support for public void setBounds( Rectangle bounds ) public void setBounds( int top_, int left_, int bottom_, int right_) public void setBounds(Point topleft_, Dimension size_)


Field Summary
 
Fields inherited from class charvax.swing.text.JTextComponent
_caretPosition, _document, _editable
 
Fields inherited from class charvax.swing.JComponent
_border
 
Fields inherited from class charva.awt.Component
_alignmentX, _alignmentY, _background, _cursesColor, _enabled, _focusListeners, _foreground, _keyListeners, _origin, _parent, _visible, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Constructor Summary
JTextArea()
          The default constructor creates an empty text area with 10 rows and 10 columns.
JTextArea(java.lang.String text_)
          Construct a text area with 10 rows and 10 columns, and containing the specified text.
JTextArea(java.lang.String text_, int rows_, int columns_)
          Construct a text area wth the specified number of rows and columns, and containing the specified text.
 
Method Summary
 void addScrollListener(ScrollListener sl_)
          Register a ScrollListener object for this JTextArea.
 void append(java.lang.String text_)
          Appends the specified text to the end of the document.
 void debug(int level_)
           
 void draw()
          Implements the abstract method in charva.awt.Component.
 int getColumns()
          Returns the number of columns in this JTextArea.
 int getHeight()
           
 int getLineCount()
          Returns the number of lines of text displayed in the JTextArea.
 int getLineEndOffset(int line_)
          Returns the offset of the last character in the specified line.
 int getLineOfOffset(int offset_)
          Translates an offset (relative to the start of the document) to a line number.
 int getLineStartOffset(int line_)
          Returns the offset of the first character in the specified line of text.
 boolean getLineWrap()
          Returns the line-wrapping policy of the JTextArea.
 Dimension getPreferredScrollableViewportSize()
          Returns the preferred size of the viewport for this JTextArea when it is in a JScrollPane (this method implements the Scrollable interface).
 int getRows()
          Returns the number of rows in this JTextArea.
 Dimension getSize()
          Returns the size of this component.
 int getWidth()
           
 boolean getWrapStyleWord()
          Returns the line-wrapping style to be used if getLineWrap() is true.
 void insert(java.lang.String text_, int pos_)
          Inserts the specified text at the specified position (ie at the specified offset from the start of the document)..
 Dimension minimumSize()
          Called by the LayoutManager.
 void processKeyEvent(KeyEvent ke_)
          Process KeyEvents that have been generated by this JTextArea.
 void processMouseEvent(MouseEvent e_)
          Process a MouseEvent that was generated by clicking the mouse somewhere inside this JTextArea.
 void processScrollEvent(ScrollEvent e_)
          Process scroll events generated by this JTextArea.
 void removeScrollListener(ScrollListener sl_)
          Remove a ScrollListener object that is registered for this JTextArea.
 void replaceRange(java.lang.String text_, int start_, int end_)
          Replaces the text from the specified start position to end position with the specified text.
 void requestFocus()
          This method should be invoked by all subclasses of Component which override this method; because this method generates the FOCUS_GAINED event when the component gains the keyboard focus.
 void setBounds(int top_, int left_, int bottom_, int right_)
           
 void setBounds(Point topleft_, Dimension size_)
           
 void setBounds(Rectangle bounds)
           
 void setCaretPosition(int caret_)
          Sets the position of the text insertion caret for this JTextArea.
 void setColumns(int columns_)
          Sets the number of columns in this JTextArea.
 void setLineWrap(boolean wrap_)
          Sets the line-wrapping policy of the JTextArea.
 void setRows(int rows_)
          Sets the number of rows in this JTextArea.
 void setWrapStyleWord(boolean wrapWord_)
          Sets the line-wrapping style to be used if getLineWrap() is true.
 
Methods inherited from class charvax.swing.text.JTextComponent
getCaretPosition, getDocument, getText, isEditable, setDocument, setEditable, setText
 
Methods inherited from class charvax.swing.JComponent
getBorder, getInsets, setBorder
 
Methods inherited from class charva.awt.Component
addFocusListener, addKeyListener, contains, contains, getAlignmentX, getAlignmentY, getAncestorWindow, getBackground, getBounds, getCursesColor, getForeground, getLocation, getLocationOnScreen, getName, getParent, hasFocus, hide, invalidate, isDisplayed, isEnabled, isFocusTraversable, isTotallyObscured, isValid, isVisible, processEvent, processFocusEvent, repaint, requestSync, setBackground, setEnabled, setForeground, setLocation, setLocation, setName, setParent, setVisible, show, validate, validateCursesColor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface charva.awt.Scrollable
getLocation
 

Constructor Detail

JTextArea

public JTextArea()
The default constructor creates an empty text area with 10 rows and 10 columns.


JTextArea

public JTextArea(java.lang.String text_)
Construct a text area with 10 rows and 10 columns, and containing the specified text.


JTextArea

public JTextArea(java.lang.String text_,
                 int rows_,
                 int columns_)
Construct a text area wth the specified number of rows and columns, and containing the specified text.

Method Detail

setBounds

public void setBounds(Rectangle bounds)
Overrides:
setBounds in class Component

setBounds

public void setBounds(int top_,
                      int left_,
                      int bottom_,
                      int right_)
Overrides:
setBounds in class Component

setBounds

public void setBounds(Point topleft_,
                      Dimension size_)
Overrides:
setBounds in class Component

setColumns

public void setColumns(int columns_)
Sets the number of columns in this JTextArea.


getColumns

public int getColumns()
Returns the number of columns in this JTextArea.


setRows

public void setRows(int rows_)
Sets the number of rows in this JTextArea.


getRows

public int getRows()
Returns the number of rows in this JTextArea.


getSize

public Dimension getSize()
Returns the size of this component.

Specified by:
getSize in class Component

getWidth

public int getWidth()
Specified by:
getWidth in class Component

getHeight

public int getHeight()
Specified by:
getHeight in class Component

append

public void append(java.lang.String text_)
Appends the specified text to the end of the document.


insert

public void insert(java.lang.String text_,
                   int pos_)
Inserts the specified text at the specified position (ie at the specified offset from the start of the document)..


replaceRange

public void replaceRange(java.lang.String text_,
                         int start_,
                         int end_)
Replaces the text from the specified start position to end position with the specified text.


setCaretPosition

public void setCaretPosition(int caret_)
Sets the position of the text insertion caret for this JTextArea.

Overrides:
setCaretPosition in class JTextComponent

getLineCount

public int getLineCount()
Returns the number of lines of text displayed in the JTextArea.


getLineStartOffset

public int getLineStartOffset(int line_)
Returns the offset of the first character in the specified line of text.


getLineEndOffset

public int getLineEndOffset(int line_)
Returns the offset of the last character in the specified line.


getLineOfOffset

public int getLineOfOffset(int offset_)
Translates an offset (relative to the start of the document) to a line number.


setLineWrap

public void setLineWrap(boolean wrap_)
Sets the line-wrapping policy of the JTextArea. If set to true, lines will be wrapped if they are too long to fit within the allocated width. If set to false, the lines will always be unwrapped. The default value of this property is false.


getLineWrap

public boolean getLineWrap()
Returns the line-wrapping policy of the JTextArea. If set to true, lines will be wrapped if they are too long to fit within the allocated width. If set to false, the lines will always be unwrapped.


setWrapStyleWord

public void setWrapStyleWord(boolean wrapWord_)
Sets the line-wrapping style to be used if getLineWrap() is true. If true, lines will be wrapped at word boundaries (whitespace) if they are too long to fit in the allocated number of columns. If false, lines will be wrapped at character boundaries. The default value of this property is false.


getWrapStyleWord

public boolean getWrapStyleWord()
Returns the line-wrapping style to be used if getLineWrap() is true. If true, lines will be wrapped at word boundaries (whitespace) if they are too long to fit in the allocated number of columns. If false, lines will be wrapped at character boundaries.


minimumSize

public Dimension minimumSize()
Called by the LayoutManager.

Specified by:
minimumSize in class Component

processKeyEvent

public void processKeyEvent(KeyEvent ke_)
Process KeyEvents that have been generated by this JTextArea.

Overrides:
processKeyEvent in class Component

processMouseEvent

public void processMouseEvent(MouseEvent e_)
Process a MouseEvent that was generated by clicking the mouse somewhere inside this JTextArea. Clicking the mouse inside the JTextArea moves the caret position to where the mouse was clicked.

Overrides:
processMouseEvent in class Component

draw

public void draw()
Implements the abstract method in charva.awt.Component.

Overrides:
draw in class JComponent

requestFocus

public void requestFocus()
Description copied from class: Component
This method should be invoked by all subclasses of Component which override this method; because this method generates the FOCUS_GAINED event when the component gains the keyboard focus.

Overrides:
requestFocus in class Component

addScrollListener

public void addScrollListener(ScrollListener sl_)
Register a ScrollListener object for this JTextArea.

Specified by:
addScrollListener in interface Scrollable

removeScrollListener

public void removeScrollListener(ScrollListener sl_)
Remove a ScrollListener object that is registered for this JTextArea.

Specified by:
removeScrollListener in interface Scrollable

processScrollEvent

public void processScrollEvent(ScrollEvent e_)
Process scroll events generated by this JTextArea.

Specified by:
processScrollEvent in interface Scrollable

getPreferredScrollableViewportSize

public Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport for this JTextArea when it is in a JScrollPane (this method implements the Scrollable interface). The size is determined by the number of rows and columns set for this JTextArea (either in the constructor or in the setColumns() and setRows() methods).

Specified by:
getPreferredScrollableViewportSize in interface Scrollable

debug

public void debug(int level_)
Specified by:
debug in class Component