|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.freehep.graphics2d.TagHandler
org.freehep.graphics2d.GenericTagHandler
public class GenericTagHandler
The class converts HTML tags like in instances of TextAttribute
.
Field Summary | |
---|---|
static java.lang.Integer |
UNDERLINE_OVERLINE
TextAttribute for overline, not a standard |
Constructor Summary | |
---|---|
GenericTagHandler(java.awt.Graphics2D graphics)
creates a tag handler for printing text and calculating its size |
Method Summary | |
---|---|
protected java.lang.String |
closeTag(java.lang.String tag)
closes the given html tag. |
java.awt.font.TextLayout |
createTextLayout(TagString s,
double superscriptCorrection)
calculates the string bounds using the current font of graphics . |
protected java.lang.String |
openTag(java.lang.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 java.lang.String |
text(java.lang.String text)
calculates miny und maxy for createTextLayout(TagString, double) . |
Methods inherited from class org.freehep.graphics2d.TagHandler |
---|
defaultEntity, entity, main, parse |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static java.lang.Integer UNDERLINE_OVERLINE
Constructor Detail |
---|
public GenericTagHandler(java.awt.Graphics2D graphics)
graphics
- stores the font for calculationsMethod Detail |
---|
public 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 java.awt.font.TextLayout createTextLayout(TagString s, double superscriptCorrection)
graphics
.
s
- string to calculate
protected java.lang.String openTag(java.lang.String tag)
openTag
in class TagHandler
tag
- one of the known tags, otherwise the overloaded methode is called
protected java.lang.String closeTag(java.lang.String tag)
closeTag
in class TagHandler
tag
- to close
protected java.lang.String text(java.lang.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 draw
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |