ru.novosoft.dc.rtf.dom
Class ParagraphContext

java.lang.Object
  |
  +--ru.novosoft.dc.rtf.dom.ShadingContext
        |
        +--ru.novosoft.dc.rtf.dom.ParagraphContext

public class ParagraphContext
extends ShadingContext

Paragraph formatting context (draft version). It contains paragraph formatting properties.


Constructor Summary
ParagraphContext()
          Construct a paragraph formatting context.
 
Method Summary
 void addTab(Tab tab)
          Add a new tab to the context.
 TabSet barTabs()
          Return a set of bar tabs or null if no bar tabs specified.
 BorderSet borders()
          Return the set of borders or null if borders are not specified.
 java.lang.Object clone()
          Create a clone of this context.
 Border defineBorder(int index)
          Define a new border of the specified index and return it.
 void defineIndent(int index, int value)
          Define an indentation parameter of the specified index in twips.
 void definePagination(int index, boolean value)
          Define a value for the pagination flag of the specified index.
 Position definePosition()
          Define an absolute position if it is not defined yet and return it.
 void defineSpacing(int index, int value)
          Define a spacing of the specified index and set a value for it in twips.
 void defineSpacingType(int index, boolean absolute)
          Define a type of spacing of the specified index.
 boolean equals(java.lang.Object obj)
          Compare this context with another paragraph context and return true if contexts coinside.
 void exportTo(org.w3c.dom.Element elem)
          Export the contents of this object to the specified DOM element.
 int getAlignment()
          Return the current horizontal alignment of the paragraph text.
 int getLevel()
          Return the nesting level of the paragraph.
 int getStyle()
          Return the style number.
 Indentation indentation()
          Return the indentation properties or null if they are not specified.
 Pagination pagination()
          Return the pagination flags or null if they are not specified.
 Position position()
          Return the absolute position or null if it is not specified.
 void reset()
          Restore the paragraph formatting properties to defaults.
 void setAlignment(int value)
          Set a horizontal alignment for the paragraph text (see HorizontalAlignment).
 void setLevel(int value)
          Set a nesting level of the paragraph: 0 is the main document (default), 1 is a table cell (\intbl or \itap1 command produce this), 2 is a nested table cell (\itap2). and so forth.
 void setStyle(int value)
          Set a style number (222 means no style).
 ParagraphSpacing spacing()
          Return paragraph spacing properties or null if they are not specified.
 TabSet tabs()
          Return a set of non-bar tabs or null if no non-bar tabs specified.
 
Methods inherited from class ru.novosoft.dc.rtf.dom.ShadingContext
defineShadingBackground, defineShadingFill, defineShadingStyle, exportTo, shading
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParagraphContext

public ParagraphContext()
Construct a paragraph formatting context.
Method Detail

setAlignment

public final void setAlignment(int value)
Set a horizontal alignment for the paragraph text (see HorizontalAlignment).

getAlignment

public final int getAlignment()
Return the current horizontal alignment of the paragraph text.

setStyle

public final void setStyle(int value)
Set a style number (222 means no style).

getStyle

public final int getStyle()
Return the style number.

definePosition

public final Position definePosition()
Define an absolute position if it is not defined yet and return it.

position

public final Position position()
Return the absolute position or null if it is not specified.

defineBorder

public final Border defineBorder(int index)
Define a new border of the specified index and return it.

borders

public final BorderSet borders()
Return the set of borders or null if borders are not specified.

defineIndent

public final void defineIndent(int index,
                               int value)
Define an indentation parameter of the specified index in twips.

indentation

public final Indentation indentation()
Return the indentation properties or null if they are not specified.

definePagination

public final void definePagination(int index,
                                   boolean value)
Define a value for the pagination flag of the specified index.

pagination

public final Pagination pagination()
Return the pagination flags or null if they are not specified.

defineSpacing

public final void defineSpacing(int index,
                                int value)
Define a spacing of the specified index and set a value for it in twips.

defineSpacingType

public final void defineSpacingType(int index,
                                    boolean absolute)
Define a type of spacing of the specified index.

spacing

public final ParagraphSpacing spacing()
Return paragraph spacing properties or null if they are not specified.

addTab

public final void addTab(Tab tab)
Add a new tab to the context. The tab is added to the set of non-bar or bar tabs depending on the tab kind.

tabs

public final TabSet tabs()
Return a set of non-bar tabs or null if no non-bar tabs specified.

barTabs

public final TabSet barTabs()
Return a set of bar tabs or null if no bar tabs specified.

setLevel

public final void setLevel(int value)
Set a nesting level of the paragraph: 0 is the main document (default), 1 is a table cell (\intbl or \itap1 command produce this), 2 is a nested table cell (\itap2). and so forth.

getLevel

public final int getLevel()
Return the nesting level of the paragraph.

reset

public void reset()
Restore the paragraph formatting properties to defaults. The widow/orphan control is restored on the command "pard" in the ParagraphPaginationProcessor using the default value from the DocumentContext.
Overrides:
reset in class ShadingContext

clone

public java.lang.Object clone()
Create a clone of this context. The nesting level is not copied to the clone.
Overrides:
clone in class ShadingContext

equals

public boolean equals(java.lang.Object obj)
Compare this context with another paragraph context and return true if contexts coinside. The paragraph style is ignored while comparison. The nesting level is compared.
Overrides:
equals in class ShadingContext

exportTo

public void exportTo(org.w3c.dom.Element elem)
Export the contents of this object to the specified DOM element.