|
||||||||||
| 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 Integer |
UNDERLINE_OVERLINE
TextAttribute for overline, not a standard |
| Constructor Summary | |
|---|---|
GenericTagHandler(Graphics2D graphics)
creates a tag handler for printing text and calculating its size |
|
| Method Summary | |
|---|---|
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). |
| 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 Integer UNDERLINE_OVERLINE
| Constructor Detail |
|---|
public GenericTagHandler(Graphics2D graphics)
graphics - stores the font for calculations| Method 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 text
public TextLayout createTextLayout(TagString s,
double superscriptCorrection)
graphics.
s - string to calculate
protected String openTag(String tag)
openTag in class TagHandlertag - one of the known tags, otherwise the overloaded methode is called
protected String closeTag(String tag)
closeTag in class TagHandlertag - to close
protected 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 TagHandlertext - text to draw
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||