Package com.nomagic.magicreport.format
Class HTMLFormatter
java.lang.Object
com.nomagic.magicreport.format.DefaultFormatter
com.nomagic.magicreport.format.HTMLFormatter
- All Implemented Interfaces:
IFormatter
This class provides implementation for HTML format output. Extend from DefaultFormatter, this class provide
additional support for BufferedImage.
- Since:
- Jul 2, 2007
-
Field Summary
Fields inherited from class com.nomagic.magicreport.format.DefaultFormatter
properties, styledDocumentFields inherited from interface com.nomagic.magicreport.format.IFormatter
DOT_PER_INCH -
Constructor Summary
ConstructorsConstructorDescriptionHTMLFormatter(Properties properties) Create a HTML formatter with specific properties. -
Method Summary
Modifier and TypeMethodDescriptionprotected ITool.RetainedStringcreateBookmark(Bookmark bookmark) Create a HTML bookmark string from givenBookmarkobject.protected ITool.RetainedStringcreateImage(Image image) Create a HTML image string from givenImageobject.protected ITool.RetainedStringcreateImage(Image image, int width, int height, String flag) Create a HTML image string from givenImageobject.protected ITool.RetainedStringcreateLink(Link link) Create a HTML link string from givenLinkobject.Convert an Object value into HTML format.Methods inherited from class com.nomagic.magicreport.format.DefaultFormatter
getImageFlag, getObjectFormater, getProperties, registerObjectFormatter, setProperties, setStyledDocument, writeImage, writeImage, writeImage
-
Constructor Details
-
HTMLFormatter
Create a HTML formatter with specific properties.- Parameters:
properties- template properties
-
-
Method Details
-
format
Convert an Object value into HTML format.- Specified by:
formatin interfaceIFormatter- Overrides:
formatin classDefaultFormatter- Parameters:
value- converting value- Returns:
- object in default format.
-
createImage
Create a HTML image string from givenImageobject.- Parameters:
image- anImageobject- Returns:
- The String in HTML image format.
- Throws:
IOException- when IO error occurs
-
createImage
protected ITool.RetainedString createImage(Image image, int width, int height, String flag) throws IOException Create a HTML image string from givenImageobject.- Parameters:
image- anImageobjectwidth- the target image widthheight- the target image heightflag- scaling image flag- Returns:
- The String in HTML image format.
- Throws:
IOException- when IO error occurs
-
createBookmark
Create a HTML bookmark string from givenBookmarkobject.- Parameters:
bookmark- anBookmarkobject- Returns:
- The String in HTML bookmark format.
- Throws:
IOException- when IO error occurs
-
createLink
Create a HTML link string from givenLinkobject.- Parameters:
link- anLinkobject- Returns:
- The String in HTML link format.
- Throws:
IOException- when IO error occurs
-