|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.xoetrope.xui.XTextRenderer
public class XTextRenderer
A mixin class for rendering multiline text.
Copyright: Copyright (c) Xoetrope Ltd., 1998-2003
License: see license.txt $Revision: 2.9 $
Field Summary | |
---|---|
static int |
CENTER Center the text |
static int |
LEFT Left align the text |
static int |
RIGHT Right align the text |
Constructor Summary | |
---|---|
XTextRenderer() |
Method Summary | |
---|---|
void |
drawString(java.awt.Graphics g, java.lang.String str, int x, int y) If a XTextDecorator is set for this instance of the XTextRenderer, pass it the same parameters so that it can apply the decoration |
int |
getAlignment() Get the alignment value for this renderer |
java.awt.Dimension |
getPreferredSize(java.awt.Component comp, java.lang.String text) Gets the preferred size of this component. |
void |
paintText(java.awt.Component comp, java.awt.Graphics g, java.lang.String text) Paints the text on behalf of a component |
void |
setAlignment(int b) Sets the alignment of the text. |
void |
setTextDecorator(XTextDecorator decorator) Add a text decorator |
void |
setTransparent(boolean b) Sets the transparency of the text. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int LEFT
public static final int RIGHT
public static final int CENTER
Constructor Detail |
---|
public XTextRenderer()
Method Detail |
---|
public void setTextDecorator(XTextDecorator decorator)
decorator
- the decoratorpublic void paintText(java.awt.Component comp, java.awt.Graphics g, java.lang.String text)
comp
- the owner componentg
- the graphics contexttext
- the text to render.public void drawString(java.awt.Graphics g, java.lang.String str, int x, int y)
g
- The Graphics Object to which the string is to be paintedstr
- The String to be paintedx
- The x coordinate at which to start paintingy
- The y coordinate at which to start paintingpublic void setAlignment(int b)
b
- RIGHT to right align the text, LEFT for left alignment or CENTERED for centered textpublic int getAlignment()
public void setTransparent(boolean b)
b
- true to make text transparentpublic java.awt.Dimension getPreferredSize(java.awt.Component comp, java.lang.String text)
comp
- The component whose FontMetrics are usedtext
- The text which is to be drawn#getMinimumSize
, LayoutManager
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |