de.betabeans.scroogexhtml.converter
Class ScroogeXHTMLBase

java.lang.Object
  extended by de.betabeans.scroogexhtml.converter.ScroogeXHTMLBase
Direct Known Subclasses:
ScroogeXHTMLMain

public abstract class ScroogeXHTMLBase
extends java.lang.Object

ScroogeXHTMLBase defines the bean properties.


Field Summary
protected static int DEFAULT_FONT_NR_UNKNOWN
          The font number value when it is 'unknown'.
static byte FONTSIZE_EM
          Font size based on the relative unit 'em'.
static byte FONTSIZE_EX
          Font size based on the relative unit 'ex'.
static byte FONTSIZE_PERCENT
          Font size based on the relative unit '%'.
static byte FONTSIZE_POINT
          Font size based on the absolute unit 'point'.
protected static java.lang.String NBSP_TAG
          The non-breaking space character.
 
Constructor Summary
ScroogeXHTMLBase()
           
 
Method Summary
 void addAfterTextConversionListener(AfterTextConversionListener listener)
          Add an afterTextConversion listener.
 void addBeforeTextConversionListener(BeforeTextConversionListener listener)
          Add an beforeTextConversion listener.
 void addHyperlinkListener(HyperlinkListener listener)
          Add a hyperlink listener.
 void addProgressListener(ProgressListener listener)
          Add a progress listener.
 void debug(java.lang.String color, char debugChar)
          Write debug string.
 void debug(java.lang.String color, java.lang.String debugText)
          This methods writes a debug string to the output document.
 AfterTextConversionListener[] getAfterTextConversionListeners()
          The get<ListenerType>s method returns the set of registered event listeners.
protected  java.util.Vector getAfterTextConversionListenerVector()
          Returns the after text conversion listener vector value.
 BeforeTextConversionListener[] getBeforeTextConversionListeners()
          The get<ListenerType>s method returns the set of registered event listeners.
protected  java.util.Vector getBeforeTextConversionListenerVector()
          Returns the before text conversion listener vector value.
protected  int getCurFontCSet()
          Returns the current font character set value.
protected  java.lang.StringBuffer getCurFontName()
          Gets this object's current font name.
protected  int getCurFontNr()
          Returns the current font number value.
protected  java.lang.String getCurFontType()
          Returns the cur font type value.
protected  DebugInterface getDebugger()
          Returns the debugger value.
 java.lang.String getDefaultFontColor()
          Get the value of the defaultFontColor property.
 java.lang.String getDefaultFontName()
          Get the value of the defaultFontName property.
protected  int getDefaultFontNr()
          Returns the default font number value.
 int getDefaultFontSize()
          Get the value of the defaultFontSize property.
protected  java.lang.String getDefaultFontStyleDefinition()
          Returns the default font style definition value.
 java.lang.String getDefaultLanguage()
          Get the value of the defaultLanguage property.
 java.lang.String getDocType()
          Get the value of the docType property.
 java.lang.String getDocumentTitle()
          Get the value of the documentTitle property.
 java.lang.String getEmptyParagraph()
          Get the value of the emptyParagraph property.
 byte getFontSizeUnit()
          Get the value of the fontSizeUnit property.
protected  java.lang.String getFontSizeUnitCode()
          Returns the font size unit code value.
 Formatter getFormatter()
          Get the output formatter object.
 java.lang.String getHeadTags()
          Get the value of the headTags property.
 HyperlinkListener[] getHyperlinkListeners()
          The get<ListenerType>s method returns the set of registered event listeners.
protected  java.util.Vector getHyperlinkListenerVector()
          Returns the hyperlink listener vector.
 java.lang.String getLinebreakTag()
          Build a linebreak tag.
 java.lang.String getListItemTag()
          Returns the list item tag value.
 java.lang.String getMetaAuthor()
          Get the value of the metaAuthor property.
 java.lang.String getMetaContentType()
          Get the value of the metaContentType property.
 java.lang.String getMetaDate()
          Get the value of the metaDate property.
 java.lang.String getMetaTags()
          Get the value of the metaTags property.
 java.lang.String getParClose()
          Returns the closing tag for a paragraph.
 java.lang.String getParOpen()
          Returns the opening tag for a paragraph (without right bracket).
protected  RTFKeywords getParser()
          Returns the parser.
 ProgressListener[] getProgressListeners()
          The get<ListenerType>s method returns the set of registered event listeners.
protected  RTFReader getReader()
          Returns the reader.
 java.util.Properties getReplaceFonts()
          Get the value of the replaceFonts property.
 java.lang.String getStyleSheetInclude()
          Get the value of the styleSheetInclude property.
 java.lang.String getStyleSheetLink()
          Get the value of the styleSheetLink property.
protected  java.lang.String getTabString()
          Returns a string which will be used to replace a \tab token in the RTF document.
 java.lang.String getTagClass(java.lang.String tagName)
          Returns the tag class value.
protected  java.lang.String getTagClassParam(java.lang.String tagName)
          Build the style="..." parameter for the given tag.
 java.lang.String getTagStyle(java.lang.String tagName)
          Returns the tag style value.
protected  java.lang.String getTagStyleParam(java.lang.String tagName)
          Returns the tag style parameter value.
 Translator getTranslator()
          Get the document translator.
 java.lang.String getVersion()
          ScroogeXHTML version.
protected  Writer getWriter()
          Returns the writer.
protected  boolean hasProgressListeners()
          Check if there are registered progress listeners.
 boolean isAbortConversion()
          Get the value of the abortConversion property.
 boolean isAddOuterHTML()
          Return the value of the addOuterHTML property.
 boolean isConvertEmptyParagraphs()
          Get the value of the convertEmptyParagraphs property.
 boolean isConvertFontBGColor()
          Get the value of the convertFontBGColor property.
 boolean isConvertFontColor()
          Get the value of the convertFontColor property.
 boolean isConvertFontHLColor()
          Get the value of the convertFontHLColor property.
 boolean isConvertFontName()
          Get the value of the convertFontName property.
 boolean isConvertFontSize()
          Get the value of the convertFontSize property.
 boolean isConvertFontStyle()
          Get the value of the convertFontStyle property.
 boolean isConvertHyperlinks()
          Get the value of the convertHyperlinks property.
 boolean isConvertIndent()
          Get the value of the convertIndent property.
 boolean isConvertLanguage()
          Get the value of the convertLanguage property.
 boolean isConvertSpaces()
          Get the value of the convertSpaces property.
 boolean isDebugMode()
          Get the value of the debugMode property.
 boolean isIncludeDefaultFontStyle()
          Get the value of the includeDefaultFontStyle property.
 boolean isIncludeDocType()
          Get the value of the includeDocType property.
 boolean isIncludeXMLDeclaration()
          Get the value of the includeXMLDeclaration property.
 boolean isMetaDateAuto()
          Get the value of the metaDateAuto property.
 java.lang.String isMetaDescription()
          Get the value of the metaDescription property.
 boolean isMetaGenerator()
          Get the value of the metaGenerator property.
 java.lang.String isMetaKeywords()
          Get the value of the metaKeywords property.
static java.lang.String nameAndVersion()
          Name and Version of ScroogeXHTML.
protected  void notifyProgress()
          Notify all existing progress listeners.
abstract  java.lang.String process(FormattedText textElement)
          The FormattedText objects which are stored in the Document instance call this method to convert themselves to HTML.
 void removeAfterTextConversionListener(AfterTextConversionListener listener)
          Remove a AfterTextConversionListener.
 void removeBeforeTextConversionListener(BeforeTextConversionListener listener)
          Remove a BeforeTextConversionListener.
 void removeHyperlinkListener(HyperlinkListener listener)
          Remove a HyperlinkListener.
 void removeProgressListener(ProgressListener listener)
          Remove a ProgressListener.
protected abstract  void replaceHyperlink(FormattedText textElement)
          (implemented by ScroogeXHTMLMain).
 void setAbortConversion(boolean newValue)
          Set AbortConversion to true to cancel the conversion.
 void setAddOuterHTML(boolean newValue)
          Set this property to true to include the HTML header section, and place the generated HTML between the <body> and </body> tags.
 void setConvertEmptyParagraphs(boolean newValue)
          Enable conversion of empty paragraphs to line break tags (<br />).
 void setConvertFontBGColor(boolean newValue)
          Set ConvertFontBGColor to true to enable conversion of text background colors.
 void setConvertFontColor(boolean newValue)
          Set this property to true to enable conversion of font colors.
 void setConvertFontHLColor(boolean newValue)
          Set ConvertFontHLColor to true to enable conversion of text highlight colors.
 void setConvertFontName(boolean newValue)
          Set this property to true to enable conversion of font names.
 void setConvertFontSize(boolean newValue)
          Set this property to true to enable conversion of font sizes.
 void setConvertFontStyle(boolean newValue)
          Set this property to true to enable conversion of font styles (bold, italic, strike, underline, subscript, superscript).
 void setConvertHyperlinks(boolean newValue)
          Set this property to true to enable conversion of hyperlinks.
 void setConvertIndent(boolean newValue)
          Set this property to true to enable conversion of indents.
 void setConvertLanguage(boolean newValue)
          Set the value of the convertLanguage property.
 void setConvertSpaces(boolean newValue)
          Set this property to true to enable conversion of sequences of spaces to &nbsp; tags.
protected  void setCurFontCSet(int cs)
          curFontCSet contains the current font character set.
protected  void setCurFontName(java.lang.StringBuffer n)
          curFontName contains the current font name.
protected  void setCurFontNr(int n)
          curFontNr contains the current font number.
protected  void setCurFontType(java.lang.String t)
          curFontType contains the current font type.
 void setDebugMode(boolean newValue)
          Set this property to true to include debug informations in the document.
 void setDefaultFontColor(java.lang.String newValue)
          Use this property to optimize the HTML code generation.
 void setDefaultFontName(java.lang.String newValue)
          Use this property to optimize the HTML code generation.
protected  void setDefaultFontNr(int n)
          defaultFontNr contains the default font number.
 void setDefaultFontSize(int newValue)
          Use this property to optimize the HTML code generation.
 void setDefaultLanguage(java.lang.String newValue)
          Set the default language code.
 void setDocType(java.lang.String s)
          Set the output document type.
 void setDocumentTitle(java.lang.String newValue)
          Sets the document title.
 void setFontSizeUnit(byte newValue)
          Set the fontSizeUnit property.
 void setHeadTags(java.lang.String newValue)
          List of additional tags for the head section.
 void setIncludeDefaultFontStyle(boolean newValue)
          If this property is set to true, the HTML head section will include a CSS definition for the default font style which is defined by the properties DefaultFontSize, DefaultFontName and DefaultFontColor.
 void setIncludeDocType(boolean newValue)
          Include a DOCTYPE tag at the beginning of the document.
 void setIncludeXMLDeclaration(boolean newValue)
          Includes the XML declaration line at the beginning of the document.
 void setMetaAuthor(java.lang.String newValue)
          This property may be used to specify a META tag which contains the document author.
 void setMetaContentType(java.lang.String newValue)
          This property may be used to specify a character encoding for the document.
 void setMetaDate(java.lang.String newValue)
          Use this property to define the Meta tag for the date manually.
 void setMetaDateAuto(boolean newValue)
          Include a META tag with UTC date and time.
 void setMetaDescription(java.lang.String newValue)
          This property may be used to specify a document description.
 void setMetaGenerator(boolean newValue)
          Include a META tag with generator name.
 void setMetaKeywords(java.lang.String newValue)
          This property may be used to specify keywords for the document.
 void setMetaTags(java.lang.String newValue)
          List of additional meta tags.
protected  void setParser(RTFKeywords p)
          Sets the parser attribute of the ScroogeXHTMLBase object.
protected  void setReader(RTFReader r)
          Sets the reader attribute of the ScroogeXHTMLBase object.
 void setReplaceFonts(java.util.Properties newValue)
          A Properties objects, which defines which original font names in the RTF source have to be replaced in the HTML output.
 void setStyleSheetInclude(java.lang.String newValue)
          Additional style sheet definitions which are stored in the HTML document.
 void setStyleSheetLink(java.lang.String newValue)
          URL of a file which contains external CSS style sheet definitions for the HTML document.
 void setTagClass(java.lang.String tagName, java.lang.String className)
          This property allows to define a CSS class parameter for all <p>, <br> and <li> tags in the converted document.
 void setTagStyle(java.lang.String tagName, java.lang.String tagStyle)
          This property allows to define a CSS style parameter for all <p>, <br> and <li> tags in the converted document.
 void setTranslator(Translator t)
          Sets the translator attribute of the ScroogeXHTMLBase object.
protected  void setWriter(Writer w)
          Sets the writer attribute of the ScroogeXHTMLBase object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_FONT_NR_UNKNOWN

protected static final int DEFAULT_FONT_NR_UNKNOWN
The font number value when it is 'unknown'.

See Also:
Constant Field Values

FONTSIZE_EM

public static final byte FONTSIZE_EM
Font size based on the relative unit 'em'.

See Also:
setFontSizeUnit(byte), Constant Field Values

FONTSIZE_EX

public static final byte FONTSIZE_EX
Font size based on the relative unit 'ex'.

See Also:
setFontSizeUnit(byte), Constant Field Values

FONTSIZE_PERCENT

public static final byte FONTSIZE_PERCENT
Font size based on the relative unit '%'.

See Also:
setFontSizeUnit(byte), Constant Field Values

FONTSIZE_POINT

public static final byte FONTSIZE_POINT
Font size based on the absolute unit 'point'.

See Also:
setFontSizeUnit(byte), Constant Field Values

NBSP_TAG

protected static final java.lang.String NBSP_TAG
The non-breaking space character.

See Also:
Constant Field Values
Constructor Detail

ScroogeXHTMLBase

public ScroogeXHTMLBase()
Method Detail

nameAndVersion

public static final java.lang.String nameAndVersion()
Name and Version of ScroogeXHTML.

Returns:
Name and version.

setAbortConversion

public final void setAbortConversion(boolean newValue)
Set AbortConversion to true to cancel the conversion.

Parameters:
newValue - The new abortConversion value

setAddOuterHTML

public final void setAddOuterHTML(boolean newValue)
Set this property to true to include the HTML header section, and place the generated HTML between the <body> and </body> tags. This allows to create 'stand-alone' HTML output documents.

Parameters:
newValue - The new addOuterHTML value
Default value:
false
Note:
many options are only effective if this flag is set to true.

setConvertEmptyParagraphs

public final void setConvertEmptyParagraphs(boolean newValue)
Enable conversion of empty paragraphs to line break tags (<br />).

Parameters:
newValue - The new convertEmptyParagraphs value
Default value:
false
Note:
'Strict' document types do not allow the element "BR", so this option has no effect with some document types

setConvertFontBGColor

public final void setConvertFontBGColor(boolean newValue)
Set ConvertFontBGColor to true to enable conversion of text background colors. Code Example:

 
 // switch off background color conversion
 scroogeXHTML1.setConvertBGColor(false);
 // switch off higlight color conversion
 scroogeXHTML1.setConvertHLColor(false);
 

Parameters:
newValue - The new convertFontBGColor value
See Also:
setConvertFontHLColor
Default value:
true
Note:
in RTF documents, background colors may also be defined as 'highlight colors'. If the background colors do not appear in the output document, try setting the ConvertFontHLColor property.

setConvertFontColor

public final void setConvertFontColor(boolean newValue)
Set this property to true to enable conversion of font colors.

Parameters:
newValue - The new convertFontColor value
Default value:
true
Note:
hyperlink detection is only possible if this property is set to true.

setConvertFontHLColor

public final void setConvertFontHLColor(boolean newValue)
Set ConvertFontHLColor to true to enable conversion of text highlight colors. Code Example:

 
 // switch off background color conversion
 scroogeXHTML1.setConvertBGColor(false);
 // switch off higlight color conversion
 scroogeXHTML1.setConvertHLColor(false);
 


Parameters:
newValue - The new convertFontHLColor value
See Also:
setConvertFontBGColor
Default value:
true
Note:
in RTF documents, highlight colors may also be defined as 'background colors'. If the highlight colors do not appear in the output document, try setting the ConvertFontBGColor property.

setConvertFontName

public final void setConvertFontName(boolean newValue)
Set this property to true to enable conversion of font names.

Parameters:
newValue - The new convertFontName value
Default value:
true

setConvertFontSize

public final void setConvertFontSize(boolean newValue)
Set this property to true to enable conversion of font sizes.

Parameters:
newValue - The new convertFontSize value
Default value:
true

setConvertFontStyle

public final void setConvertFontStyle(boolean newValue)
Set this property to true to enable conversion of font styles (bold, italic, strike, underline, subscript, superscript).

Parameters:
newValue - The new convertFontStyle value
Default value:
true
Note:
hyperlink detection is only possible if this property is set to true.

setConvertHyperlinks

public final void setConvertHyperlinks(boolean newValue)
Set this property to true to enable conversion of hyperlinks. There are two ways to process hyperlinks. The simple way is to set this property to true, and the converter will check if a text element is formatted blue and underlined. The second method is to define hyperlink listeners.

Parameters:
newValue - The new convertHyperlinks value
See Also:
HyperlinkListener
Default value:
false
Note:
hyperlink detection is only possible if conversion of font colors and font styles has been set to true.

setConvertIndent

public final void setConvertIndent(boolean newValue)
Set this property to true to enable conversion of indents.

Parameters:
newValue - The new convertIndent value
Default value:
false
Note:
The right indent in the output document is relative to the browser window, if you change the browser window size, the text area will adjust its size.

setConvertSpaces

public final void setConvertSpaces(boolean newValue)
Set this property to true to enable conversion of sequences of spaces to &nbsp; tags.

Parameters:
newValue - The new convertSpaces value
Default value:
false

setDebugMode

public final void setDebugMode(boolean newValue)
Set this property to true to include debug informations in the document. In debug mode, the HTML code includes all elemens of the RTF document (RTF tokens, control characters...).
Unknown RTF tokens are red
Known RTF tokens are green
Font names and other unprinted text is silver
Document groups are blue
Document text is black

Parameters:
newValue - The new debugMode value
Default value:
false

setDefaultFontColor

public final void setDefaultFontColor(java.lang.String newValue)
Use this property to optimize the HTML code generation. For example, if most of the the document uses black text, define black (#000000) as the default font color in the component and in the style sheet. The converter will now only create HTML code for the font color if it is not black.

Parameters:
newValue - The new defaultFontColor value
See Also:
getDefaultFontColor()
Default value:
false
Note:
this property ist only effective if the property IncludeDefaultFontStyle is set to true.

setDefaultFontName

public final void setDefaultFontName(java.lang.String newValue)
Use this property to optimize the HTML code generation. For example, if most of the document uses the font 'Times', just define it as the default font name in the component and in the style sheet. The converter will now only create HTML code for the font name if it is not 'Times'.

Parameters:
newValue - The new defaultFontName value
See Also:
getDefaultFontName()
Default value:
false
Note:
this property ist only effective if the property IncludeDefaultFontStyle is set to true.

setDefaultFontSize

public final void setDefaultFontSize(int newValue)
Use this property to optimize the HTML code generation. For example, if most of the document uses a 10 point font, just define 10 as the default font size in the component and in the style sheet. The converter will now only create HTML code for the font size if it is not 10 pt.

Parameters:
newValue - The new defaultFontSize value
See Also:
getDefaultFontSize()
Default value:
false
Note:
this property ist only effective if the property IncludeDefaultFontStyle is set to true.

setDocType

public final void setDocType(java.lang.String s)
Set the output document type.
ScroogeXHTML supports the following document types:

For every document type, a different subclass of CustomTranslator will be used to process the conversion.
Example:
 scroogeXHTML1.setDocType(W3CDocument.DOCTYPE_HTML_401_TRANSITIONAL);
 

Parameters:
s - The new docType value
See Also:
TranslatorFactory, getDocType()
Default value:
DOCTYPE_HTML_401_STRICT
Note:
Not all HTML tags and entities are supported by all document types. Some examples:
  • the &apos; entity (apostrophe) is only valid in XHTML, some HTML browsers will not display it
  • many tags for font formatting are deprecated and available in the 'transitional' versions of the document type for backward compatibility, the 'strict' versions use CSS style parameters instead
  • 'Strict' document types do not allow the element "BR", this element can not be used to replace empty paragraphs ("P" element)

setDocumentTitle

public final void setDocumentTitle(java.lang.String newValue)
Sets the document title.

Parameters:
newValue - The new documentTitle value
See Also:
getDocumentTitle()
Default value:
"Untitled document"
Note:
This property ist only effective if the property AddOuterHTML is set to true.

setHeadTags

public final void setHeadTags(java.lang.String newValue)
List of additional tags for the head section.

Parameters:
newValue - The new headTags value
See Also:
getHeadTags()
Default value:
(empty)
Note:
This property ist only effective if the property AddOuterHTML is set to true.

setIncludeDefaultFontStyle

public final void setIncludeDefaultFontStyle(boolean newValue)
If this property is set to true, the HTML head section will include a CSS definition for the default font style which is defined by the properties DefaultFontSize, DefaultFontName and DefaultFontColor.
Example: if the document uses "Arial 14 pt black" as the main font, set the DefaultFontSize, DefaultFontName and DefaultFontColor properties to these values and set IncludeDefaultFontStyle to true. Now, the HTML section will contain the following CSS definition:

 
    <style type="text/css">
      <!--
      BODY {font-family:Arial,sans-serif;font-size:14pt;color:#000000; }
      -->
   </style>
   
 


Parameters:
newValue - The new includeDefaultFontStyle value
Default value:
false
Note:
This property ist only effective if the property AddOuterHTML is set to true.

setIncludeDocType

public final void setIncludeDocType(boolean newValue)
Include a DOCTYPE tag at the beginning of the document.

Parameters:
newValue - The new includeDocType value
Default value:
false
Note:
Some browsers check this tag, and use it to verify the document HTML code., This property ist only effective if the property AddOuterHTML is set to true.

setIncludeXMLDeclaration

public final void setIncludeXMLDeclaration(boolean newValue)
Includes the XML declaration line at the beginning of the document. The XML declaration is declared in the constant ScroogeXHTMLBase#XML_DECLARATION The default encodig for documents which use this declaration is "UTF-8".

Parameters:
newValue - The new includeXMLDeclaration value
Default value:
true
Note:
This property ist only effective if the property AddOuterHTML is set to true.

setMetaAuthor

public final void setMetaAuthor(java.lang.String newValue)
This property may be used to specify a META tag which contains the document author.

Parameters:
newValue - The new metaAuthor value
See Also:
getMetaAuthor()
Default value:
empty
Note:
This property ist only effective if the property AddOuterHTML is set to true.

setMetaContentType

public final void setMetaContentType(java.lang.String newValue)
This property may be used to specify a character encoding for the document.

Parameters:
newValue - The new metaContentType value
See Also:
getMetaContentType()
Default value:
"text/html; charset=UTF-8"
Note:
This property ist only effective if the property AddOuterHTML is set to true.

setMetaDate

public final void setMetaDate(java.lang.String newValue)
Use this property to define the Meta tag for the date manually.

Parameters:
newValue - The new metaDate value
See Also:
getMetaDate()
Default value:
empty
Note:
This property ist only effective if the property AddOuterHTML is set to true.

setMetaDateAuto

public final void setMetaDateAuto(boolean newValue)
Include a META tag with UTC date and time.

Parameters:
newValue - The new metaDateAuto value
Default value:
false
Note:
This property ist only effective if the property AddOuterHTML is set to true.

setMetaDescription

public final void setMetaDescription(java.lang.String newValue)
This property may be used to specify a document description.

Parameters:
newValue - The new metaDescription value
Default value:
empty
Note:
This property ist only effective if the property AddOuterHTML is set to true.

setMetaGenerator

public final void setMetaGenerator(boolean newValue)
Include a META tag with generator name.

Parameters:
newValue - The new metaGenerator value
Default value:
false
Note:
This property ist only effective if the property AddOuterHTML is set to true.

setMetaKeywords

public final void setMetaKeywords(java.lang.String newValue)
This property may be used to specify keywords for the document.

Parameters:
newValue - The new metaKeywords value
Default value:
empty
Note:
This property ist only effective if the property AddOuterHTML is set to true.

setMetaTags

public final void setMetaTags(java.lang.String newValue)
List of additional meta tags.

Parameters:
newValue - The new metaTags value
See Also:
getMetaTags()
Default value:
empty
Note:
This property ist only effective if the property AddOuterHTML is set to true.

setReplaceFonts

public final void setReplaceFonts(java.util.Properties newValue)
A Properties objects, which defines which original font names in the RTF source have to be replaced in the HTML output. This property can be used to make the document more compatible with web browsers.

Examples:

Replace all font names which start with "Times" by "Times,serif":

 
   <i>Example 1:</i> Properties p = new Properties(); p.setProperty("Times",
   "Times,serif"); scroogeXHTML1.setReplaceFonts(p); 
 
<i>Example 2:</i> scroogeXHTML1.getReplaceFonts().setProperty("Times", "Times,serif");
Default values:

Arial=Arial,Helvetica,sans-serif
Courier=Courier,monospace
Symbol=Symbol
Times=Times,serif

Parameters:
newValue - The new replaceFonts value
See Also:
getReplaceFonts(), getStyleSheetInclude()

setStyleSheetInclude

public final void setStyleSheetInclude(java.lang.String newValue)
Additional style sheet definitions which are stored in the HTML document.

Parameters:
newValue - The new styleSheetInclude value
See Also:
getStyleSheetInclude()
Default value:
empty
Note:
This property ist only effective if the property AddOuterHTML is set to true.

setStyleSheetLink

public final void setStyleSheetLink(java.lang.String newValue)
URL of a file which contains external CSS style sheet definitions for the HTML document.

Parameters:
newValue - The new styleSheetLink value
See Also:
getStyleSheetLink()
Default value:
empty
Note:
This property ist only effective if the property AddOuterHTML is set to true.

setTagClass

public final void setTagClass(java.lang.String tagName,
                              java.lang.String className)
This property allows to define a CSS class parameter for all <p>, <br> and <li> tags in the converted document.

Examples:
setTagClass("p", "noborder"); will change all paragraph tags to <p class="noborder">
CSS tag classes can be defined in internal or external stylesheets. For more details about stylesheets, please see StyleSheetInclude and StyleSheetLink.

Parameters:
tagName - the tag name, can be "p", "br" or "li"
className - the class name
See Also:
getTagClass(java.lang.String)

setTagStyle

public final void setTagStyle(java.lang.String tagName,
                              java.lang.String tagStyle)
This property allows to define a CSS style parameter for all <p>, <br> and <li> tags in the converted document.

Example:
setTagStyle("p", "margin-left:42px;"); will change all paragraph tags to <p style="margin-left:42px;">
setTagStyle("li", "color:Aqua;"); will change all list item tags to <li style="color:Aqua;">
This property allows to define a tag style without internal or external CSS definitions.

Parameters:
tagName - the tag name, can be "p", "br" or "li"
tagStyle - The new tagStyle value
See Also:
getTagStyle(java.lang.String)

setTranslator

public final void setTranslator(Translator t)
Sets the translator attribute of the ScroogeXHTMLBase object.

Parameters:
t - The new translator value
See Also:
getTranslator()
Note:
Usually this property is set automatically when the docType property changes. You can use this property to assign a customized translator.

setCurFontCSet

protected final void setCurFontCSet(int cs)
curFontCSet contains the current font character set.

Parameters:
cs - The new curFontCSet value
See Also:
getCurFontCSet()

setCurFontName

protected final void setCurFontName(java.lang.StringBuffer n)
curFontName contains the current font name.

Parameters:
n - The new curFontName value
See Also:
getCurFontName()

setCurFontNr

protected final void setCurFontNr(int n)
curFontNr contains the current font number.

Parameters:
n - The new curFontNr value
See Also:
getCurFontNr()

setCurFontType

protected final void setCurFontType(java.lang.String t)
curFontType contains the current font type.

Parameters:
t - The new curFontType value
See Also:
getCurFontType()

setDefaultFontNr

protected final void setDefaultFontNr(int n)
defaultFontNr contains the default font number.

Parameters:
n - The new defaultFontNr value
See Also:
getDefaultFontNr()

setParser

protected final void setParser(RTFKeywords p)
Sets the parser attribute of the ScroogeXHTMLBase object.

Parameters:
p - The new parser value
See Also:
getParser()

setReader

protected final void setReader(RTFReader r)
Sets the reader attribute of the ScroogeXHTMLBase object.

Parameters:
r - The new reader value
See Also:
getReader()

setWriter

protected final void setWriter(Writer w)
Sets the writer attribute of the ScroogeXHTMLBase object.

Parameters:
w - The new writer value
See Also:
getWriter()

isAbortConversion

public final boolean isAbortConversion()
Get the value of the abortConversion property.

Returns:
The abortConversion value
See Also:
setAbortConversion(boolean)

isAddOuterHTML

public final boolean isAddOuterHTML()
Return the value of the addOuterHTML property.

Returns:
The addOuterHTML value
See Also:
setAddOuterHTML(boolean)

getAfterTextConversionListeners

public final AfterTextConversionListener[] getAfterTextConversionListeners()
The get<ListenerType>s method returns the set of registered event listeners. This method is recommended in the amendment to the JavaBeans Specification, last Revision Oct 3, 2000.

Returns:
The afterTextConversionListenerArray value
See Also:
Getting Listeners from JavaBeans

getBeforeTextConversionListeners

public final BeforeTextConversionListener[] getBeforeTextConversionListeners()
The get<ListenerType>s method returns the set of registered event listeners. This method is recommended in the amendment to the JavaBeans Specification, last Revision Oct 3, 2000.

Returns:
The beforeTextConversionListenerArray value
See Also:
Getting Listeners from JavaBeans

isConvertEmptyParagraphs

public final boolean isConvertEmptyParagraphs()
Get the value of the convertEmptyParagraphs property.

Returns:
The convertEmptyParagraphs value
See Also:
setConvertEmptyParagraphs(boolean)

isConvertFontBGColor

public final boolean isConvertFontBGColor()
Get the value of the convertFontBGColor property.

Returns:
The convertFontBGColor value
See Also:
setConvertFontBGColor(boolean)

isConvertFontColor

public final boolean isConvertFontColor()
Get the value of the convertFontColor property.

Returns:
The convertFontColor value
See Also:
setConvertFontColor(boolean)

isConvertFontHLColor

public final boolean isConvertFontHLColor()
Get the value of the convertFontHLColor property.

Returns:
The convertFontHLColor value
See Also:
setConvertFontHLColor(boolean)

isConvertFontName

public final boolean isConvertFontName()
Get the value of the convertFontName property.

Returns:
The convertFontName value
See Also:
setConvertFontName(boolean)

isConvertFontSize

public final boolean isConvertFontSize()
Get the value of the convertFontSize property.

Returns:
The convertFontSize value
See Also:
setConvertFontSize(boolean)

isConvertFontStyle

public final boolean isConvertFontStyle()
Get the value of the convertFontStyle property.

Returns:
The convertFontStyle value
See Also:
setConvertFontStyle(boolean)

isConvertHyperlinks

public final boolean isConvertHyperlinks()
Get the value of the convertHyperlinks property.

Returns:
The convertHyperlinks value
See Also:
setConvertHyperlinks(boolean)

isConvertIndent

public final boolean isConvertIndent()
Get the value of the convertIndent property.

Returns:
The convertIndent value
See Also:
setConvertIndent(boolean)

isConvertSpaces

public final boolean isConvertSpaces()
Get the value of the convertSpaces property.

Returns:
The convertSpaces value
See Also:
setConvertSpaces(boolean)

isDebugMode

public final boolean isDebugMode()
Get the value of the debugMode property.

Returns:
The debugMode value
See Also:
setDebugMode(boolean)

getDefaultFontColor

public final java.lang.String getDefaultFontColor()
Get the value of the defaultFontColor property.

Returns:
The defaultFontColor value
See Also:
setDefaultFontColor(java.lang.String)

getDefaultFontName

public final java.lang.String getDefaultFontName()
Get the value of the defaultFontName property.

Returns:
The defaultFontName value
See Also:
setDefaultFontName(java.lang.String)

getDefaultFontSize

public final int getDefaultFontSize()
Get the value of the defaultFontSize property.

Returns:
The defaultFontSize value
See Also:
setDefaultFontSize(int)

getDocType

public final java.lang.String getDocType()
Get the value of the docType property.

Returns:
The docType value
See Also:
setDocType(java.lang.String)

getDocumentTitle

public final java.lang.String getDocumentTitle()
Get the value of the documentTitle property.

Returns:
The documentTitle value
See Also:
setDocumentTitle(java.lang.String)

getEmptyParagraph

public final java.lang.String getEmptyParagraph()
Get the value of the emptyParagraph property.

Returns:
The emptyParagraph value

getHeadTags

public final java.lang.String getHeadTags()
Get the value of the headTags property.

Returns:
The headTags value
See Also:
setHeadTags(java.lang.String)

getHyperlinkListeners

public final HyperlinkListener[] getHyperlinkListeners()
The get<ListenerType>s method returns the set of registered event listeners. This method is recommended in the amendment to the JavaBeans Specification, last Revision Oct 3, 2000.

Returns:
The hyperlinkListeners array
See Also:
Getting Listeners from JavaBeans

isIncludeDefaultFontStyle

public final boolean isIncludeDefaultFontStyle()
Get the value of the includeDefaultFontStyle property.

Returns:
The includeDefaultFontStyle value
See Also:
setIncludeDefaultFontStyle(boolean)

isIncludeDocType

public final boolean isIncludeDocType()
Get the value of the includeDocType property.

Returns:
The includeDocType value
See Also:
setIncludeDocType(boolean)

isIncludeXMLDeclaration

public final boolean isIncludeXMLDeclaration()
Get the value of the includeXMLDeclaration property.

Returns:
The includeXMLDeclaration value.
See Also:
setIncludeXMLDeclaration(boolean)

getLinebreakTag

public final java.lang.String getLinebreakTag()
Build a linebreak tag.

Returns:
The linebreakTag value

getListItemTag

public final java.lang.String getListItemTag()
Returns the list item tag value.

Returns:
The listItemTag value

getMetaAuthor

public final java.lang.String getMetaAuthor()
Get the value of the metaAuthor property.

Returns:
The metaAuthor value
See Also:
setMetaAuthor(java.lang.String)

getMetaContentType

public final java.lang.String getMetaContentType()
Get the value of the metaContentType property.

Returns:
The metaContentType value
See Also:
setMetaContentType(java.lang.String)

getMetaDate

public final java.lang.String getMetaDate()
Get the value of the metaDate property.

Returns:
The metaDate value
See Also:
setMetaDate(java.lang.String)

isMetaDateAuto

public final boolean isMetaDateAuto()
Get the value of the metaDateAuto property.

Returns:
The metaDateAuto value
See Also:
setMetaDateAuto(boolean)

isMetaDescription

public final java.lang.String isMetaDescription()
Get the value of the metaDescription property.

Returns:
The metaDescription value
See Also:
setMetaDescription(java.lang.String)

isMetaGenerator

public final boolean isMetaGenerator()
Get the value of the metaGenerator property.

Returns:
The metaGenerator value
See Also:
setMetaGenerator(boolean)

isMetaKeywords

public final java.lang.String isMetaKeywords()
Get the value of the metaKeywords property.

Returns:
The metaKeywords value
See Also:
setMetaKeywords(java.lang.String)

getMetaTags

public final java.lang.String getMetaTags()
Get the value of the metaTags property.

Returns:
The metaTags value
See Also:
setMetaTags(java.lang.String)

getParClose

public final java.lang.String getParClose()
Returns the closing tag for a paragraph.

Returns:
The parClose value

getParOpen

public final java.lang.String getParOpen()
Returns the opening tag for a paragraph (without right bracket).

Returns:
The parOpen value

getProgressListeners

public final ProgressListener[] getProgressListeners()
The get<ListenerType>s method returns the set of registered event listeners. This method is recommended in the amendment to the JavaBeans Specification, last Revision Oct 3, 2000.

Returns:
The progressListeners array
See Also:
Getting Listeners from JavaBeans

getReplaceFonts

public final java.util.Properties getReplaceFonts()
Get the value of the replaceFonts property.

Returns:
The replaceFonts value
See Also:
setReplaceFonts(java.util.Properties)

getStyleSheetInclude

public final java.lang.String getStyleSheetInclude()
Get the value of the styleSheetInclude property.

Returns:
The styleSheetInclude value
See Also:
setStyleSheetInclude(java.lang.String)

getStyleSheetLink

public final java.lang.String getStyleSheetLink()
Get the value of the styleSheetLink property.

Returns:
The styleSheetLink value
See Also:
setStyleSheetLink(java.lang.String)

getTagClass

public final java.lang.String getTagClass(java.lang.String tagName)
Returns the tag class value.

Parameters:
tagName - The name of the HTML element.
Returns:
The tagClass value
See Also:
setTagClass(java.lang.String, java.lang.String)

getTagStyle

public final java.lang.String getTagStyle(java.lang.String tagName)
Returns the tag style value.

Parameters:
tagName - The name of the HTML element.
Returns:
The tagStyle value
See Also:
setTagStyle(java.lang.String, java.lang.String)

getTranslator

public final Translator getTranslator()
Get the document translator.

Returns:
The translator.
See Also:
setTranslator(de.betabeans.scroogexhtml.translator.Translator)

getVersion

public final java.lang.String getVersion()
ScroogeXHTML version.

Returns:
The version value

getAfterTextConversionListenerVector

protected final java.util.Vector getAfterTextConversionListenerVector()
Returns the after text conversion listener vector value.

Returns:
The afterTextConversionListeners value

getBeforeTextConversionListenerVector

protected final java.util.Vector getBeforeTextConversionListenerVector()
Returns the before text conversion listener vector value.

Returns:
The beforeTextConversionListeners value

getCurFontCSet

protected final int getCurFontCSet()
Returns the current font character set value.

Returns:
The curFontCSet value
See Also:
setCurFontCSet(int)

getCurFontName

protected final java.lang.StringBuffer getCurFontName()
Gets this object's current font name.

Returns:
The curFontName value
See Also:
setCurFontName(java.lang.StringBuffer)

getCurFontNr

protected final int getCurFontNr()
Returns the current font number value.

Returns:
The curFontNr value
See Also:
setCurFontNr(int)

getCurFontType

protected final java.lang.String getCurFontType()
Returns the cur font type value.

Returns:
The curFontType value
See Also:
setCurFontType(java.lang.String)

getDebugger

protected final DebugInterface getDebugger()
Returns the debugger value.

Returns:
The debugger value

getDefaultFontNr

protected final int getDefaultFontNr()
Returns the default font number value.

Returns:
The defaultFontNr value
See Also:
setDefaultFontNr(int)

getFontSizeUnitCode

protected final java.lang.String getFontSizeUnitCode()
Returns the font size unit code value.

Returns:
String the font size unit code.

getDefaultFontStyleDefinition

protected final java.lang.String getDefaultFontStyleDefinition()
Returns the default font style definition value.

Returns:
The defaultFontStyleDefinition value

getHyperlinkListenerVector

protected final java.util.Vector getHyperlinkListenerVector()
Returns the hyperlink listener vector.

Returns:
The hyperlinkListeners value

getParser

protected final RTFKeywords getParser()
Returns the parser.

Returns:
The parser value
See Also:
setParser(de.betabeans.scroogexhtml.rtf.RTFKeywords)

getReader

protected final RTFReader getReader()
Returns the reader.

Returns:
The reader value
See Also:
setReader(de.betabeans.scroogexhtml.converter.RTFReader)

getTabString

protected final java.lang.String getTabString()
Returns a string which will be used to replace a \tab token in the RTF document.

Returns:
The tabString value

getTagClassParam

protected final java.lang.String getTagClassParam(java.lang.String tagName)
Build the style="..." parameter for the given tag.

Parameters:
tagName - The name of the HTML element.
Returns:
The tagClassParam value

getTagStyleParam

protected final java.lang.String getTagStyleParam(java.lang.String tagName)
Returns the tag style parameter value.

Parameters:
tagName - The name of the HTML element.
Returns:
The tagStyleParam value

getWriter

protected final Writer getWriter()
Returns the writer.

Returns:
The writer value
See Also:
setWriter(de.betabeans.scroogexhtml.converter.Writer)

addAfterTextConversionListener

public final void addAfterTextConversionListener(AfterTextConversionListener listener)
Add an afterTextConversion listener. If You write an event handler for the beans 'afterTextConversion' event, the event handler will be added to the list of afterTextConversion listeners.

Parameters:
listener - The listener to be added to the AfterTextConversionListener attribute
See Also:
removeAfterTextConversionListener(de.betabeans.scroogexhtml.events.AfterTextConversionListener)

addBeforeTextConversionListener

public final void addBeforeTextConversionListener(BeforeTextConversionListener listener)
Add an beforeTextConversion listener. If You write an event handler for the beans 'beforeTextConversion' event, the event handler will be added to the list of beforeTextConversion listeners.

Example:

In this example, an event handler "scroogeXHTML1_beforeTextConversion" is created and assigned to the bean instance. The event handler checks the text in the text element. If it starts with "<" and ends with ">", the text will be replaced by a hyperlink. Finally, the "encoded" flag is set to indicate that the text element needs no additional processing.

 
   scroogeXHTML1.addBeforeTextConversionListener(
    new de.betabeans.scroogexhtml.events.BeforeTextConversionListener() {
      public void beforeTextConversion(BeforeTextConversionEvent e) {
        scroogeXHTML1_beforeTextConversion(e);
      }
    });
   ...
   void scroogeXHTML1_beforeTextConversion(BeforeTextConversionEvent e) {
     if (e.getTextElement().getText().startsWith("<") && e.getTextElement().getText().endsWith(">"))
     {
       e.getTextElement().setText("<a href=\"http://www.betabeans.de\">BetaBeans</a>");
         e.getTextElement().setEncoded(true);
     }
   }
   
 

Parameters:
listener - The listener to be added to the BeforeTextConversionListener attribute
See Also:
removeBeforeTextConversionListener(de.betabeans.scroogexhtml.events.BeforeTextConversionListener)

addHyperlinkListener

public final void addHyperlinkListener(HyperlinkListener listener)
Add a hyperlink listener. If You write an event handler for the beans 'hyperlink' event, the event handler will be added to the list of hyperlink listeners.

Parameters:
listener - The feature to be added to the HyperlinkListener attribute
See Also:
removeHyperlinkListener(de.betabeans.scroogexhtml.events.HyperlinkListener)

addProgressListener

public final void addProgressListener(ProgressListener listener)
Add a progress listener. If You write an event handler for the beans 'progress' event, the event handler will be added to the list of progress listeners.

Parameters:
listener - The feature to be added to the ProgressListener attribute
See Also:
removeProgressListener(de.betabeans.scroogexhtml.events.ProgressListener)

removeAfterTextConversionListener

public final void removeAfterTextConversionListener(AfterTextConversionListener listener)
Remove a AfterTextConversionListener.

Parameters:
listener - The conversion listener.
See Also:
addAfterTextConversionListener(de.betabeans.scroogexhtml.events.AfterTextConversionListener)

removeBeforeTextConversionListener

public final void removeBeforeTextConversionListener(BeforeTextConversionListener listener)
Remove a BeforeTextConversionListener.

Parameters:
listener - The conversion listener.
See Also:
addBeforeTextConversionListener(de.betabeans.scroogexhtml.events.BeforeTextConversionListener)

removeHyperlinkListener

public final void removeHyperlinkListener(HyperlinkListener listener)
Remove a HyperlinkListener.

Parameters:
listener - The hyperlink listener.
See Also:
addHyperlinkListener(de.betabeans.scroogexhtml.events.HyperlinkListener)

removeProgressListener

public final void removeProgressListener(ProgressListener listener)
Remove a ProgressListener.

Parameters:
listener - The progress listener.
See Also:
addProgressListener(de.betabeans.scroogexhtml.events.ProgressListener)

process

public abstract java.lang.String process(FormattedText textElement)
The FormattedText objects which are stored in the Document instance call this method to convert themselves to HTML. The implementation of this abstract method is in ScroogeXHTMLMain.

Parameters:
textElement - The text element.
Returns:
The generated HTML code.

debug

public final void debug(java.lang.String color,
                        java.lang.String debugText)
This methods writes a debug string to the output document. The color of the string is defined as text (for example "green").

Parameters:
color - the debug string color
debugText - The message to be written.

debug

public final void debug(java.lang.String color,
                        char debugChar)
Write debug string.

Parameters:
color - The debug string color.
debugChar - The character to be written.

hasProgressListeners

protected final boolean hasProgressListeners()
Check if there are registered progress listeners.

Returns:
True if there are progress listeners.

notifyProgress

protected final void notifyProgress()
Notify all existing progress listeners.


replaceHyperlink

protected abstract void replaceHyperlink(FormattedText textElement)
(implemented by ScroogeXHTMLMain).

Parameters:
textElement - The text element to be processed.

setDefaultLanguage

public final void setDefaultLanguage(java.lang.String newValue)
Set the default language code.

Parameters:
newValue - the default language code.
See Also:
getDefaultLanguage()
Default value:
empty

getDefaultLanguage

public final java.lang.String getDefaultLanguage()
Get the value of the defaultLanguage property.

Returns:
The default language code.
See Also:
setDefaultLanguage(java.lang.String)

isConvertLanguage

public final boolean isConvertLanguage()
Get the value of the convertLanguage property.

Returns:
the convertLanguage property

setConvertLanguage

public final void setConvertLanguage(boolean newValue)
Set the value of the convertLanguage property.

Parameters:
newValue - set the convertLanguage property

getFontSizeUnit

public final byte getFontSizeUnit()
Get the value of the fontSizeUnit property.

Returns:
the current property value
See Also:
setFontSizeUnit(byte)

setFontSizeUnit

public final void setFontSizeUnit(byte newValue)
Set the fontSizeUnit property. Valid values are: FONTSIZE_EMFONTSIZE_EX FONTSIZE_PERCENTFONTSIZE_POINT

Parameters:
newValue - the new property value
See Also:
getFontSizeUnit()
Default value:
FONTSIZE_POINT

getFormatter

public final Formatter getFormatter()
Get the output formatter object.

Returns:
Formatter


Copyright (c) 1998-2006 BetaSoft Michael Justin. All Rights Reserved.