|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--voji.report.ReportComponent
|
+--voji.report.ReportText
This report component draws a text
| Field Summary | |
int |
align
The horizontal alignment of the text. |
static int |
CHAR
Break at any character |
java.awt.Font |
font
The font of the text |
boolean |
hasInsets
Says whether the text should have insets |
double |
left
The left extension of the text |
static int |
NEWLINE
Break only at '\n' |
double |
right
The right extension of the text |
java.lang.String |
text
The displayed text |
int |
type
The break type of the text. |
static int |
WORD
Break at words and newlines |
| Fields inherited from class voji.report.ReportComponent |
position |
| Fields inherited from interface javax.swing.SwingConstants |
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST |
| Constructor Summary | |
ReportText(java.lang.String text,
double left,
double right,
java.awt.Font font)
Constructs a new ReportText instance
representing the given string in the given font.
|
|
ReportText(java.lang.String text,
double left,
double right,
java.awt.Font font,
int align)
Constructs a new ReportText instance
representing the given string in the given font.
|
|
ReportText(java.lang.String text,
double left,
double right,
java.awt.Font font,
int align,
int type,
boolean hasInsets)
Constructs a new ReportText instance
representing the given string in the given font |
|
| Method Summary | |
void |
draw(PageGraphics g)
Draws this component |
protected void |
drawLine(java.awt.Graphics g,
java.lang.String text,
int x1,
int x2,
int y)
Draws a single line |
protected java.awt.Insets |
getInsets(PageGraphics g)
Returns the insets of this text component |
protected java.util.Vector |
getLines(PageGraphics g)
Splits the current text into lines |
protected int |
getOwnHeight(PageGraphics g)
Returns the local height of this component |
protected void |
updateText(PageGraphics g)
Updates the text. |
| Methods inherited from class voji.report.ReportComponent |
add, add, draw, getHeight, iterator, remove |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public java.lang.String text
public double left
public double right
public java.awt.Font font
public boolean hasInsets
public int align
LEFT,
RIGHT or
CENTER.
public int type
NEWLINE,
WORD or
CHAR.
public static final int NEWLINE
public static final int WORD
public static final int CHAR
| Constructor Detail |
public ReportText(java.lang.String text,
double left,
double right,
java.awt.Font font,
int align,
int type,
boolean hasInsets)
ReportText instance
representing the given string in the given font
text - the text to drawleft - the left extension of the textright - the right extension of the textfont - the font of the textalign - the horizontal alignment of the texttype - the break type of the texthasInsets - whether the text should have insets
public ReportText(java.lang.String text,
double left,
double right,
java.awt.Font font,
int align)
ReportText instance
representing the given string in the given font.
It uses a WORD break type and
no insets
for text.
text - the text to drawleft - the left extension of the textright - the right extension of the textfont - the font of the textalign - the horizontal alignment of the text
public ReportText(java.lang.String text,
double left,
double right,
java.awt.Font font)
ReportText instance
representing the given string in the given font.
It uses a WORD break type,
no insets and
a LEFT alignment
for text.
text - the text to drawleft - the left extension of the textright - the right extension of the textfont - the font of the text| Method Detail |
protected int getOwnHeight(PageGraphics g)
getOwnHeight in class ReportComponentg - a graphical context to determine font sizes etc.ReportComponent.getHeight(PageGraphics)public void draw(PageGraphics g)
draw in class ReportComponentg - the graphical context where to draw toReportComponent.getHeight(PageGraphics)
protected void drawLine(java.awt.Graphics g,
java.lang.String text,
int x1,
int x2,
int y)
g - the graphical context where to draw totext - the text to drawx1 - the left borderx2 - the right bordery - the baselineprotected java.awt.Insets getInsets(PageGraphics g)
g - a graphical context to determine font sizes etc.protected java.util.Vector getLines(PageGraphics g)
g - a graphical context to determine font sizes etc.
Vector of strings containing the linesprotected void updateText(PageGraphics g)
g - a graphical context to determine font sizes etc.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||