Class tea.set.TextCanvas
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class tea.set.TextCanvas

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Canvas
                   |
                   +----tea.set.TextCanvas

public class TextCanvas
extends Canvas
TextCanvas handles displaying of single line and multi line text. The widget is sized according to the row and column specified in constructor. If TextCanvas is constructed without explicit row/column specification, the row/column values are derived from the initial text string.
See Also:
TextEdit, Cell

Variable Index

 o text

Constructor Index

 o TextCanvas(int, int)
Create a TextCanvas with specified rows and columns.
 o TextCanvas(String)
Construct a TextCanvas with initial text.

Method Index

 o getText()
Return the text string being currently displayed by TextCanvas.
 o minimumSize()
Return the minimum size of the TextCanvas.
 o paint(Graphics)
Paint TextCanvas.
 o preferredSize()
Return the preferred size of TextCanvas.
 o setText(String)
Set the text string for displaying.
 o update(Graphics)
Overriden for double buffering.

Variables

 o text
  protected String text

Constructors

 o TextCanvas
  public TextCanvas(int r,
                    int c)
Create a TextCanvas with specified rows and columns.
Parameters:
r - number of rows.
c - number of columns.
 o TextCanvas
  public TextCanvas(String text)
Construct a TextCanvas with initial text. Row and columns are derived from the text.
Parameters:
text - initial text.

Methods

 o preferredSize
  public Dimension preferredSize()
Return the preferred size of TextCanvas.
Returns:
preferred size.
Overrides:
preferredSize in class Component
 o minimumSize
  public Dimension minimumSize()
Return the minimum size of the TextCanvas.
Returns:
minimum size.
Overrides:
minimumSize in class Component
 o getText
  public String getText()
Return the text string being currently displayed by TextCanvas.
Returns:
current text.
 o setText
  public void setText(String text)
Set the text string for displaying.
Parameters:
text - canvas text.
 o paint
  public void paint(Graphics g)
Paint TextCanvas.
Parameters:
g - Graphics context of this component.
Overrides:
paint in class Canvas
 o update
  public void update(Graphics g)
Overriden for double buffering.
Parameters:
g - Graphics context of this component.
Overrides:
update in class Component

All Packages  Class Hierarchy  This Package  Previous  Next  Index