Package com.scroogexhtml.converter
Class AbstractWriter
java.lang.Object
com.scroogexhtml.converter.AbstractWriter
- All Implemented Interfaces:
BorderPropertiesWriter,CharacterPropertiesWriter,DocumentWriter,FieldWriter,FootnoteWriter,HeaderFooterWriter,PageSetupWriter,ParagraphPropertiesWriter,TableStateWriter,Writer
- Direct Known Subclasses:
XMLDOMWriter
The AbstractWriter class holds the Writer state.
It provides methods which are not DOM specific.
-
Method Summary
Modifier and TypeMethodDescriptionvoidAdds an anchor to the current document.voidvoidEnds the current footnote.voidStarts a footnote.Retrieves the CharacterProperties object that represents the current state data of the Writer.Returns the default font name of the Writer.Retrieves the ParagraphProperties object that represents the current state data of the Writer.charintToChar(int value) booleanCheck if the writer is currently in a footnote.voidpopCharacterProperties(CharacterProperties newCharProps) voidGet last paragraph properties from stack.voidWill be called for \plain RTF token.voidReset the paragraph attributes to default values.voidsetAlignment(Alignment newValue) Sets the alignment for the paragraph.voidsetBGColor(String newValue) Sets the background color for the character properties.voidsetBold(boolean newValue) Sets the bold attribute.voidsetBorderColor(String value) Sets the border color for the paragraph or table.voidsetBorderStyle(BorderStyle value) Sets the border style for the paragraph or table.voidsetBorderWidth(int value) Sets the width of the border.voidsetDefaultFont(FontDescriptor newValue) voidsetFirstIndent(int newValue) Sets the first-line indentation of the paragraph.voidsetFontCharSet(int newValue) Sets the font character set for the character properties.voidsetFontColor(String newValue) Sets the font color for the character properties.voidsetFontName(String newValue) Sets the font name for the character properties.voidsetFontSize(int newValue) Sets the font size in half-points for the character properties.voidsetHidden(boolean newValue) Sets the hidden attribute of the character properties.voidsetHLColor(String newValue) Sets the highlight color for the character properties.voidsetItalic(boolean newValue) Sets the italic attribute of the character properties.voidsetItap(byte newValue) Sets the value of the "Itap" property.voidsetLanguage(String newValue) Sets the language for the character properties.voidsetLeftIndent(int newValue) Set the left indent of the paragraph.voidsetLeftMargin(int paramValue) Sets the left margin of the page.voidsetNodeCharset(int paramValue) voidsetPaperWidth(int paramValue) Sets the width of the paper for page setup.voidsetParagraphBackgroundColor(String newValue) Sets the background color of the paragraph.voidSets the border for the paragraph.voidsetParagraphInTable(boolean value) Sets the flag indicating whether the paragraph is inside a table or not.voidsetRightIndent(int newValue) Sets the right indent for the paragraph.voidsetRightMargin(int paramValue) Sets the right margin of the page.voidsetRightToLeftChar(boolean newValue) Sets the right-to-left character property.voidsetRightToLeftPar(boolean newValue) Sets the right-to-left paragraph property.voidsetSpaceAfter(int value) Sets the space after the paragraph.voidsetSpaceBefore(int newValue) Sets the space before the paragraph.voidsetStrike(boolean newValue) Sets the strike attribute of the character properties.voidSets the subscript attribute of the character properties.voidsetSubscript(boolean newValue) Sets the subscript attribute of the character properties.voidSets the superscript attribute of the character properties.voidsetSuperscript(boolean newValue) Sets the superscript attribute of the character properties.voidsetUnderline(boolean newValue) Sets the underline attribute of the character properties.voidwriteChar(char value) Append a character to the document.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.scroogexhtml.converter.DocumentWriter
add, add, addLinebreak, getResult, writeEof, writeTabMethods inherited from interface com.scroogexhtml.converter.FieldWriter
finishField, finishFldInst, finishFldRslt, getCurrentFieldExpression, setFieldExpressionMethods inherited from interface com.scroogexhtml.converter.FootnoteWriter
addAutoFootnoteRefMethods inherited from interface com.scroogexhtml.converter.HeaderFooterWriter
footerEnd, footerStart, headerEnd, headerStartMethods inherited from interface com.scroogexhtml.converter.TableStateWriter
nestedTableCellEnds, nestedTableRowEnds, tableCellEndsMethods inherited from interface com.scroogexhtml.converter.Writer
addPicture, applyParagraphProperties, applyTextProperties, getTableWriter, setListLevel, setListOverrideIndex, setNumberingLevel, setNumberingStyle
-
Method Details
-
setStrike
public void setStrike(boolean newValue) Description copied from interface:CharacterPropertiesWriterSets the strike attribute of the character properties.- Specified by:
setStrikein interfaceCharacterPropertiesWriter- Parameters:
newValue- true to set the character properties as strike-through, false otherwise
-
setAlignment
Description copied from interface:ParagraphPropertiesWriterSets the alignment for the paragraph.The alignment can be one of the following values: ALIGN_LEFT - Aligns the paragraph to the left. ALIGN_CENTER - Centers the paragraph. ALIGN_RIGHT - Aligns the paragraph to the right. ALIGN_JUSTIFIED - Justifies the paragraph.
- Specified by:
setAlignmentin interfaceParagraphPropertiesWriter- Parameters:
newValue- the Alignment value to set for the paragraph
-
setBGColor
Description copied from interface:CharacterPropertiesWriterSets the background color for the character properties.- Specified by:
setBGColorin interfaceCharacterPropertiesWriter- Parameters:
newValue- the new background color value
-
setBold
public void setBold(boolean newValue) Description copied from interface:CharacterPropertiesWriterSets the bold attribute.- Specified by:
setBoldin interfaceCharacterPropertiesWriter- Parameters:
newValue- the new value for the bold attribute
-
setFirstIndent
public void setFirstIndent(int newValue) Description copied from interface:ParagraphPropertiesWriterSets the first-line indentation of the paragraph.- Specified by:
setFirstIndentin interfaceParagraphPropertiesWriter- Parameters:
newValue- the value of the first-line indentation
-
setFontColor
Description copied from interface:CharacterPropertiesWriterSets the font color for the character properties.- Specified by:
setFontColorin interfaceCharacterPropertiesWriter- Parameters:
newValue- the new font color value
-
setUnderline
public void setUnderline(boolean newValue) Description copied from interface:CharacterPropertiesWriterSets the underline attribute of the character properties.- Specified by:
setUnderlinein interfaceCharacterPropertiesWriter- Parameters:
newValue- true to set the character properties as underline, false otherwise
-
setHLColor
Description copied from interface:CharacterPropertiesWriterSets the highlight color for the character properties.- Specified by:
setHLColorin interfaceCharacterPropertiesWriter- Parameters:
newValue- the new highlight color value
-
setHidden
public void setHidden(boolean newValue) Description copied from interface:CharacterPropertiesWriterSets the hidden attribute of the character properties.- Specified by:
setHiddenin interfaceCharacterPropertiesWriter- Parameters:
newValue- the new hidden attribute value
-
setItalic
public void setItalic(boolean newValue) Description copied from interface:CharacterPropertiesWriterSets the italic attribute of the character properties.- Specified by:
setItalicin interfaceCharacterPropertiesWriter- Parameters:
newValue- true to set the character properties as italic, false otherwise
-
setLeftIndent
public void setLeftIndent(int newValue) Description copied from interface:ParagraphPropertiesWriterSet the left indent of the paragraph.- Specified by:
setLeftIndentin interfaceParagraphPropertiesWriter- Parameters:
newValue- the value of the left indent
-
setRightIndent
public void setRightIndent(int newValue) Description copied from interface:ParagraphPropertiesWriterSets the right indent for the paragraph.The right indent specifies the amount of indentation from the right margin of the paragraph.
- Specified by:
setRightIndentin interfaceParagraphPropertiesWriter- Parameters:
newValue- the value of the right indent for the paragraph
-
setSpaceBefore
public void setSpaceBefore(int newValue) Description copied from interface:ParagraphPropertiesWriterSets the space before the paragraph.- Specified by:
setSpaceBeforein interfaceParagraphPropertiesWriter- Parameters:
newValue- the value of the space before the paragraph
-
setSpaceAfter
public void setSpaceAfter(int value) Description copied from interface:ParagraphPropertiesWriterSets the space after the paragraph.- Specified by:
setSpaceAfterin interfaceParagraphPropertiesWriter- Parameters:
value- the value of the space after the paragraph
-
setParagraphBorder
Description copied from interface:ParagraphPropertiesWriterSets the border for the paragraph.The border can be one of the following values:
- NONE - No border.
- BOX - Border around the entire paragraph.
- Specified by:
setParagraphBorderin interfaceParagraphPropertiesWriter- Parameters:
value- the Border value to set for the paragraph
-
setBorderColor
Description copied from interface:BorderPropertiesWriterSets the border color for the paragraph or table.- Specified by:
setBorderColorin interfaceBorderPropertiesWriter- Parameters:
value- the value to set as the border color
-
setBorderStyle
Description copied from interface:BorderPropertiesWriterSets the border style for the paragraph or table.Note: used for the paragraph border and the table border.
- Specified by:
setBorderStylein interfaceBorderPropertiesWriter- Parameters:
value- theBorderStyleto set as the border style
-
setBorderWidth
public void setBorderWidth(int value) Description copied from interface:BorderPropertiesWriterSets the width of the border.- Specified by:
setBorderWidthin interfaceBorderPropertiesWriter- Parameters:
value- the width of the border
-
setParagraphBackgroundColor
Description copied from interface:ParagraphPropertiesWriterSets the background color of the paragraph.This method sets the background color of the paragraph to the specified value. The value should be a valid hexadecimal color code representation.
- Specified by:
setParagraphBackgroundColorin interfaceParagraphPropertiesWriter- Parameters:
newValue- the background color value to set for the paragraph
-
setItap
public void setItap(byte newValue) Description copied from interface:TableStateWriterSets the value of the "Itap" property.- Specified by:
setItapin interfaceTableStateWriter- Parameters:
newValue- The value to be set.
-
setRightToLeftChar
public void setRightToLeftChar(boolean newValue) Description copied from interface:CharacterPropertiesWriterSets the right-to-left character property.- Specified by:
setRightToLeftCharin interfaceCharacterPropertiesWriter- Parameters:
newValue- the new value for the right-to-left character property
-
setRightToLeftPar
public void setRightToLeftPar(boolean newValue) Description copied from interface:ParagraphPropertiesWriterSets the right-to-left paragraph property.- Specified by:
setRightToLeftParin interfaceParagraphPropertiesWriter- Parameters:
newValue- the value of the right-to-left paragraph property
-
setSubscript
public void setSubscript(boolean newValue) Description copied from interface:CharacterPropertiesWriterSets the subscript attribute of the character properties.- Specified by:
setSubscriptin interfaceCharacterPropertiesWriter- Parameters:
newValue- true to set the character properties as subscript, false otherwise
-
setSubscript
public void setSubscript()Description copied from interface:CharacterPropertiesWriterSets the subscript attribute of the character properties.- Specified by:
setSubscriptin interfaceCharacterPropertiesWriter
-
setSuperscript
public void setSuperscript(boolean newValue) Description copied from interface:CharacterPropertiesWriterSets the superscript attribute of the character properties.- Specified by:
setSuperscriptin interfaceCharacterPropertiesWriter- Parameters:
newValue- true to set the character properties as superscript, false otherwise
-
setSuperscript
public void setSuperscript()Description copied from interface:CharacterPropertiesWriterSets the superscript attribute of the character properties.- Specified by:
setSuperscriptin interfaceCharacterPropertiesWriter
-
setFontName
Description copied from interface:CharacterPropertiesWriterSets the font name for the character properties.- Specified by:
setFontNamein interfaceCharacterPropertiesWriter- Parameters:
newValue- the new font name
-
setFontSize
public void setFontSize(int newValue) Description copied from interface:CharacterPropertiesWriterSets the font size in half-points for the character properties.- Specified by:
setFontSizein interfaceCharacterPropertiesWriter- Parameters:
newValue- the new font size value to set
-
getCharacterProperties
Description copied from interface:WriterRetrieves the CharacterProperties object that represents the current state data of the Writer.- Specified by:
getCharacterPropertiesin interfaceWriter- Returns:
- The character properties.
-
getParagraphProperties
Description copied from interface:WriterRetrieves the ParagraphProperties object that represents the current state data of the Writer.- Specified by:
getParagraphPropertiesin interfaceWriter- Returns:
- The paragraph properties.
-
getDefaultFontName
Description copied from interface:WriterReturns the default font name of the Writer.- Specified by:
getDefaultFontNamein interfaceWriter- Returns:
- The default font name.
-
setDefaultFont
- Specified by:
setDefaultFontin interfaceWriter
-
setParagraphInTable
public void setParagraphInTable(boolean value) Description copied from interface:ParagraphPropertiesWriterSets the flag indicating whether the paragraph is inside a table or not.- Specified by:
setParagraphInTablein interfaceParagraphPropertiesWriter- Parameters:
value- the flag value indicating whether the paragraph is inside a table
-
resetCharacterAttributes
public void resetCharacterAttributes()Will be called for \plain RTF token.- Specified by:
resetCharacterAttributesin interfaceWriter
-
resetParagraphAttributes
public void resetParagraphAttributes()Reset the paragraph attributes to default values. Invoked when the RTF token \pard appears.- Specified by:
resetParagraphAttributesin interfaceWriter- See Also:
-
addAnchor
Description copied from interface:FieldWriterAdds an anchor to the current document.- Specified by:
addAnchorin interfaceFieldWriter- Parameters:
value- The anchor value to add.
-
popCharacterProperties
- Specified by:
popCharacterPropertiesin interfaceWriter
-
popParagraphProperties
Get last paragraph properties from stack.- Specified by:
popParagraphPropertiesin interfaceWriter- Parameters:
source- the value on the stack.- See Also:
-
setFontCharSet
public void setFontCharSet(int newValue) Description copied from interface:CharacterPropertiesWriterSets the font character set for the character properties.- Specified by:
setFontCharSetin interfaceCharacterPropertiesWriter- Parameters:
newValue- the new font character set
-
intToChar
public char intToChar(int value) -
setNodeCharset
public void setNodeCharset(int paramValue) - Specified by:
setNodeCharsetin interfaceWriter
-
setLanguage
Description copied from interface:CharacterPropertiesWriterSets the language for the character properties.- Specified by:
setLanguagein interfaceCharacterPropertiesWriter- Parameters:
newValue- the new language value
-
writeChar
public void writeChar(char value) Append a character to the document.If it is a "new line" character, a new paragraph object will be created. The new paragraph inherits the properties of the previous paragraph.
- Specified by:
writeCharin interfaceDocumentWriter- Parameters:
value- a character
-
footnoteStart
public void footnoteStart()Description copied from interface:FootnoteWriterStarts a footnote.- Specified by:
footnoteStartin interfaceFootnoteWriter
-
footnoteEnd
public void footnoteEnd()Description copied from interface:FootnoteWriterEnds the current footnote.- Specified by:
footnoteEndin interfaceFootnoteWriter
-
isInFootnote
public boolean isInFootnote()Description copied from interface:FootnoteWriterCheck if the writer is currently in a footnote.- Specified by:
isInFootnotein interfaceFootnoteWriter- Returns:
- true if the writer is in a footnote, false otherwise
-
getListHeaderInfo
- Specified by:
getListHeaderInfoin interfaceWriter
-
getCharProps
-
getParProps
-
setPaperWidth
public void setPaperWidth(int paramValue) Description copied from interface:PageSetupWriterSets the width of the paper for page setup.- Specified by:
setPaperWidthin interfacePageSetupWriter- Parameters:
paramValue- the new width of the paper in pixels.
-
setLeftMargin
public void setLeftMargin(int paramValue) Description copied from interface:PageSetupWriterSets the left margin of the page.- Specified by:
setLeftMarginin interfacePageSetupWriter- Parameters:
paramValue- the value of the left margin in pixels
-
setRightMargin
public void setRightMargin(int paramValue) Description copied from interface:PageSetupWriterSets the right margin of the page.- Specified by:
setRightMarginin interfacePageSetupWriter- Parameters:
paramValue- The value of the right margin in pixels.
-
calculateCurrentPageWidth
public void calculateCurrentPageWidth()- Specified by:
calculateCurrentPageWidthin interfacePageSetupWriter
-