|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
@Equality public interface Captioner
Can paint a text string onto a graphics context in horizontal orientation.
It might be better to rework this interface so that the reference
position is the origin of the bounding box rather than the start of
the baseline which may have a descender. That would make the calculations
easier - it's easy to get confused about the origins and height.
It would also mean this interface could just return an
Icon
.
Method Summary | |
---|---|
void |
drawCaption(String label,
Graphics g)
Draws a caption such that the left end of the text baseline is at the origin of the supplied graphics context. |
Rectangle |
getCaptionBounds(String label)
Returns a bounding box for the caption drawn by a corresponding call to drawCaption(java.lang.String, java.awt.Graphics) . |
int |
getPad()
Returns a suitable padding value for separating captions from the reference position or other graphical elements. |
Method Detail |
---|
void drawCaption(String label, Graphics g)
label
- caption textg
- graphics contextRectangle getCaptionBounds(String label)
drawCaption(java.lang.String, java.awt.Graphics)
.
label
- caption text
int getPad()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |