public final class BorderCollection
extends java.lang.Object
implements java.lang.Iterable
To learn more, visit the Programming with Documents documentation article.
Different document elements have different borders. For example, ParagraphFormat has Bottom, Left, Right and Top borders. You can specify different formatting for each border independently or enumerate through all borders and apply same formatting.| Modifier and Type | Method and Description |
|---|---|
void |
clearFormatting()
Removes all borders of an object.
|
boolean |
equals(BorderCollection brColl)
Compares collections of borders.
|
Border |
get(int index)
Retrieves a Border object by index.
|
Border |
getBottom()
Gets the bottom border.
|
Border |
getByBorderType(int borderType) |
java.awt.Color |
getColor()
Gets the border color.
|
int |
getCount()
Gets the number of borders in the collection.
|
double |
getDistanceFromText()
Gets distance of the border from text in points.
|
Border |
getHorizontal()
Gets the horizontal border that is used between cells or conforming paragraphs.
|
Border |
getLeft()
Gets the left border.
|
int |
getLineStyle()
Gets the border style.
|
double |
getLineWidth()
Gets the border width in points.
|
Border |
getRight()
Gets the right border.
|
boolean |
getShadow()
Gets a value indicating whether the border has a shadow.
|
Border |
getTop()
Gets the top border.
|
Border |
getVertical()
Gets the vertical border that is used between cells.
|
java.util.Iterator |
iterator()
Returns an enumerator object that can be used to iterate over all borders in the collection.
|
void |
setColor(java.awt.Color value)
Sets the border color.
|
void |
setDistanceFromText(double value)
Sets distance of the border from text in points.
|
void |
setLineStyle(int value)
Sets the border style.
|
void |
setLineWidth(double value)
Sets the border width in points.
|
void |
setShadow(boolean value)
Sets a value indicating whether the border has a shadow.
|
public final boolean equals(BorderCollection brColl) throws java.lang.Exception
java.lang.Exceptionpublic final Border getByBorderType(int borderType) throws java.lang.Exception
java.lang.Exceptionpublic final Border get(int index) throws java.lang.Exception
index - Zero-based index of the border to retrieve.Border value.java.lang.Exceptionpublic final Border getLeft() throws java.lang.Exception
java.lang.Exceptionpublic final Border getRight() throws java.lang.Exception
java.lang.Exceptionpublic final Border getTop() throws java.lang.Exception
java.lang.Exceptionpublic final Border getBottom() throws java.lang.Exception
java.lang.Exceptionpublic final Border getHorizontal() throws java.lang.Exception
java.lang.Exceptionpublic final Border getVertical() throws java.lang.Exception
java.lang.Exceptionpublic final int getCount()
public final double getLineWidth()
throws java.lang.Exception
Returns the width of the first border in the collection.
Sets the width of all borders in the collection excluding diagonal borders.
java.lang.Exceptionpublic final void setLineWidth(double value)
throws java.lang.Exception
Returns the width of the first border in the collection.
Sets the width of all borders in the collection excluding diagonal borders.
value - The border width in points.java.lang.Exceptionpublic final int getLineStyle()
throws java.lang.Exception
Returns the style of the first border in the collection.
Sets the style of all borders in the collection excluding diagonal borders.
LineStyle constants.java.lang.Exceptionpublic final void setLineStyle(int value)
throws java.lang.Exception
Returns the style of the first border in the collection.
Sets the style of all borders in the collection excluding diagonal borders.
value - The border style. The value must be one of LineStyle constants.java.lang.Exceptionpublic final java.awt.Color getColor()
throws java.lang.Exception
Returns the color of the first border in the collection.
Sets the color of all borders in the collection excluding diagonal borders.
java.lang.Exceptionpublic final void setColor(java.awt.Color value)
throws java.lang.Exception
Returns the color of the first border in the collection.
Sets the color of all borders in the collection excluding diagonal borders.
value - The border color.java.lang.Exceptionpublic final double getDistanceFromText()
throws java.lang.Exception
Gets the distance from text for the first border.
Sets the distance from text for all borders in the collection excluding diagonal borders.
Has no effect and will be automatically reset to zero for borders of table cells.
java.lang.Exceptionpublic final void setDistanceFromText(double value)
throws java.lang.Exception
Gets the distance from text for the first border.
Sets the distance from text for all borders in the collection excluding diagonal borders.
Has no effect and will be automatically reset to zero for borders of table cells.
value - Distance of the border from text in points.java.lang.Exceptionpublic final boolean getShadow()
throws java.lang.Exception
Gets the value from the first border in the collection.
Sets the value for all borders in the collection excluding diagonal borders.
java.lang.Exceptionpublic final void setShadow(boolean value)
throws java.lang.Exception
Gets the value from the first border in the collection.
Sets the value for all borders in the collection excluding diagonal borders.
value - A value indicating whether the border has a shadow.java.lang.Exceptionpublic final void clearFormatting()
public final java.util.Iterator iterator()
iterator in interface java.lang.Iterable