ru.novosoft.dc.rtf.dom
Class CellContext

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

public class CellContext
extends ShadingContext

Cell formatting context. The following cell formatting properties are not implemented here: text fit and nowrap flags, prefered cell width, and cell text flow controls.


Constructor Summary
CellContext()
          Construct a cell formatting context.
 
Method Summary
 void attachRowContext(RowContext context)
          Attach a row context to this cell context.
 BorderSet borders()
          Return the set of borders or null if borders are not specified.
 int calculatePadding(int index)
          Calculate the padding of the specified index using values of cell and row paddings and the row half gap value.
 Shading calculateShading()
          Calculate the shading of cell using values of cell and row shadings and return it or null.
 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 definePadding(int index, int value)
          Define a padding value of the specified index.
 boolean equals(java.lang.Object obj)
          Compare this context with another cell 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 vertical alignment of the cell.
 int getHorizontalMerge()
          Return the horizontal merge style for the cell.
 int getRightBoundary()
          Return the right boundary of the cell.
 int getVerticalMerge()
          Return the vertical merge style for the cell.
 boolean hasNoShading()
          Return the value of no-shading flag.
 Padding padding()
          Return the cell padding or null if it is not specified.
 void reset()
          Restore the cell formatting properties to defaults.
 RowContext rowContext()
          Return a context of table row this cell belongs to or null if no row context attached.
 void setAlignment(int value)
          Set a vertical alignment for the cell (see VerticalAlignment).
 void setHorizontalMerge(int value)
          Set a horizontal merge style for the cell (see CellMerge).
 void setNoShading(boolean value)
          Set a value for the no-shading flag.
 void setRightBoundary(int value)
          Set a right boundary for the cell.
 void setVerticalMerge(int value)
          Set a vertical merge style for the cell (see CellMerge).
 
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

CellContext

public CellContext()
Construct a cell formatting context.
Method Detail

attachRowContext

public final void attachRowContext(RowContext context)
Attach a row context to this cell context.

rowContext

public final RowContext rowContext()
Return a context of table row this cell belongs to or null if no row context attached.

setAlignment

public final void setAlignment(int value)
Set a vertical alignment for the cell (see VerticalAlignment).

getAlignment

public final int getAlignment()
Return the vertical alignment of the cell.

setHorizontalMerge

public final void setHorizontalMerge(int value)
Set a horizontal merge style for the cell (see CellMerge).

getHorizontalMerge

public final int getHorizontalMerge()
Return the horizontal merge style for the cell.

setVerticalMerge

public final void setVerticalMerge(int value)
Set a vertical merge style for the cell (see CellMerge).

getVerticalMerge

public final int getVerticalMerge()
Return the vertical merge style for the cell.

setRightBoundary

public final void setRightBoundary(int value)
Set a right boundary for the cell.

getRightBoundary

public final int getRightBoundary()
Return the right boundary of the cell.

borders

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

defineBorder

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

padding

public final Padding padding()
Return the cell padding or null if it is not specified.

definePadding

public final void definePadding(int index,
                                int value)
Define a padding value of the specified index.

calculatePadding

public final int calculatePadding(int index)
Calculate the padding of the specified index using values of cell and row paddings and the row half gap value.

setNoShading

public final void setNoShading(boolean value)
Set a value for the no-shading flag.

hasNoShading

public final boolean hasNoShading()
Return the value of no-shading flag.

calculateShading

public final Shading calculateShading()
Calculate the shading of cell using values of cell and row shadings and return it or null.

reset

public void reset()
Restore the cell formatting properties to defaults.
Overrides:
reset in class ShadingContext

clone

public java.lang.Object clone()
Create a clone of this context.
Overrides:
clone in class ShadingContext

equals

public boolean equals(java.lang.Object obj)
Compare this context with another cell context and return true if contexts coinside. References to row contexts are not 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.