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
-
text
-
-
TextCanvas(int, int)
- Create a TextCanvas with specified rows and columns.
-
TextCanvas(String)
- Construct a TextCanvas with initial text.
-
getText()
- Return the text string being currently displayed by TextCanvas.
-
minimumSize()
- Return the minimum size of the TextCanvas.
-
paint(Graphics)
- Paint TextCanvas.
-
preferredSize()
- Return the preferred size of TextCanvas.
-
setText(String)
- Set the text string for displaying.
-
update(Graphics)
- Overriden for double buffering.
text
protected String text
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.
preferredSize
public Dimension preferredSize()
- Return the preferred size of TextCanvas.
- Returns:
- preferred size.
- Overrides:
- preferredSize in class Component
minimumSize
public Dimension minimumSize()
- Return the minimum size of the TextCanvas.
- Returns:
- minimum size.
- Overrides:
- minimumSize in class Component
getText
public String getText()
- Return the text string being currently displayed by TextCanvas.
- Returns:
- current text.
setText
public void setText(String text)
- Set the text string for displaying.
- Parameters:
- text - canvas text.
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