|
swingx Version 2005-08-19 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jdesktop.swingx.JavaBean
org.jdesktop.swingx.painter.AbstractPainter
org.jdesktop.swingx.painter.TextPainter
public class TextPainter
"Paints" text at the given location. The location should be a point where the x and y values are in the range of 0 to 1. Similar to the CSS background positioning algorithm, each value will be scaled along each axis of the component this TextPainter is painting, and then used to position the text. A value of 0,0 would put the text in the upper lefthand corner. 0.5,0.5 would position the text in the center and 1.0,1.0 would be at the lower righthand corner. For a more complete defintion of the positioning algorithm see the CSS 2.1 spec.
Constructor Summary | |
---|---|
TextPainter()
Creates a new instance of TextPainter |
|
TextPainter(String text)
|
|
TextPainter(String text,
Font font)
|
|
TextPainter(String text,
Font font,
Paint paint)
|
Method Summary | |
---|---|
Font |
getFont()
|
Point2D |
getLocation()
|
Paint |
getPaint()
|
String |
getText()
|
protected void |
paintBackground(Graphics2D g,
JComponent component)
Subclasses should implement this method and perform custom painting operations here. |
void |
setFont(Font f)
|
void |
setLocation(Point2D location)
|
void |
setPaint(Paint paint)
|
void |
setText(String text)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TextPainter()
public TextPainter(String text)
public TextPainter(String text, Font font)
public TextPainter(String text, Font font, Paint paint)
Method Detail |
---|
public void setFont(Font f)
public Font getFont()
public void setText(String text)
public String getText()
public void setPaint(Paint paint)
public Paint getPaint()
public void setLocation(Point2D location)
public Point2D getLocation()
protected void paintBackground(Graphics2D g, JComponent component)
AbstractPainter
paintBackground
in class AbstractPainter
g
- The Graphics2D object in which to paintcomponent
- The JComponent that the Painter is delegate for.
|
swingx Version 2005-08-19 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |