All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class jp.kyasu.graphics.ParagraphStyle

java.lang.Object
   |
   +----jp.kyasu.graphics.ParagraphStyle

public class ParagraphStyle
extends Object
implements Cloneable, Serializable
The ParagraphStyle class implements the paragraph style for the rich text object. The paragraph style has following attributes:
Style name
The name of the paragraph style.
Alignment
The alignment (justification) of the paragraph.
Left indentation
The left margin indentation of the paragraph.
Right indentation
The right margin indentation of the paragraph.
Line space
The space between lines in the paragraph.
Paragraph space
The space below the paragraph.
Tab width
The indentation for the tab character. If the tab width is not set, the default tab width of the rich text style is used.
Paragraph heading
The visual heading of the paragraph.
Paragraph heading space
The space for the visual heading from the left indentation.
Base text style
The base text style of the paragraph. If the text in the paragraph has a ModTextStyle, the style of the text is modified from the base text style of the paragraph.

The paragraph style is immutable.

Version:
11 Nov 1997
Author:
Kazuki YASUMATSU
See Also:
ModTextStyle

Variable Index

 o CENTER
The constant for the center alignment (justification).
 o DEFAULT_STYLE
The default paragraph style constant.
 o HARD_TAB_LENGTH
The constant for the tab width.
 o LEFT
The constant for the left alignment (justification).
 o RIGHT
The constant for the right alignment (justification).

Constructor Index

 o ParagraphStyle(int)
Constructs a paragraph style with the specified alignment.
 o ParagraphStyle(int, int, int)
Constructs a paragraph style with the specified alignment, left indent and right indent.
 o ParagraphStyle(int, int, int, int)
Constructs a paragraph style with the specified alignment, left indent, right indent and line space.
 o ParagraphStyle(int, int, int, int, int)
Constructs a paragraph style with the specified alignment, left indent, right indent, line space and paragraph space.
 o ParagraphStyle(int, int, int, int, int, int)
Constructs a paragraph style with the specified alignment, left indent, right indent, line space, paragraph space and tab width.
 o ParagraphStyle(int, int, int, int, int, int, TextStyle)
Constructs a paragraph style with the specified alignment, left indent, right indent, line space, paragraph space, tab width and base text style.
 o ParagraphStyle(int, int, int, int, int, int, Visualizable, int)
Constructs a paragraph style with the specified alignment, left indent, right indent, line space, paragraph space, tab width, visual heading and heading space.
 o ParagraphStyle(String, int, int, int, int, int, int, TextStyle)
Constructs a paragraph style with the specified name, alignment, left indent, right indent, line space, paragraph space, tab width and base text style.
 o ParagraphStyle(String, int, int, int, int, int, int, Visualizable, int)
Constructs a paragraph style with the specified name, alignment, left indent, right indent, line space, paragraph space, tab width, visual heading and heading space.
 o ParagraphStyle(String, int, int, int, int, int, int, Visualizable, int, TextStyle)
Constructs a paragraph style with the specified name, alignment, left indent, right indent, line space, paragraph space, tab width, visual heading, heading space and base text style.

Method Index

 o clone()
Returns a clone of this paragraph style.
 o deriveStyle(ParagraphStyleModifier)
Creates a new style by modifying this style by a paragraph style modifier.
 o deriveStyle(String)
Creates a new style by replicating this style with a new style name associated with it.
 o deriveStyle(TextStyle)
Creates a new style by replicating this style with a new base text style associated with it.
 o deriveStyle(Visualizable, int)
Creates a new style by replicating this style with a new visual heading and a new heading space associated with it.
 o equals(Object)
Compares two objects for equality.
 o getAlignment()
Returns the alignment (justification) of the paragraph.
 o getBaseStyle()
Returns the base text style of the paragraph.
 o getHeading()
Returns the visual heading of the paragraph.
 o getHeadingSpace()
Returns the space for the visual heading from the left indentation.
 o getLeftIndent()
Returns the left margin indentation of the paragraph.
 o getLineSpace()
Returns the space between lines in the paragraph.
 o getParagraphSpace()
Returns the space below the paragraph.
 o getRightIndent()
Returns the right margin indentation of the paragraph.
 o getStyleName()
Returns the name of the paragraph style.
 o getTabWidth()
Returns the indentation for the tab character.
 o hasBaseStyle()
Checks if this paragraph style has a base text style.
 o hashCode()
Returns a hashcode for this paragraph style.
 o hasHeading()
Checks if this paragraph style has a visual heading.
 o hasStyleName()
Checks if this paragraph style has a style name.
 o toString()
Returns the string representation of this paragraph style.

Variables

 o LEFT
 public static final int LEFT
The constant for the left alignment (justification).

 o RIGHT
 public static final int RIGHT
The constant for the right alignment (justification).

 o CENTER
 public static final int CENTER
The constant for the center alignment (justification).

 o HARD_TAB_LENGTH
 public static final int HARD_TAB_LENGTH
The constant for the tab width.

 o DEFAULT_STYLE
 public static final ParagraphStyle DEFAULT_STYLE
The default paragraph style constant.

Constructors

 o ParagraphStyle
 public ParagraphStyle(int alignment)
Constructs a paragraph style with the specified alignment.

Parameters:
alignment - the alignment.
 o ParagraphStyle
 public ParagraphStyle(int alignment,
                       int leftIndent,
                       int rightIndent)
Constructs a paragraph style with the specified alignment, left indent and right indent.

Parameters:
alignment - the alignment.
leftIndent - the left indent.
rightIndent - the right indent.
 o ParagraphStyle
 public ParagraphStyle(int alignment,
                       int leftIndent,
                       int rightIndent,
                       int lineSpace)
Constructs a paragraph style with the specified alignment, left indent, right indent and line space.

Parameters:
alignment - the alignment.
leftIndent - the left indent.
rightIndent - the right indent.
lineSpace - the line space.
 o ParagraphStyle
 public ParagraphStyle(int alignment,
                       int leftIndent,
                       int rightIndent,
                       int lineSpace,
                       int paragraphSpace)
Constructs a paragraph style with the specified alignment, left indent, right indent, line space and paragraph space.

Parameters:
alignment - the alignment.
leftIndent - the left indent.
rightIndent - the right indent.
lineSpace - the line space.
paragraphSpace - the paragraph space.
 o ParagraphStyle
 public ParagraphStyle(int alignment,
                       int leftIndent,
                       int rightIndent,
                       int lineSpace,
                       int paragraphSpace,
                       int tabWidth)
Constructs a paragraph style with the specified alignment, left indent, right indent, line space, paragraph space and tab width.

Parameters:
alignment - the alignment.
leftIndent - the left indent.
rightIndent - the right indent.
lineSpace - the line space.
paragraphSpace - the paragraph space.
tabWidth - the tab width.
 o ParagraphStyle
 public ParagraphStyle(int alignment,
                       int leftIndent,
                       int rightIndent,
                       int lineSpace,
                       int paragraphSpace,
                       int tabWidth,
                       Visualizable heading,
                       int headingSpace)
Constructs a paragraph style with the specified alignment, left indent, right indent, line space, paragraph space, tab width, visual heading and heading space.

Parameters:
alignment - the alignment.
leftIndent - the left indent.
rightIndent - the right indent.
lineSpace - the line space.
paragraphSpace - the paragraph space.
tabWidth - the tab width.
heading - the visual heading.
headingSpace - the heading space.
 o ParagraphStyle
 public ParagraphStyle(int alignment,
                       int leftIndent,
                       int rightIndent,
                       int lineSpace,
                       int paragraphSpace,
                       int tabWidth,
                       TextStyle baseStyle)
Constructs a paragraph style with the specified alignment, left indent, right indent, line space, paragraph space, tab width and base text style.

Parameters:
alignment - the alignment.
leftIndent - the left indent.
rightIndent - the right indent.
lineSpace - the line space.
paragraphSpace - the paragraph space.
tabWidth - the tab width.
baseStyle - the base text style.
 o ParagraphStyle
 public ParagraphStyle(String styleName,
                       int alignment,
                       int leftIndent,
                       int rightIndent,
                       int lineSpace,
                       int paragraphSpace,
                       int tabWidth,
                       Visualizable heading,
                       int headingSpace)
Constructs a paragraph style with the specified name, alignment, left indent, right indent, line space, paragraph space, tab width, visual heading and heading space.

Parameters:
styleName - the style name.
alignment - the alignment.
leftIndent - the left indent.
rightIndent - the right indent.
lineSpace - the line space.
paragraphSpace - the paragraph space.
tabWidth - the tab width.
heading - the visual heading.
headingSpace - the heading space.
 o ParagraphStyle
 public ParagraphStyle(String styleName,
                       int alignment,
                       int leftIndent,
                       int rightIndent,
                       int lineSpace,
                       int paragraphSpace,
                       int tabWidth,
                       TextStyle baseStyle)
Constructs a paragraph style with the specified name, alignment, left indent, right indent, line space, paragraph space, tab width and base text style.

Parameters:
styleName - the style name.
alignment - the alignment.
leftIndent - the left indent.
rightIndent - the right indent.
lineSpace - the line space.
paragraphSpace - the paragraph space.
tabWidth - the tab width.
baseStyle - the base text style.
 o ParagraphStyle
 public ParagraphStyle(String styleName,
                       int alignment,
                       int leftIndent,
                       int rightIndent,
                       int lineSpace,
                       int paragraphSpace,
                       int tabWidth,
                       Visualizable heading,
                       int headingSpace,
                       TextStyle baseStyle)
Constructs a paragraph style with the specified name, alignment, left indent, right indent, line space, paragraph space, tab width, visual heading, heading space and base text style.

Parameters:
styleName - the style name.
alignment - the alignment.
leftIndent - the left indent.
rightIndent - the right indent.
lineSpace - the line space.
paragraphSpace - the paragraph space.
tabWidth - the tab width.
heading - the visual heading.
headingSpace - the heading space.
baseStyle - the base text style.

Methods

 o getStyleName
 public final String getStyleName()
Returns the name of the paragraph style.

 o getAlignment
 public final int getAlignment()
Returns the alignment (justification) of the paragraph.

 o getLeftIndent
 public final int getLeftIndent()
Returns the left margin indentation of the paragraph.

 o getRightIndent
 public final int getRightIndent()
Returns the right margin indentation of the paragraph.

 o getLineSpace
 public final int getLineSpace()
Returns the space between lines in the paragraph.

 o getParagraphSpace
 public final int getParagraphSpace()
Returns the space below the paragraph.

 o getTabWidth
 public final int getTabWidth()
Returns the indentation for the tab character.

 o getHeading
 public final Visualizable getHeading()
Returns the visual heading of the paragraph.

 o getHeadingSpace
 public final int getHeadingSpace()
Returns the space for the visual heading from the left indentation.

 o getBaseStyle
 public final TextStyle getBaseStyle()
Returns the base text style of the paragraph.

 o hasStyleName
 public boolean hasStyleName()
Checks if this paragraph style has a style name.

 o hasHeading
 public boolean hasHeading()
Checks if this paragraph style has a visual heading.

 o hasBaseStyle
 public boolean hasBaseStyle()
Checks if this paragraph style has a base text style.

 o deriveStyle
 public ParagraphStyle deriveStyle(String styleName)
Creates a new style by replicating this style with a new style name associated with it.

Parameters:
styleName - the style name for the new style.
Returns:
a new style.
 o deriveStyle
 public ParagraphStyle deriveStyle(TextStyle baseStyle)
Creates a new style by replicating this style with a new base text style associated with it.

Parameters:
baseStyle - the base text style for the new style.
Returns:
a new style.
 o deriveStyle
 public ParagraphStyle deriveStyle(Visualizable visualizable,
                                   int space)
Creates a new style by replicating this style with a new visual heading and a new heading space associated with it.

Parameters:
visualizable - the visual heading for the new style.
space - the heading space for the new style.
Returns:
a new style.
 o deriveStyle
 public ParagraphStyle deriveStyle(ParagraphStyleModifier modifier)
Creates a new style by modifying this style by a paragraph style modifier.

Parameters:
modifier - the paragraph style modifier.
Returns:
a new style.
 o hashCode
 public int hashCode()
Returns a hashcode for this paragraph 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 paragraph style.

Overrides:
clone in class Object
 o toString
 public String toString()
Returns the string representation of this paragraph style.

Overrides:
toString in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index