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 Name | Property Type | Description |
TextSize | Dimension |
The size of text (columns and rows). |
Text | String |
Text string. |
- See Also:
- TextEdit, Cell
-
oSize
-
-
text
-
-
TextCanvas()
- Construct an empty TextCanvas.
-
TextCanvas(int, int)
- Create a TextCanvas with specified rows and columns.
-
TextCanvas(String)
- Construct a TextCanvas with initial text.
-
clearCache()
- Force redraw.
-
getMinimumSize()
- Return the minimum size of the TextCanvas.
-
getPreferredSize()
- Return the preferred size of TextCanvas.
-
getText()
- Return the text string being currently displayed by TextCanvas.
-
getTextSize()
- Return the preferred size of TextCanvas.
-
paint(Graphics)
- Paint TextCanvas.
-
setText(String)
- Set the text string for displaying.
-
update(Graphics)
- Overriden for double buffering.
oSize
protected Dimension oSize
text
protected String text
TextCanvas
public TextCanvas()
- Construct an empty TextCanvas.
TextCanvas
public TextCanvas(int r,
int c)
- Create a TextCanvas with specified rows and columns.
- Parameters:
- r - number of rows.
- c - number of columns.
TextCanvas
public TextCanvas(String text)
- Construct a TextCanvas with initial text. Row and columns are
derived from the text.
- Parameters:
- text - initial text.
getTextSize
public Dimension getTextSize()
- Return the preferred size of TextCanvas.
- Returns:
- preferred size.
getPreferredSize
public Dimension getPreferredSize()
- Return the preferred size of TextCanvas.
- Returns:
- preferred size.
- Overrides:
- getPreferredSize in class Component
getMinimumSize
public Dimension getMinimumSize()
- Return the minimum size of the TextCanvas.
- Returns:
- minimum size.
- Overrides:
- getMinimumSize in class Component
getText
public String getText()
- Return the text string being currently displayed by TextCanvas.
- Returns:
- current text.
setText
public synchronized void setText(String text)
- Set the text string for displaying.
- Parameters:
- text - canvas text.
clearCache
public void clearCache()
- Force redraw.
paint
public void paint(Graphics g)
- Paint TextCanvas.
- Parameters:
- g - Graphics context of this component.
- Overrides:
- paint in class Canvas
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