|
||||||||||
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 It's either LEFT ,
RIGHT or
CENTER . |
static int |
CENTER
Place the text centered |
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 |
LEFT
Place the text left bounded |
static int |
NEWLINE
Break only at '\n' |
double |
right
The right extension of the text |
static int |
RIGHT
Place the text right bounded |
java.lang.String |
text
The displayed text |
int |
type
The break type of the text. |
static int |
WORD
Break at words and newlines |
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, getHeight, 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 static final int LEFT
public static final int RIGHT
public static final int 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 insetspublic 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 textpublic 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 textMethod Detail |
protected int getOwnHeight(PageGraphics g)
getOwnHeight
in class ReportComponent
g
- a graphical context to determine font sizes etc.ReportComponent.getHeight(PageGraphics)
public void draw(PageGraphics g)
draw
in class ReportComponent
g
- 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 |