public class GenericTagHandler extends TagHandler
TextAttribute
.Modifier and Type | Field and Description |
---|---|
static Integer |
UNDERLINE_OVERLINE
TextAttribute for overline, not a standard
|
Constructor and Description |
---|
GenericTagHandler(Graphics2D graphics)
creates a tag handler for printing text and calculating its size
|
Modifier and Type | Method and Description |
---|---|
protected String |
closeTag(String tag)
closes the given html tag.
|
TextLayout |
createTextLayout(TagString s,
double superscriptCorrection)
calculates the string bounds using the current font of
graphics . |
protected String |
openTag(String tag)
handles bold , italic , superscript , subscript ,
vertical
|
void |
print(TagString s,
double x,
double y,
double superscriptCorrection)
prints the tagged string at x:y
|
protected String |
text(String text)
calculates miny und maxy for
createTextLayout(TagString, double) . |
defaultEntity, entity, main, parse
public static Integer UNDERLINE_OVERLINE
public GenericTagHandler(Graphics2D graphics)
graphics
- stores the font for calculationspublic void print(TagString s, double x, double y, double superscriptCorrection)
s
- string to print using the stored graphicsx
- coordinate for drawingy
- coordinate for drawingsuperscriptCorrection
- correction for to high / to low textpublic TextLayout createTextLayout(TagString s, double superscriptCorrection)
graphics
.s
- string to calculateprotected String openTag(String tag)
openTag
in class TagHandler
tag
- one of the known tags, otherwise the overloaded methode is calledprotected String closeTag(String tag)
closeTag
in class TagHandler
tag
- to closeprotected String text(String text)
createTextLayout(TagString, double)
. If
print(org.freehep.graphics2d.TagString, double, double, double)
is set, text is drawed using
Graphics2D.drawString(String, float, float)
of
graphics
text
in class TagHandler
text
- text to drawCopyright © 2014. All rights reserved.