All Packages Class Hierarchy This Package Previous Next Index
Class jp.kyasu.graphics.RichTextStyle
java.lang.Object
|
+----jp.kyasu.graphics.RichTextStyle
- public class RichTextStyle
- extends Object
- implements Cloneable, Serializable
The RichTextStyle
implements the style for the rich text
object. The rich text style has following attributes:
- Line wrapping style
- The line wrapping style; one of
CHAR_WRAP
, WORD_WRAP
and NO_WRAP
.
- Line end style
- The line end style; one of
JAVA_LINE_SEPARATOR
,
JAVA_LINE_SEPARATOR_WITH_BREAK
and
LIST_SEPARATOR
.
- Variable line height
- The flag determining the line height
of the rich text is variable.
- Text style
- The default text style for the rich text.
- Paragraph style
- The default paragraph style for the rich
text.
- Tab width
- The default tab width for the rich text. The
tab width is automatically computed by multiplying a width of space
character with the default text style by
ParagraphStyle.HARD_TAB_LENGTH
.
The rich text style is immutable.
- Version:
- 12 Jun 1998
- Author:
- Kazuki YASUMATSU
- See Also:
- RichText, TextLayout, TextScanner
-
CHAR_WRAP
- The constant for the character line wrapping style.
-
DEFAULT_CODE_STYLE
- The default rich text style constant for coding.
-
DEFAULT_DOCUMENT_STYLE
- The default rich text style constant for documenting.
-
DEFAULT_LIST_STYLE
- The default rich text style constant for documenting.
-
JAVA_LINE_SEPARATOR
- The constant for the java line end style.
-
JAVA_LINE_SEPARATOR_WITH_BREAK
- The constant for the java line end style with line break.
-
LIST_SEPARATOR
- The constant for the list line end style.
-
NO_WRAP
- The constant for the no line wrapping style.
-
WORD_WRAP
- The constant for the word line wrapping style.
-
RichTextStyle(int)
- Constructs a rich text style with the specified line wrapping style.
-
RichTextStyle(int, boolean)
- Constructs a rich text style with the specified line wrapping style
and flag determining the line height is variable.
-
RichTextStyle(int, int, boolean)
- Constructs a rich text style with the specified line wrapping style,
line end style and flag determining the line height is variable.
-
RichTextStyle(int, int, boolean, TextStyle, ParagraphStyle)
- Constructs a rich text style with the specified line wrapping style,
line end style, flag determining the line height is variable,
default text style and default paragraph style.
-
clone()
- Returns a clone of this rich text style.
-
deriveStyle(int, int)
- Creates a new style by replicating this style with a new line
wrapping style and line end style associated with it.
-
deriveStyle(ParagraphStyle)
- Creates a new style by replicating this style with a new paragraph
style object associated with it.
-
deriveStyle(TextStyle)
- Creates a new style by replicating this style with a new text
style object associated with it.
-
equals(Object)
- Compares two objects for equality.
-
getLineEnd()
- Returns the line end style.
-
getLineEndChar()
- Returns the line end character.
-
getLineWrap()
- Returns the line wrapping style.
-
getParagraphStyle()
- Returns the default paragraph style for the rich text.
-
getTabWidth()
- Returns the default tab width.
-
getTextStyle()
- Returns the default text style for the rich text.
-
handleBreak()
- Checks if the line break is handled.
-
hashCode()
- Returns a hashcode of this rich text style.
-
isCharWrap()
- Checks if the line wrapping style is the character line wrapping style.
-
isJavaLineSeparator()
- Checks if the line end style is the java line end style.
-
isJavaLineSeparatorWithBreak()
- Checks if the line end style is the java line end style with line break.
-
isListSeparator()
- Checks if the line end style is the list line end style.
-
isNoWrap()
- Checks if the line wrapping style is the no line wrapping style.
-
isVariableLineHeight()
- Checks if the line height of the rich text is variable.
-
isWordWrap()
- Checks if the line wrapping style is the word line wrapping style.
-
multipleParagraphStylesAllowed()
- Checks if multiple paragraph styles are allowed.
-
toString()
- Returns the string representation of this rich text style.
CHAR_WRAP
public static final int CHAR_WRAP
- The constant for the character line wrapping style.
The line is wrapped at the character boundary.
This style is suited for coding.
WORD_WRAP
public static final int WORD_WRAP
- The constant for the word line wrapping style.
The line is wrapped at the word boundary.
This style is suited for documenting.
NO_WRAP
public static final int NO_WRAP
- The constant for the no line wrapping style.
The line is wrapped only at the line separator.
- See Also:
- LINE_SEPARATOR_CHAR
JAVA_LINE_SEPARATOR
public static final int JAVA_LINE_SEPARATOR
- The constant for the java line end style.
That is the paragraph is separated by the
Text.LINE_SEPARATOR_CHAR
.
- See Also:
- LINE_SEPARATOR_CHAR, TextScanner, JAVA_STOPS
JAVA_LINE_SEPARATOR_WITH_BREAK
public static final int JAVA_LINE_SEPARATOR_WITH_BREAK
- The constant for the java line end style with line break.
That is the paragraph is separated by the
Text.LINE_SEPARATOR_CHAR
and the line is
broken by the Text.LINE_BREAK_CHAR
.
- See Also:
- LINE_SEPARATOR_CHAR, LINE_BREAK_CHAR, TextScanner, JAVA_BREAK_STOPS
LIST_SEPARATOR
public static final int LIST_SEPARATOR
- The constant for the list line end style.
That is the paragraph (list item) is separated by the
Text.LIST_SEPARATOR_CHAR
.
- See Also:
- LIST_SEPARATOR_CHAR, LIST_STOPS, TextListView
DEFAULT_CODE_STYLE
public static final RichTextStyle DEFAULT_CODE_STYLE
- The default rich text style constant for coding.
DEFAULT_DOCUMENT_STYLE
public static final RichTextStyle DEFAULT_DOCUMENT_STYLE
- The default rich text style constant for documenting.
DEFAULT_LIST_STYLE
public static final RichTextStyle DEFAULT_LIST_STYLE
- The default rich text style constant for documenting.
RichTextStyle
public RichTextStyle(int lineWrap)
- Constructs a rich text style with the specified line wrapping style.
- Parameters:
- lineWrap - the line wrapping style.
RichTextStyle
public RichTextStyle(int lineWrap,
boolean variableLineHeight)
- Constructs a rich text style with the specified line wrapping style
and flag determining the line height is variable.
- Parameters:
- lineWrap - the line wrapping style.
- variableLineHeight - the flag determining the line height is
variable.
RichTextStyle
public RichTextStyle(int lineWrap,
int lineEnd,
boolean variableLineHeight)
- Constructs a rich text style with the specified line wrapping style,
line end style and flag determining the line height is variable.
- Parameters:
- lineWrap - the line wrapping style.
- lineEnd - the line end style.
- variableLineHeight - the flag determining the line height is
variable.
RichTextStyle
public RichTextStyle(int lineWrap,
int lineEnd,
boolean variableLineHeight,
TextStyle textStyle,
ParagraphStyle paragraphStyle)
- Constructs a rich text style with the specified line wrapping style,
line end style, flag determining the line height is variable,
default text style and default paragraph style.
- Parameters:
- lineWrap - the line wrapping style.
- lineEnd - the line end style.
- variableLineHeight - the flag determining the line height is
variable.
- textStyle - the default text style.
- paragraphStyle - the default paragraph style.
getLineWrap
public final int getLineWrap()
- Returns the line wrapping style.
- See Also:
- CHAR_WRAP, WORD_WRAP, NO_WRAP
getLineEnd
public final int getLineEnd()
- Returns the line end style.
- See Also:
- JAVA_LINE_SEPARATOR, JAVA_LINE_SEPARATOR_WITH_BREAK, LIST_SEPARATOR
getLineEndChar
public final char getLineEndChar()
- Returns the line end character.
- See Also:
- LINE_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR
isVariableLineHeight
public final boolean isVariableLineHeight()
- Checks if the line height of the rich text is variable.
multipleParagraphStylesAllowed
public final boolean multipleParagraphStylesAllowed()
- Checks if multiple paragraph styles are allowed.
getTextStyle
public final TextStyle getTextStyle()
- Returns the default text style for the rich text.
getParagraphStyle
public final ParagraphStyle getParagraphStyle()
- Returns the default paragraph style for the rich text.
getTabWidth
public int getTabWidth()
- Returns the default tab width.
isCharWrap
public final boolean isCharWrap()
- Checks if the line wrapping style is the character line wrapping style.
- See Also:
- getLineWrap, CHAR_WRAP
isWordWrap
public final boolean isWordWrap()
- Checks if the line wrapping style is the word line wrapping style.
- See Also:
- getLineWrap, WORD_WRAP
isNoWrap
public final boolean isNoWrap()
- Checks if the line wrapping style is the no line wrapping style.
- See Also:
- getLineWrap, NO_WRAP
isJavaLineSeparator
public final boolean isJavaLineSeparator()
- Checks if the line end style is the java line end style.
- See Also:
- getLineEnd, JAVA_LINE_SEPARATOR
isJavaLineSeparatorWithBreak
public final boolean isJavaLineSeparatorWithBreak()
- Checks if the line end style is the java line end style with line break.
- See Also:
- getLineEnd, JAVA_LINE_SEPARATOR_WITH_BREAK
isListSeparator
public final boolean isListSeparator()
- Checks if the line end style is the list line end style.
- See Also:
- getLineEnd, LIST_SEPARATOR
handleBreak
public final boolean handleBreak()
- Checks if the line break is handled.
- See Also:
- isJavaLineSeparatorWithBreak, JAVA_LINE_SEPARATOR_WITH_BREAK
deriveStyle
public RichTextStyle deriveStyle(int lineWrap,
int lineEnd)
- Creates a new style by replicating this style with a new line
wrapping style and line end style associated with it.
- Parameters:
- lineWrap - the line wrapping style for the new style.
- lineEnd - the line end style for the new style.
- Returns:
- a new style.
deriveStyle
public RichTextStyle deriveStyle(TextStyle textStyle)
- Creates a new style by replicating this style with a new text
style object associated with it.
- Parameters:
- textStyle - the text style object for the new style.
- Returns:
- a new style.
deriveStyle
public RichTextStyle deriveStyle(ParagraphStyle paragraphStyle)
- Creates a new style by replicating this style with a new paragraph
style object associated with it.
- Parameters:
- paragraphStyle - the paragraph style object for the new style.
- Returns:
- a new style.
hashCode
public int hashCode()
- Returns a hashcode of this rich text style.
- Overrides:
- hashCode in class Object
equals
public boolean equals(Object anObject)
- Compares two objects for equality.
- Overrides:
- equals in class Object
clone
public Object clone()
- Returns a clone of this rich text style.
- Overrides:
- clone in class Object
toString
public String toString()
- Returns the string representation of this rich text style.
- Overrides:
- toString in class Object
All Packages Class Hierarchy This Package Previous Next Index