All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class jp.kyasu.graphics.html.HTMLStyle

java.lang.Object
   |
   +----jp.kyasu.graphics.html.HTMLStyle

public class HTMLStyle
extends Object
implements Serializable
The HTMLStyle class implements the style for the HTML document (HTMLText).

The html style provides text style modifiers associated with the following HTML tags:
B, STRONG, I, CITE, DFN, EM, U, TT, CODE, KBD, SAMP, VAR, BIG and SMALL.

The html style also provides paragraph styles associated with the following HTML tags:
P, H1, H2, H3, H4, H5, H6, LI (LI-UL, LI-OL), DT, DD, ADDRESS and PRE.
LI-UL and LI-OLcorresponds to the LI tag in the UL and OL respectively.

Version:
24 Jun 1998
Author:
Kazuki YASUMATSU
See Also:
HTMLText, HTMLReader, HTMLWriter

Variable Index

 o DEFAULT_BASE_FONT_NAME
The default base font name.
 o DEFAULT_HTML_FONT
The the default font index.

Constructor Index

 o HTMLStyle()
Constructs a html style.
 o HTMLStyle(Font)
Constructs a html style with the specified base font.
 o HTMLStyle(int)
Constructs a html style with the specified base font size.
 o HTMLStyle(TextStyle)
Constructs a html style with the specified base text style.
 o HTMLStyle(TextStyle, ParagraphStyle)
Constructs a html style with the specified base text style and paragraph style.

Method Index

 o getBaseParagraphStyle()
Returns the base paragraph style of this html style.
 o getBaseTextStyle()
Returns the base text style of this html style.
 o getBqIncrementLevel(ParagraphStyle)
Returns the nesting level of the BLOCKQUOTE tag from the specified paragraph style.
 o getDDParagraphStyle(int)
Returns the paragraph style for the DD tag with the specified nesting level.
 o getDefaultParagraphStyle()
Returns the default paragraph style for the HTML documents.
 o getDefaultRichTextStyle()
Returns the default rich text style for the HTML documents.
 o getDefaultTextStyle()
Returns the default text style for the HTML documents.
 o getDTParagraphStyle(int)
Returns the paragraph style for the DT tag with the specified nesting level.
 o getFontPointDifference(int)
Returns the difference of the point size of the font from the base font at the specified html font index.
 o getHRSize()
Returns the default height of the HR tag.
 o getHTMLFontIndex(int)
Returns the html font index from the specified difference of the point size of the font from the base font.
 o getLeftBqIncrementSize(int)
Returns the increment size for the left margin indentation of the BLOCKQUOTE tag at the specified nesting level.
 o getLeftIndentation(int, int)
Returns the left margin indentation with the specified BLOCKQUOTE level and lists (UL, OL, DL) level.
 o getListIncrementLevel(ParagraphStyle)
Returns the nesting level of the lists (UL, OL, DL) from the specified paragraph style.
 o getListIncrementSize(int)
Returns the increment size for the left margin indentation of the lists (UL, OL, DL) at the specified nesting level.
 o getOLIHeading(int, int, TextStyle, Color)
Returns the visual heading for the LI tag in the OL (LI-OL), with the specified nesting level, ordered index, current base text style and text color.
 o getOLIIndex(Visualizable)
Gets the index of the LI tag in the OL (LI-OL) from the specified visual heading.
 o getOLIParagraphStyle(int, int, Color)
Returns the paragraph style for the LI tag in the OL (LI-OL), with the specified nesting level, ordered index and text color.
 o getParagraphStyle(String)
Returns the paragraph style associated with the specified HTML tag.
 o getRightBqIncrementSize(int)
Returns the increment size for the right margin indentation of the BLOCKQUOTE tag at the specified nesting level.
 o getRightIndentation(int, int)
Returns the right margin indentation with the specified BLOCKQUOTE level and lists (UL, OL, DL) level.
 o getTextStyleModifier(String)
Returns the text style modifier associated with the specified HTML tag.
 o getULIHeading(int, TextStyle, Color)
Returns the visual heading for the LI tag in the UL (LI-UL), with the specified nesting level, current base text style and text color.
 o getULIParagraphStyle(int, Color)
Returns the paragraph style for the LI tag in the UL (LI-UL), with the specified nesting level and text color.

Variables

 o DEFAULT_BASE_FONT_NAME
 public static final String DEFAULT_BASE_FONT_NAME
The default base font name.

 o DEFAULT_HTML_FONT
 public static final int DEFAULT_HTML_FONT
The the default font index.

Constructors

 o HTMLStyle
 public HTMLStyle()
Constructs a html style.

 o HTMLStyle
 public HTMLStyle(int baseSize)
Constructs a html style with the specified base font size.

Parameters:
baseSize - the base font size.
 o HTMLStyle
 public HTMLStyle(Font baseFont)
Constructs a html style with the specified base font. The style of the base font must be plain.

Parameters:
baseFont - the base font.
 o HTMLStyle
 public HTMLStyle(TextStyle textStyle)
Constructs a html style with the specified base text style. The style of the font of the base text style must be plain.

Parameters:
textStyle - the base text style.
 o HTMLStyle
 public HTMLStyle(TextStyle textStyle,
                  ParagraphStyle paragraphStyle)
Constructs a html style with the specified base text style and paragraph style. The style of the font of the base text style must be plain.

Parameters:
textStyle - the base text style.
paragraphStyle - the base paragraph style.

Methods

 o getBaseTextStyle
 public TextStyle getBaseTextStyle()
Returns the base text style of this html style.

 o getBaseParagraphStyle
 public ParagraphStyle getBaseParagraphStyle()
Returns the base paragraph style of this html style.

 o getDefaultTextStyle
 public TextStyle getDefaultTextStyle()
Returns the default text style for the HTML documents.

 o getDefaultParagraphStyle
 public ParagraphStyle getDefaultParagraphStyle()
Returns the default paragraph style for the HTML documents.

 o getDefaultRichTextStyle
 public RichTextStyle getDefaultRichTextStyle()
Returns the default rich text style for the HTML documents.

 o getTextStyleModifier
 public TextStyleModifier getTextStyleModifier(String name)
Returns the text style modifier associated with the specified HTML tag. The associated HTML tags are B, STRONG, I, CITE, DFN, EM, U, TT, CODE, KBD, SAMP, VAR, BIG and SMALL.

Parameters:
name - the name of the HTML tag.
Returns:
the text style modifier; or null if the associated text style modifier does not exist.
 o getParagraphStyle
 public ParagraphStyle getParagraphStyle(String name)
Returns the paragraph style associated with the specified HTML tag. The associated HTML tags are P, H1, H2, H3, H4, H5, H6, LI (LI-UL, LI-OL), DT, DD, ADDRESS and PRE.

Parameters:
name - the name of the HTML tag.
Returns:
the paragraph style; or null if the associated paragraph style does not exist.
 o getFontPointDifference
 public int getFontPointDifference(int htmlFontIndex)
Returns the difference of the point size of the font from the base font at the specified html font index.

The value of the size attribute of the FONT tag is an integer ranging from 1 to 7 with no direct mapping to point sizes.

Parameters:
htmlFontIndex - the html font index that corresponds to the value of the size attribute of the FONT tag.
Returns:
the difference of the point size from the base font.
See Also:
getHTMLFontIndex
 o getHTMLFontIndex
 public int getHTMLFontIndex(int pointDiff)
Returns the html font index from the specified difference of the point size of the font from the base font.

The value of the size attribute of the FONT tag is an integer ranging from 1 to 7 with no direct mapping to point sizes.

Parameters:
pointDiff - the difference of the point size from the base font.
Returns:
the html font index that corresponds to the value of the size attribute of the FONT tag.
See Also:
getFontPointDifference
 o getHRSize
 public int getHRSize()
Returns the default height of the HR tag.

 o getLeftBqIncrementSize
 public int getLeftBqIncrementSize(int level)
Returns the increment size for the left margin indentation of the BLOCKQUOTE tag at the specified nesting level.

See Also:
getRightBqIncrementSize, getBqIncrementLevel
 o getRightBqIncrementSize
 public int getRightBqIncrementSize(int level)
Returns the increment size for the right margin indentation of the BLOCKQUOTE tag at the specified nesting level.

See Also:
getLeftBqIncrementSize, getBqIncrementLevel
 o getBqIncrementLevel
 public int getBqIncrementLevel(ParagraphStyle pStyle)
Returns the nesting level of the BLOCKQUOTE tag from the specified paragraph style.

See Also:
getLeftBqIncrementSize, getRightBqIncrementSize
 o getListIncrementSize
 public int getListIncrementSize(int level)
Returns the increment size for the left margin indentation of the lists (UL, OL, DL) at the specified nesting level.

See Also:
getListIncrementLevel
 o getListIncrementLevel
 public int getListIncrementLevel(ParagraphStyle pStyle)
Returns the nesting level of the lists (UL, OL, DL) from the specified paragraph style.

See Also:
getListIncrementSize
 o getLeftIndentation
 public int getLeftIndentation(int bqLevel,
                               int listLevel)
Returns the left margin indentation with the specified BLOCKQUOTE level and lists (UL, OL, DL) level.

See Also:
getLeftBqIncrementSize, getListIncrementSize, getRightIndentation
 o getRightIndentation
 public int getRightIndentation(int bqLevel,
                                int listLevel)
Returns the right margin indentation with the specified BLOCKQUOTE level and lists (UL, OL, DL) level.

See Also:
getRightBqIncrementSize, getLeftIndentation
 o getULIParagraphStyle
 public ParagraphStyle getULIParagraphStyle(int level,
                                            Color textColor)
Returns the paragraph style for the LI tag in the UL (LI-UL), with the specified nesting level and text color.

 o getOLIParagraphStyle
 public ParagraphStyle getOLIParagraphStyle(int level,
                                            int index,
                                            Color textColor)
Returns the paragraph style for the LI tag in the OL (LI-OL), with the specified nesting level, ordered index and text color.

 o getDTParagraphStyle
 public ParagraphStyle getDTParagraphStyle(int level)
Returns the paragraph style for the DT tag with the specified nesting level.

 o getDDParagraphStyle
 public ParagraphStyle getDDParagraphStyle(int level)
Returns the paragraph style for the DD tag with the specified nesting level.

 o getULIHeading
 public Visualizable getULIHeading(int level,
                                   TextStyle baseStyle,
                                   Color textColor)
Returns the visual heading for the LI tag in the UL (LI-UL), with the specified nesting level, current base text style and text color.

 o getOLIHeading
 public Visualizable getOLIHeading(int level,
                                   int index,
                                   TextStyle baseStyle,
                                   Color textColor)
Returns the visual heading for the LI tag in the OL (LI-OL), with the specified nesting level, ordered index, current base text style and text color.

See Also:
getOLIIndex
 o getOLIIndex
 public int getOLIIndex(Visualizable v)
Gets the index of the LI tag in the OL (LI-OL) from the specified visual heading.

See Also:
getOLIHeading

All Packages  Class Hierarchy  This Package  Previous  Next  Index