ru.novosoft.dc.rtf.dom.objects
Class InvisibleCells

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

public final class InvisibleCells
extends java.lang.Object
implements java.lang.Cloneable

The invisible cells specification class. A table row can have two invisible cells, namely LEFT and RIGHT. While parsing an RTF file, an invisible cell is defined with a type and width. The types 0 or 1 mean no invisible cell (the width is set to zero). The type 2 is the width in 50ths of a percent of the column width and the type 3 is the width in twips. The type is always specified, but the width could absent.


Field Summary
static byte LEFT
          The index of the left invisible cell.
static byte RIGHT
          The index of the right invisible cell.
 
Constructor Summary
InvisibleCells()
           
 
Method Summary
static java.lang.String cellWidthUnits(int type)
          Return units in which a cell width is measured depending on the specified type: 0 means "null", 1 means "auto", 2 means "50ths-of-percent", and 3 means "twips".
 java.lang.Object clone()
          Creates a deep copy of this object.
 boolean equals(java.lang.Object obj)
          Compare this object with another invisible cells and return true if they coinside.
 void exportTo(org.w3c.dom.Element elem)
          Export the contents of this object to the specified DOM element.
 int getType(int index)
          Return the type of the cell of the specified index.
 int getWidth(int index)
          Return the width of the cell of the specified index.
 void setType(int index, int value)
          Set a type for the cell of the specified index (default is 3).
 void setWidth(int index, int value)
          Set a width for the cell of the specified index.
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LEFT

public static final byte LEFT
The index of the left invisible cell.

RIGHT

public static final byte RIGHT
The index of the right invisible cell.
Constructor Detail

InvisibleCells

public InvisibleCells()
Method Detail

setWidth

public final void setWidth(int index,
                           int value)
Set a width for the cell of the specified index.

getWidth

public final int getWidth(int index)
Return the width of the cell of the specified index.

setType

public final void setType(int index,
                          int value)
Set a type for the cell of the specified index (default is 3). If the type value is equal to 0 or 1, the cell width is set to zero.

getType

public final int getType(int index)
Return the type of the cell of the specified index.

clone

public java.lang.Object clone()
Creates a deep copy of this object.
Overrides:
clone in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Compare this object with another invisible cells and return true if they 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.

cellWidthUnits

public static java.lang.String cellWidthUnits(int type)
Return units in which a cell width is measured depending on the specified type: 0 means "null", 1 means "auto", 2 means "50ths-of-percent", and 3 means "twips". In other cases, the string "unknown" is returned.