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

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

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

The columns specification class. Columns are specified by their widths and intercolumn gaps in twips. They could be separated with a line.


Constructor Summary
Columns(int count, int textWidth)
          Construct a set of columns and calculate its parameters in assumption of the default column gap (720 twips).
 
Method Summary
 void calculateParameters(int columnGap)
          Calculate columns' parameters for constant width columns.
 java.lang.Object clone()
          Create a deep copy of this object.
 int count()
          Return a number of columns.
 boolean equals(java.lang.Object obj)
          Compare this object with another columns specification 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 getAverageGapWidth()
          Return an everage width of column gap.
 int getColumnGapWidth(int index)
          Return the width of the gap to the right of the specified column.
 int getColumnWidth(int index)
          Return the width of the specified column.
 boolean hasEqualWidthColumns()
          Return true if all columns have identical widths.
 boolean hasLineBetween()
          Return true if the "line between columns" tag is turned on.
 void lineBetween()
          Turn the "line between columns" tag on (default is off).
 void setColumnGapWidth(int index, int value)
          Set a width of the gap to the right of the specified column.
 void setColumnWidth(int index, int value)
          Set a width of the specified column.
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Columns

public Columns(int count,
               int textWidth)
Construct a set of columns and calculate its parameters in assumption of the default column gap (720 twips).
Parameters:
count - a number of columns
textWidth - a width of the text area in twips
Method Detail

count

public final int count()
Return a number of columns.

calculateParameters

public void calculateParameters(int columnGap)
Calculate columns' parameters for constant width columns.
Parameters:
columnGap - an intercolumn space in twips

setColumnWidth

public final void setColumnWidth(int index,
                                 int value)
Set a width of the specified column.
Parameters:
index - a zero-based index of the column
value - a width of the column in twips

setColumnGapWidth

public final void setColumnGapWidth(int index,
                                    int value)
Set a width of the gap to the right of the specified column.
Parameters:
index - a zero-based index of the column
value - a width of the gap in twips

getColumnWidth

public final int getColumnWidth(int index)
Return the width of the specified column.
Parameters:
index - a zero-based index of the column
Returns:
the width of the column in twips

getColumnGapWidth

public final int getColumnGapWidth(int index)
Return the width of the gap to the right of the specified column.
Parameters:
index - a zero-based index of the column
Returns:
the width of the gap in twips

lineBetween

public final void lineBetween()
Turn the "line between columns" tag on (default is off).

hasLineBetween

public final boolean hasLineBetween()
Return true if the "line between columns" tag is turned on.

hasEqualWidthColumns

public boolean hasEqualWidthColumns()
Return true if all columns have identical widths.

getAverageGapWidth

public int getAverageGapWidth()
Return an everage width of column gap.

clone

public java.lang.Object clone()
Create 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 columns specification 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.