|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.formaria.aria.TextRenderer
public class TextRenderer
A mixin class for rendering multiline text.
Copyright: Copyright (c) Formaria Ltd., 2008
License: see license.txt
$Revision: 2.9 $
| Field Summary | |
|---|---|
static int |
BOTTOM
Bottom align the text |
static int |
CENTER
Center the text |
static int |
LEFT
Left align the text |
static int |
RIGHT
Right align the text |
static int |
TOP
Top align the text |
| Constructor Summary | |
|---|---|
TextRenderer()
|
|
| Method Summary | |
|---|---|
void |
drawString(java.awt.Graphics g,
java.lang.String str,
int x,
int y)
If a TextDecorator is set for this instance of the TextRenderer, pass it the same parameters so that it can apply the decoration |
int |
getHorizontalAlignment()
Get the horizontal alignment value for this renderer |
java.awt.Dimension |
getPreferredSize(java.awt.Component comp,
java.lang.String text)
Gets the preferred size of this component. |
int |
getVerticalAlignment()
Get the vertical alignment value for this renderer |
void |
paintText(java.awt.Component comp,
java.awt.Graphics g,
java.awt.Insets insets,
java.lang.String text)
Paints the text on behalf of a component |
void |
paintText(java.awt.Component comp,
java.awt.Graphics g,
java.lang.String text)
Paints the text on behalf of a component |
void |
setHorizontalAlignment(int b)
Sets the horizontal alignment of the text. |
void |
setTextDecorator(TextDecorator decorator)
Add a text decorator |
void |
setTransparent(boolean b)
Sets the transparency of the text. |
void |
setVerticalAlignment(int b)
Sets the vertical alignment 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 TOP
public static final int BOTTOM
public static final int CENTER
| Constructor Detail |
|---|
public TextRenderer()
| Method Detail |
|---|
public void setTextDecorator(TextDecorator decorator)
decorator - the decorator
public 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 paintText(java.awt.Component comp,
java.awt.Graphics g,
java.awt.Insets insets,
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 setHorizontalAlignment(int b)
b - RIGHT to right align the text, LEFT for left alignment or CENTERED for centered textpublic int getHorizontalAlignment()
public void setVerticalAlignment(int b)
b - BOTTOM to bottom align the text, TOP for top alignment or CENTERED for centered textpublic int getVerticalAlignment()
public void setTransparent(boolean b)
b - true to make text transparent
public 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 | ||||||||