public class HTMLStyle
extends java.lang.Object
implements java.io.Serializable
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.
HTMLText,
HTMLReader,
HTMLWriter,
直列化された形式| 修飾子とタイプ | フィールドと説明 |
|---|---|
protected ParagraphStyle |
baseParagraphStyle
The base paragraph style.
|
protected TextStyle |
baseTextStyle
The base text style.
|
protected static int |
BQ_INDENT
The first indentation of BLOCKQUOTE.
|
protected static int |
BQ_INDENT_LEFT_INC
The increment of the left indentation of BLOCKQUOTE.
|
protected static int |
BQ_INDENT_RIGHT_INC
The increment of the right indentation of BLOCKQUOTE.
|
static java.lang.String |
DEFAULT_BASE_FONT_NAME
The default base font name.
|
static int |
DEFAULT_HTML_FONT
The the default font index.
|
protected static java.util.Hashtable |
HeadingCache |
protected static int |
HTML_FONT_1_DIFF
The difference of the point size for the font index 1.
|
protected static int |
HTML_FONT_2_DIFF
The difference of the point size for the font index 2.
|
protected static int |
HTML_FONT_3_DIFF
The difference of the point size for the font index 3.
|
protected static int |
HTML_FONT_4_DIFF
The difference of the point size for the font index 4.
|
protected static int |
HTML_FONT_5_DIFF
The difference of the point size for the font index 5.
|
protected static int |
HTML_FONT_6_DIFF
The difference of the point size for the font index 6.
|
protected static int |
HTML_FONT_7_DIFF
The difference of the point size for the font index 7.
|
protected static int |
LIST_HEADING_SPACE
The heading space for the UL and OL.
|
protected static int |
LIST_INDENT
The indentation of the UL, OL and DL.
|
protected java.util.Hashtable |
paragraphStyles
The paragraph styles for HTML tags.
|
protected java.util.Hashtable |
textStyleModifiers
The text style modifiers for HTML tags.
|
| コンストラクタと説明 |
|---|
HTMLStyle()
Constructs a html style.
|
HTMLStyle(java.awt.Font baseFont)
Constructs a html style with the specified base font.
|
HTMLStyle(int baseSize)
Constructs a html style with the specified base font size.
|
HTMLStyle(TextStyle textStyle)
Constructs a html style with the specified base text style.
|
HTMLStyle(TextStyle textStyle,
ParagraphStyle paragraphStyle)
Constructs a html style with the specified base text style and
paragraph style.
|
| 修飾子とタイプ | メソッドと説明 |
|---|---|
ParagraphStyle |
getBaseParagraphStyle()
Returns the base paragraph style of this html style.
|
TextStyle |
getBaseTextStyle()
Returns the base text style of this html style.
|
int |
getBqIncrementLevel(ParagraphStyle pStyle)
Returns the nesting level of the BLOCKQUOTE tag from the specified
paragraph style.
|
ParagraphStyle |
getDDParagraphStyle(int level)
Returns the paragraph style for the DD tag with the specified
nesting level.
|
ParagraphStyle |
getDefaultParagraphStyle()
Returns the default paragraph style for the HTML documents.
|
RichTextStyle |
getDefaultRichTextStyle()
Returns the default rich text style for the HTML documents.
|
TextStyle |
getDefaultTextStyle()
Returns the default text style for the HTML documents.
|
ParagraphStyle |
getDTParagraphStyle(int level)
Returns the paragraph style for the DT tag with the specified
nesting level.
|
int |
getFontPointDifference(int htmlFontIndex)
Returns the difference of the point size of the font from the base
font at the specified html font index.
|
int |
getHRSize()
Returns the default height of the HR tag.
|
int |
getHTMLFontIndex(int pointDiff)
Returns the html font index from the specified difference of the point
size of the font from the base font.
|
int |
getLeftBqIncrementSize(int level)
Returns the increment size for the left margin indentation of
the BLOCKQUOTE tag at the specified nesting level.
|
int |
getLeftIndentation(int bqLevel,
int listLevel)
Returns the left margin indentation with the specified BLOCKQUOTE
level and lists (UL, OL, DL) level.
|
int |
getListIncrementLevel(ParagraphStyle pStyle)
Returns the nesting level of the lists (UL, OL, DL) from the specified
paragraph style.
|
int |
getListIncrementSize(int level)
Returns the increment size for the left margin indentation of the
lists (UL, OL, DL) at the specified nesting level.
|
Visualizable |
getOLIHeading(int level,
int index,
TextStyle baseStyle,
java.awt.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.
|
int |
getOLIIndex(Visualizable v)
Gets the index of the LI tag in the OL (LI-OL) from the specified
visual heading.
|
ParagraphStyle |
getOLIParagraphStyle(int level,
int index,
java.awt.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.
|
ParagraphStyle |
getParagraphStyle(java.lang.String name)
Returns the paragraph style associated with the specified HTML tag.
|
int |
getRightBqIncrementSize(int level)
Returns the increment size for the right margin indentation of
the BLOCKQUOTE tag at the specified nesting level.
|
int |
getRightIndentation(int bqLevel,
int listLevel)
Returns the right margin indentation with the specified BLOCKQUOTE
level and lists (UL, OL, DL) level.
|
TextStyleModifier |
getTextStyleModifier(java.lang.String name)
Returns the text style modifier associated with the specified HTML tag.
|
Visualizable |
getULIHeading(int level,
TextStyle baseStyle,
java.awt.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.
|
ParagraphStyle |
getULIParagraphStyle(int level,
java.awt.Color textColor)
Returns the paragraph style for the LI tag in the UL (LI-UL), with
the specified nesting level and text color.
|
protected void |
initParagraphStyles()
Initializes the paragraph styles associated with the HTML tags;
P, H1, H2, H3, H4, H5, H6, LI (LI-UL, LI-OL), DT, DD, ADDRESS and PRE.
|
protected void |
initStyles()
Initializes the text style modifiers and paragraph styles associated
with the HTML tags.
|
protected void |
initTextStyleModifiers()
Initializes the text style modifiers associated with the HTML tags;
B, STRONG, I, CITE, DFN, EM, U, TT, CODE, KBD, SAMP, VAR, BIG and SMALL.
|
protected TextStyle baseTextStyle
protected ParagraphStyle baseParagraphStyle
protected java.util.Hashtable textStyleModifiers
protected java.util.Hashtable paragraphStyles
public static final java.lang.String DEFAULT_BASE_FONT_NAME
protected static final int LIST_HEADING_SPACE
protected static final int LIST_INDENT
protected static final int BQ_INDENT
protected static final int BQ_INDENT_LEFT_INC
protected static final int BQ_INDENT_RIGHT_INC
public static final int DEFAULT_HTML_FONT
protected static final int HTML_FONT_7_DIFF
protected static final int HTML_FONT_6_DIFF
protected static final int HTML_FONT_5_DIFF
protected static final int HTML_FONT_4_DIFF
protected static final int HTML_FONT_3_DIFF
protected static final int HTML_FONT_2_DIFF
protected static final int HTML_FONT_1_DIFF
protected static final java.util.Hashtable HeadingCache
public HTMLStyle()
public HTMLStyle(int baseSize)
baseSize - the base font size.public HTMLStyle(java.awt.Font baseFont)
baseFont - the base font.public HTMLStyle(TextStyle textStyle)
textStyle - the base text style.public HTMLStyle(TextStyle textStyle, ParagraphStyle paragraphStyle)
textStyle - the base text style.paragraphStyle - the base paragraph style.public TextStyle getBaseTextStyle()
public ParagraphStyle getBaseParagraphStyle()
public TextStyle getDefaultTextStyle()
public ParagraphStyle getDefaultParagraphStyle()
public RichTextStyle getDefaultRichTextStyle()
public TextStyleModifier getTextStyleModifier(java.lang.String name)
name - the name of the HTML tag.null if the
associated text style modifier does not exist.public ParagraphStyle getParagraphStyle(java.lang.String name)
name - the name of the HTML tag.null if the
associated paragraph style does not exist.public int getFontPointDifference(int htmlFontIndex)
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.
htmlFontIndex - the html font index that corresponds to the
value of the size attribute of the
FONT tag.getHTMLFontIndex(int)public int getHTMLFontIndex(int pointDiff)
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.
pointDiff - the difference of the point size from the base font.size attribute of the FONT tag.getFontPointDifference(int)public int getHRSize()
public int getLeftBqIncrementSize(int level)
public int getRightBqIncrementSize(int level)
public int getBqIncrementLevel(ParagraphStyle pStyle)
public int getListIncrementSize(int level)
public int getListIncrementLevel(ParagraphStyle pStyle)
public int getLeftIndentation(int bqLevel,
int listLevel)
public int getRightIndentation(int bqLevel,
int listLevel)
public ParagraphStyle getULIParagraphStyle(int level, java.awt.Color textColor)
public ParagraphStyle getOLIParagraphStyle(int level, int index, java.awt.Color textColor)
public ParagraphStyle getDTParagraphStyle(int level)
public ParagraphStyle getDDParagraphStyle(int level)
public Visualizable getULIHeading(int level, TextStyle baseStyle, java.awt.Color textColor)
public Visualizable getOLIHeading(int level, int index, TextStyle baseStyle, java.awt.Color textColor)
public int getOLIIndex(Visualizable v)
#getOLIHeading(int, int, jp.kyasu.graphics.Visualizable, jp.kyasu.graphics.TextStyle, java.awt.Color)protected void initStyles()
protected void initTextStyleModifiers()
protected void initParagraphStyles()