@OpenApiAll public class ODFCreator extends AbstractDocumentCreator implements IHTMLHandler
Constructor and Description |
---|
ODFCreator() |
Modifier and Type | Method and Description |
---|---|
double[] |
calculateCellWidth()
Calculate table and td width
|
java.lang.String |
changeColorFormat(java.lang.String color)
Change color(3-digits RGB, 6-digits RGB and color name) to RGB format.
|
void |
characters(char[] data)
Receive notification of character data inside a tag.
|
void |
comment(char[] data)
Receive notification of comment data.
|
void |
convert(java.io.Reader reader,
java.io.Writer writer)
Convert the HTML content from reader into ODF document.
|
java.lang.String |
convertToODF(java.lang.String tagName,
java.util.ArrayList<javax.management.Attribute> attributes,
java.util.Deque<java.lang.String> contentStack)
convert html to ODF.
|
void |
endDocument()
Receive notification of end document tag.
|
void |
endTag(javax.swing.text.html.HTML.Tag tag)
Receive notification of the end of a tag.
|
float |
getPaperHeight()
Get paper height.
|
float |
getPaperWidth()
Return a paperWidth.
|
void |
putAttributeToStack(javax.swing.text.AttributeSet attributes)
put start tag attributes in to htmlTagStack.
|
void |
setDocumentPage(DocumentPage page)
set document page property.
|
void |
setPaperHeight(float h)
Set paper height.
|
void |
setPaperWidth(float w)
Set paper width.
|
void |
setProperties(java.util.Properties properties)
Not Implemented.
|
void |
setReduceTableSize(boolean reduce)
Set reduce table size.
|
void |
startTag(javax.swing.text.html.HTML.Tag tag,
javax.swing.text.AttributeSet attributes)
Receive notification of the start of a tag.
|
createImageTool, getFormatter, getStyleByCSSParser, getStyledDocument, setFormatter, setStyledDocument
public void convert(java.io.Reader reader, java.io.Writer writer) throws java.io.IOException
convert
in interface IDocumentCreator
reader
- the reader containing HTML source.writer
- the writer containing RTF document.java.io.IOException
- If any IO errors occur.IDocumentCreator.convert(java.io.Reader, java.io.Writer)
public void comment(char[] data)
comment
in interface IHTMLHandler
data
- An array holding the characters in the comment.public void startTag(javax.swing.text.html.HTML.Tag tag, javax.swing.text.AttributeSet attributes)
startTag
in interface IHTMLHandler
tag
- HTML tagattributes
- The attributes attached to the tag. If there are no attributes, it shall be an empty
Attributes object.public void endTag(javax.swing.text.html.HTML.Tag tag)
endTag
in interface IHTMLHandler
tag
- HTML tagpublic void characters(char[] data)
characters
in interface IHTMLHandler
data
- The characters.public void endDocument()
endDocument
in interface IHTMLHandler
IHTMLHandler.endDocument()
public void putAttributeToStack(javax.swing.text.AttributeSet attributes)
attributes
- set of attributepublic java.lang.String convertToODF(java.lang.String tagName, java.util.ArrayList<javax.management.Attribute> attributes, java.util.Deque<java.lang.String> contentStack)
tagName
- HTML tagattributes
- list of attributescontentStack
- content of HTMLpublic void setPaperHeight(float h)
setPaperHeight
in interface IDocumentCreator
h
- paper height.IDocumentCreator.setPaperHeight(float)
public float getPaperHeight()
public void setPaperWidth(float w)
setPaperWidth
in interface IDocumentCreator
w
- paper width.IDocumentCreator.setPaperWidth(float)
public float getPaperWidth()
public double[] calculateCellWidth()
public java.lang.String changeColorFormat(java.lang.String color)
color
- color formatpublic void setProperties(java.util.Properties properties)
setProperties
in interface IDocumentCreator
properties
- the propertiespublic void setDocumentPage(DocumentPage page)
IDocumentCreator
setDocumentPage
in interface IDocumentCreator
page
- page property.public void setReduceTableSize(boolean reduce)
reduce
- true to reduce table size with paper widthCopyright © 2010 - No Magic Asia