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.

TextCanvas supports the following properties:
Property NameProperty TypeDescription
TextSizeDimension The size of text (columns and rows).
TextString Text string.

See Also:
TextEdit, Cell

Variable Index

 o oSize
 o text

Constructor Index

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

Method Index

 o clearCache()
Force redraw.
 o getMinimumSize()
Return the minimum size of the TextCanvas.
 o getPreferredSize()
Return the preferred size of TextCanvas.
 o getText()
Return the text string being currently displayed by TextCanvas.
 o getTextSize()
Return the preferred size of TextCanvas.
 o paint(Graphics)
Paint TextCanvas.
 o setText(String)
Set the text string for displaying.
 o update(Graphics)
Overriden for double buffering.

Variables

 o oSize
 protected Dimension oSize
 o text
 protected String text

Constructors

 o TextCanvas
 public TextCanvas()
Construct an empty TextCanvas.

 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 getTextSize
 public Dimension getTextSize()
Return the preferred size of TextCanvas.

Returns:
preferred size.
 o getPreferredSize
 public Dimension getPreferredSize()
Return the preferred size of TextCanvas.

Returns:
preferred size.
Overrides:
getPreferredSize in class Component
 o getMinimumSize
 public Dimension getMinimumSize()
Return the minimum size of the TextCanvas.

Returns:
minimum size.
Overrides:
getMinimumSize in class Component
 o getText
 public String getText()
Return the text string being currently displayed by TextCanvas.

Returns:
current text.
 o setText
 public synchronized void setText(String text)
Set the text string for displaying.

Parameters:
text - canvas text.
 o clearCache
 public void clearCache()
Force redraw.

 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