Class TextParagraphFormat
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class TextParagraphFormat

public class netscape.application.TextParagraphFormat
    extends java.lang.Object
    implements java.lang.Cloneable,
               netscape.util.Codable
{
    /* Constructors
     */
    public TextParagraphFormat();

    /* Methods
     */
    public void addTabPosition(int);
    public void clearAllTabPositions();
    public Object clone();
    public void decode(Decoder);
    public void describeClassInfo(ClassInfo);
    public void encode(Encoder);
    public void finishDecoding();
    public int justification();
    public int leftIndent();
    public int leftMargin();
    public int lineSpacing();
    public int positionForTab(int);
    public int rightMargin();
    public void setJustification(int);
    public void setLeftIndent(int);
    public void setLeftMargin(int);
    public void setLineSpacing(int);
    public void setRightMargin(int);
    public void setTabPositions(int[]);
    public int[] tabPositions();
}
Object subclass that maintains a TextParagraph's formatting information (justification, margins, tab stops and line spacing). To apply a TextParagraphFormat, use TextView's addAttributeForRange() method.

Constructors

TextParagraphFormat

  public TextParagraphFormat()
Constructs an empty TextParagraphFormat. It's easier to get the default paragraph format from the TextView's default attributes, clone it, and modify the clone, than it is to create a TextParagraphFormat yourself.

Methods

clone

  public Object clone()
Clones the TextParagraphFormat.
Overrides:
clone in class Object

setLeftMargin

  public void setLeftMargin(int leftMargin)
Sets the distance in pixels from the left border to the beginning of the text.

leftMargin

  public int leftMargin()
Returns the distance in pixels from the left border to the beginning of the text.
See Also:
setLeftMargin

setLeftIndent

  public void setLeftIndent(int indent)
Sets the distance in pixels from the left border to the paragraph's first character.

leftIndent

  public int leftIndent()
Returns the distance in pixels from the left border to the paragraph's first character.
See Also:
setLeftIndent

setRightMargin

  public void setRightMargin(int rightMargin)
Sets the distance between the end of the text and the right border.

rightMargin

  public int rightMargin()
Returns the distance between the end of the text and the right border.

setLineSpacing

  public void setLineSpacing(int spacing)
Sets the minimum distance between lines of text.

lineSpacing

  public int lineSpacing()
Returns the minimum distance between lines of text.

setJustification

  public void setJustification(int justification)
Sets the TextParagraphFormat's justification. Possibles values are Graphics.LEFT_JUSTIFIED, Graphics.CENTERED and Graphics.RIGHT_JUSTIFIED

justification

  public int justification()
Returns the TextParagraphFormat's justification.

clearAllTabPositions

  public void clearAllTabPositions()
Removes all the tab positions.

addTabPosition

  public void addTabPosition(int position)
Adds a tab at pixel position.

setTabPositions

  public void setTabPositions(int tabArray[])
Replaces the current tab positions with the positions described by tabArray. Each tab position is the number of pixels from the left border.

tabPositions

  public int[] tabPositions()
Returns the current tab positions.

positionForTab

  public int positionForTab(int tabNumber)

describeClassInfo

  public void describeClassInfo(ClassInfo info)
Describes the TextParagraphFormat class' information.
See Also:
describeClassInfo

encode

  public void encode(Encoder encoder) throws CodingException
Encodes the TextParagraphFormat instance.
See Also:
encode

decode

  public void decode(Decoder decoder) throws CodingException
Decodes the TextParagraphFormat instance.
See Also:
decode

finishDecoding

  public void finishDecoding() throws CodingException
Finishes the TextParagraphFormat instance decoding.
See Also:
finishDecoding

All Packages  Class Hierarchy  This Package  Previous  Next  Index