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-OL
corresponds to the
LI
tag in the UL
and OL
respectively.
- Version:
- 24 Jun 1998
- Author:
- Kazuki YASUMATSU
- See Also:
- HTMLText, HTMLReader, HTMLWriter
-
DEFAULT_BASE_FONT_NAME
- The default base font name.
-
DEFAULT_HTML_FONT
- The the default font index.
-
HTMLStyle()
- Constructs a html style.
-
HTMLStyle(Font)
- Constructs a html style with the specified base font.
-
HTMLStyle(int)
- Constructs a html style with the specified base font size.
-
HTMLStyle(TextStyle)
- Constructs a html style with the specified base text style.
-
HTMLStyle(TextStyle, ParagraphStyle)
- Constructs a html style with the specified base text style and
paragraph style.
-
getBaseParagraphStyle()
- Returns the base paragraph style of this html style.
-
getBaseTextStyle()
- Returns the base text style of this html style.
-
getBqIncrementLevel(ParagraphStyle)
- Returns the nesting level of the BLOCKQUOTE tag from the specified
paragraph style.
-
getDDParagraphStyle(int)
- Returns the paragraph style for the DD tag with the specified
nesting level.
-
getDefaultParagraphStyle()
- Returns the default paragraph style for the HTML documents.
-
getDefaultRichTextStyle()
- Returns the default rich text style for the HTML documents.
-
getDefaultTextStyle()
- Returns the default text style for the HTML documents.
-
getDTParagraphStyle(int)
- Returns the paragraph style for the DT tag with the specified
nesting level.
-
getFontPointDifference(int)
- Returns the difference of the point size of the font from the base
font at the specified html font index.
-
getHRSize()
- Returns the default height of the HR tag.
-
getHTMLFontIndex(int)
- Returns the html font index from the specified difference of the point
size of the font from the base font.
-
getLeftBqIncrementSize(int)
- Returns the increment size for the left margin indentation of
the BLOCKQUOTE tag at the specified nesting level.
-
getLeftIndentation(int, int)
- Returns the left margin indentation with the specified BLOCKQUOTE
level and lists (UL, OL, DL) level.
-
getListIncrementLevel(ParagraphStyle)
- Returns the nesting level of the lists (UL, OL, DL) from the specified
paragraph style.
-
getListIncrementSize(int)
- Returns the increment size for the left margin indentation of the
lists (UL, OL, DL) at the specified nesting level.
-
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.
-
getOLIIndex(Visualizable)
- Gets the index of the LI tag in the OL (LI-OL) from the specified
visual heading.
-
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.
-
getParagraphStyle(String)
- Returns the paragraph style associated with the specified HTML tag.
-
getRightBqIncrementSize(int)
- Returns the increment size for the right margin indentation of
the BLOCKQUOTE tag at the specified nesting level.
-
getRightIndentation(int, int)
- Returns the right margin indentation with the specified BLOCKQUOTE
level and lists (UL, OL, DL) level.
-
getTextStyleModifier(String)
- Returns the text style modifier associated with the specified HTML tag.
-
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.
-
getULIParagraphStyle(int, Color)
- Returns the paragraph style for the LI tag in the UL (LI-UL), with
the specified nesting level and text color.
DEFAULT_BASE_FONT_NAME
public static final String DEFAULT_BASE_FONT_NAME
- The default base font name.
DEFAULT_HTML_FONT
public static final int DEFAULT_HTML_FONT
- The the default font index.
HTMLStyle
public HTMLStyle()
- Constructs a html style.
HTMLStyle
public HTMLStyle(int baseSize)
- Constructs a html style with the specified base font size.
- Parameters:
- baseSize - the base font size.
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.
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.
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.
getBaseTextStyle
public TextStyle getBaseTextStyle()
- Returns the base text style of this html style.
getBaseParagraphStyle
public ParagraphStyle getBaseParagraphStyle()
- Returns the base paragraph style of this html style.
getDefaultTextStyle
public TextStyle getDefaultTextStyle()
- Returns the default text style for the HTML documents.
getDefaultParagraphStyle
public ParagraphStyle getDefaultParagraphStyle()
- Returns the default paragraph style for the HTML documents.
getDefaultRichTextStyle
public RichTextStyle getDefaultRichTextStyle()
- Returns the default rich text style for the HTML documents.
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.
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.
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
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
getHRSize
public int getHRSize()
- Returns the default height of the HR tag.
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
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
getBqIncrementLevel
public int getBqIncrementLevel(ParagraphStyle pStyle)
- Returns the nesting level of the BLOCKQUOTE tag from the specified
paragraph style.
- See Also:
- getLeftBqIncrementSize, getRightBqIncrementSize
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
getListIncrementLevel
public int getListIncrementLevel(ParagraphStyle pStyle)
- Returns the nesting level of the lists (UL, OL, DL) from the specified
paragraph style.
- See Also:
- getListIncrementSize
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
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
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.
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.
getDTParagraphStyle
public ParagraphStyle getDTParagraphStyle(int level)
- Returns the paragraph style for the DT tag with the specified
nesting level.
getDDParagraphStyle
public ParagraphStyle getDDParagraphStyle(int level)
- Returns the paragraph style for the DD tag with the specified
nesting level.
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.
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
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