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

Variable Index

 o CHAR_WRAP
The constant for the character line wrapping style.
 o DEFAULT_CODE_STYLE
The default rich text style constant for coding.
 o DEFAULT_DOCUMENT_STYLE
The default rich text style constant for documenting.
 o DEFAULT_LIST_STYLE
The default rich text style constant for documenting.
 o JAVA_LINE_SEPARATOR
The constant for the java line end style.
 o JAVA_LINE_SEPARATOR_WITH_BREAK
The constant for the java line end style with line break.
 o LIST_SEPARATOR
The constant for the list line end style.
 o NO_WRAP
The constant for the no line wrapping style.
 o WORD_WRAP
The constant for the word line wrapping style.

Constructor Index

 o RichTextStyle(int)
Constructs a rich text style with the specified line wrapping style.
 o RichTextStyle(int, boolean)
Constructs a rich text style with the specified line wrapping style and flag determining the line height is variable.
 o 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.
 o 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.

Method Index

 o clone()
Returns a clone of this rich text style.
 o deriveStyle(int, int)
Creates a new style by replicating this style with a new line wrapping style and line end style associated with it.
 o deriveStyle(ParagraphStyle)
Creates a new style by replicating this style with a new paragraph style object associated with it.
 o deriveStyle(TextStyle)
Creates a new style by replicating this style with a new text style object associated with it.
 o equals(Object)
Compares two objects for equality.
 o getLineEnd()
Returns the line end style.
 o getLineEndChar()
Returns the line end character.
 o getLineWrap()
Returns the line wrapping style.
 o getParagraphStyle()
Returns the default paragraph style for the rich text.
 o getTabWidth()
Returns the default tab width.
 o getTextStyle()
Returns the default text style for the rich text.
 o handleBreak()
Checks if the line break is handled.
 o hashCode()
Returns a hashcode of this rich text style.
 o isCharWrap()
Checks if the line wrapping style is the character line wrapping style.
 o isJavaLineSeparator()
Checks if the line end style is the java line end style.
 o isJavaLineSeparatorWithBreak()
Checks if the line end style is the java line end style with line break.
 o isListSeparator()
Checks if the line end style is the list line end style.
 o isNoWrap()
Checks if the line wrapping style is the no line wrapping style.
 o isVariableLineHeight()
Checks if the line height of the rich text is variable.
 o isWordWrap()
Checks if the line wrapping style is the word line wrapping style.
 o multipleParagraphStylesAllowed()
Checks if multiple paragraph styles are allowed.
 o toString()
Returns the string representation of this rich text style.

Variables

 o 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.

 o 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.

 o 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
 o 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
 o 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
 o 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
 o DEFAULT_CODE_STYLE
 public static final RichTextStyle DEFAULT_CODE_STYLE
The default rich text style constant for coding.

 o DEFAULT_DOCUMENT_STYLE
 public static final RichTextStyle DEFAULT_DOCUMENT_STYLE
The default rich text style constant for documenting.

 o DEFAULT_LIST_STYLE
 public static final RichTextStyle DEFAULT_LIST_STYLE
The default rich text style constant for documenting.

Constructors

 o RichTextStyle
 public RichTextStyle(int lineWrap)
Constructs a rich text style with the specified line wrapping style.

Parameters:
lineWrap - the line wrapping style.
 o 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.
 o 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.
 o 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.

Methods

 o getLineWrap
 public final int getLineWrap()
Returns the line wrapping style.

See Also:
CHAR_WRAP, WORD_WRAP, NO_WRAP
 o getLineEnd
 public final int getLineEnd()
Returns the line end style.

See Also:
JAVA_LINE_SEPARATOR, JAVA_LINE_SEPARATOR_WITH_BREAK, LIST_SEPARATOR
 o getLineEndChar
 public final char getLineEndChar()
Returns the line end character.

See Also:
LINE_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR
 o isVariableLineHeight
 public final boolean isVariableLineHeight()
Checks if the line height of the rich text is variable.

 o multipleParagraphStylesAllowed
 public final boolean multipleParagraphStylesAllowed()
Checks if multiple paragraph styles are allowed.

 o getTextStyle
 public final TextStyle getTextStyle()
Returns the default text style for the rich text.

 o getParagraphStyle
 public final ParagraphStyle getParagraphStyle()
Returns the default paragraph style for the rich text.

 o getTabWidth
 public int getTabWidth()
Returns the default tab width.

 o isCharWrap
 public final boolean isCharWrap()
Checks if the line wrapping style is the character line wrapping style.

See Also:
getLineWrap, CHAR_WRAP
 o isWordWrap
 public final boolean isWordWrap()
Checks if the line wrapping style is the word line wrapping style.

See Also:
getLineWrap, WORD_WRAP
 o isNoWrap
 public final boolean isNoWrap()
Checks if the line wrapping style is the no line wrapping style.

See Also:
getLineWrap, NO_WRAP
 o isJavaLineSeparator
 public final boolean isJavaLineSeparator()
Checks if the line end style is the java line end style.

See Also:
getLineEnd, JAVA_LINE_SEPARATOR
 o 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
 o isListSeparator
 public final boolean isListSeparator()
Checks if the line end style is the list line end style.

See Also:
getLineEnd, LIST_SEPARATOR
 o handleBreak
 public final boolean handleBreak()
Checks if the line break is handled.

See Also:
isJavaLineSeparatorWithBreak, JAVA_LINE_SEPARATOR_WITH_BREAK
 o 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.
 o 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.
 o 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.
 o hashCode
 public int hashCode()
Returns a hashcode of this rich text style.

Overrides:
hashCode in class Object
 o equals
 public boolean equals(Object anObject)
Compares two objects for equality.

Overrides:
equals in class Object
 o clone
 public Object clone()
Returns a clone of this rich text style.

Overrides:
clone in class Object
 o 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