All Packages Class Hierarchy This Package Previous Next Index
Class com.trumphurst.controls.StringPainter
java.lang.Object
|
+----com.trumphurst.controls.StringPainter
- public class StringPainter
- extends Object
- implements ObjectPainter
ObjectPainter to paint a column of a MultiColumnList with the
toString value of the object. Many other ObjectPainters are derived
from this one, as it holds the column title, and it provides a
useful utility function to paint a String, and some useful cached
information about the current font.
- See Also:
- MultiColumnList, StringArrayPainter, TreePainter
-
fm
- Cached FontMetrics.
-
textOffset
- Cached offset of text base line in cell Rectangle.
-
StringPainter(String)
- Constructor.
-
changeTitle(String)
- Change the column heading.
-
paintObject(Graphics, Rectangle, Object, boolean)
- Paints the String returned by o.toString().
-
paintString(Graphics, int, int, String)
- Utility function to paint a String at a point.
-
paintTitle(Graphics, Rectangle, boolean)
- Paints the title as the column heading.
fm
protected FontMetrics fm
- Cached FontMetrics. Updated each time the title is painted.
textOffset
protected int textOffset
- Cached offset of text base line in cell Rectangle.
Updated each time the title is painted.
StringPainter
public StringPainter(String title)
- Constructor.
- Parameters:
- title - The column heading.
changeTitle
public void changeTitle(String title)
- Change the column heading.
paintString
protected void paintString(Graphics g,
int x,
int y,
String s)
- Utility function to paint a String at a point.
- Parameters:
- g - The Graphics on which to paint.
- x - The x position.
- y - The y position of the top of the rectangle
to contain the text.
- s - The String to paint.
paintTitle
public void paintTitle(Graphics g,
Rectangle r,
boolean clip)
- Paints the title as the column heading.
paintObject
public void paintObject(Graphics g,
Rectangle r,
Object o,
boolean clip)
- Paints the String returned by o.toString().
All Packages Class Hierarchy This Package Previous Next Index