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

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

public final class BorderSet
extends java.lang.Object
implements Margins, java.lang.Cloneable

The set of borders. It consists of array of borders defining individual border parts around a paragraph, or cell, or table row:

The TOP, BOTTOM, LEFT, and RIGHT indices are inhereted from the Margins interface. Their values are in the range from 0 to 3.


Field Summary
static byte BAR
          Index of the bar border (a bar outside of paragraph).
static byte BOTTOM_TO_TOP
          Index of the bottom left to top right diagonal border in a table cell.
static byte BOX
          Index of the box border around the paragraph.
static byte HORIZONTAL
          Index of the horizontal border of a table row.
static byte INNER
          Index of the inner paragraph border (a border between consecutive paragraphs having identic formatting).
static byte TOP_TO_BOTTOM
          Index of the top left to bottom right diagonal border in a table cell.
static byte VERTICAL
          Index of the vertical border of a table row.
 
Fields inherited from interface ru.novosoft.dc.rtf.dom.objects.Margins
BOTTOM, LEFT, RIGHT, TOP
 
Constructor Summary
BorderSet(int count)
          Construct array of borders consisting of specified number of borders (6 for row or cell borders and 7 for paragraph borders).
 
Method Summary
 Border border(int index)
          Return the border of the specified index or null if this border is absent.
 java.lang.Object clone()
          Create a deep copy of this object.
 Border defineBorder(int index)
          Define a new border of the specified index and return it.
 boolean equals(java.lang.Object obj)
          Compare this set of borders with another set of borders and return true if the sets coinside.
 void exportTo(org.w3c.dom.Element elem, int variant, java.lang.String tagName)
          Export the contents of this object to the specified DOM element.
 boolean hasBorder(int index)
          Return true if a border of the specified index is defined.
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HORIZONTAL

public static final byte HORIZONTAL
Index of the horizontal border of a table row.

VERTICAL

public static final byte VERTICAL
Index of the vertical border of a table row.

TOP_TO_BOTTOM

public static final byte TOP_TO_BOTTOM
Index of the top left to bottom right diagonal border in a table cell.

BOTTOM_TO_TOP

public static final byte BOTTOM_TO_TOP
Index of the bottom left to top right diagonal border in a table cell.

INNER

public static final byte INNER
Index of the inner paragraph border (a border between consecutive paragraphs having identic formatting).

BAR

public static final byte BAR
Index of the bar border (a bar outside of paragraph).

BOX

public static final byte BOX
Index of the box border around the paragraph.
Constructor Detail

BorderSet

public BorderSet(int count)
Construct array of borders consisting of specified number of borders (6 for row or cell borders and 7 for paragraph borders).
Method Detail

hasBorder

public final boolean hasBorder(int index)
Return true if a border of the specified index is defined.

defineBorder

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

border

public final Border border(int index)
Return the border of the specified index or null if this border is absent.

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 set of borders with another set of borders and return true if the sets coinside.
Overrides:
equals in class java.lang.Object

exportTo

public void exportTo(org.w3c.dom.Element elem,
                     int variant,
                     java.lang.String tagName)
Export the contents of this object to the specified DOM element. The variant selects a border set used: -1 - paragraph borders, 0 - cell borders, 1 - row borders.