ru.novosoft.dc.rtf.dom
Class SectionContext

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

public class SectionContext
extends java.lang.Object
implements java.lang.Cloneable

Section formatting context contains section formatting properties. It is strongly bound with an instance of section which context it specifies. So, the context cannot be shared between many sections.


Constructor Summary
SectionContext(DocumentContext documentContext)
          Construct a section formatting context.
 
Method Summary
 java.lang.Object clone()
          Create a clone of this context (no section will be bound with the clone).
 int columnCount()
          Return a number of columns in the section.
 Columns columns()
          Return columns' specification or null if no columns specified.
 void defineColumns(int count)
          Define the specified number of columns for the current section.
 DocumentContext documentContext()
          Return the document context associated with this section.
 boolean equals(java.lang.Object obj)
          Compare this context with another 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 getFooterMargin()
          Return the footer margin.
 int getHeaderMargin()
          Return the header margin.
 int getSectionStart()
          Return the type of the section start.
 boolean hasTitlePage()
          Return true if the current section has the first page with special headers and footers.
 Layout layout()
          Return the current section layout parameters.
 void reset()
          Reset parameters of the current section to defaults.
 RTFSection section()
          Return a section bound with the context or null if no section bound.
 void setFooterMargin(int value)
          Set a footer margin from the bottom of the page in twips.
 void setHeaderMargin(int value)
          Set a header margin from the top of the page in twips.
 void setSectionStart(int value)
          Set a type of the section start (see SectionStart).
 int textHeight()
          Calculate the height of the text area in the page.
 int textWidth()
          Calculate the width of the text area in the page.
 void titlePage()
          Turn the title page tag on.
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SectionContext

public SectionContext(DocumentContext documentContext)
Construct a section formatting context.
Method Detail

documentContext

public final DocumentContext documentContext()
Return the document context associated with this section.

section

public final RTFSection section()
Return a section bound with the context or null if no section bound.

layout

public final Layout layout()
Return the current section layout parameters.

textWidth

public final int textWidth()
Calculate the width of the text area in the page.

textHeight

public final int textHeight()
Calculate the height of the text area in the page.

titlePage

public final void titlePage()
Turn the title page tag on.

hasTitlePage

public final boolean hasTitlePage()
Return true if the current section has the first page with special headers and footers.

setHeaderMargin

public final void setHeaderMargin(int value)
Set a header margin from the top of the page in twips.

getHeaderMargin

public final int getHeaderMargin()
Return the header margin.

setFooterMargin

public final void setFooterMargin(int value)
Set a footer margin from the bottom of the page in twips.

getFooterMargin

public final int getFooterMargin()
Return the footer margin.

setSectionStart

public final void setSectionStart(int value)
Set a type of the section start (see SectionStart).

getSectionStart

public final int getSectionStart()
Return the type of the section start.

defineColumns

public final void defineColumns(int count)
Define the specified number of columns for the current section.

columnCount

public final int columnCount()
Return a number of columns in the section.

columns

public final Columns columns()
Return columns' specification or null if no columns specified.

reset

public void reset()
Reset parameters of the current section to defaults.

clone

public java.lang.Object clone()
Create a clone of this context (no section will be bound with the clone).
Overrides:
clone in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Compare this context with another context and return true if contexts coinside.
Overrides:
equals in class java.lang.Object

exportTo

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