|
java.lang.Object
com.aspose.words.Border
- All Implemented Interfaces:
- java.lang.Cloneable
public class Border - extends java.lang.Object
Represents a border of an object.
Borders can be applied to various document elements including paragraph,
run of text inside a paragraph or a table cell. Example: Inserts a string surrounded by a border into a document.
DocumentBuilder builder = new DocumentBuilder();
Border border = builder.getFont().getBorder();
border.setColor(Color.GREEN);
border.setLineWidth(2.5);
border.setLineStyle(LineStyle.DASH_DOT_STROKER);
builder.write("run of text in a green border");
|
Method Summary |
void | clearFormatting() | |
|
Resets border properties to default values.
|
Aspose.Words.IComplexAttr | deepClone() | |
| Reserved for internal use. |
boolean | equals(Aspose.Words.IEquatableAttr rhs) | |
| Reserved for internal use. |
boolean | isInherited() | |
| Reserved for internal use. |
|
Property Getters/Setters Detail |
getLineStyle/setLineStyle | |
public int getLineStyle()
public void setLineStyle(int value)
|
-
Gets or sets the border style.
The value of the property is LineStyle integer constant.
Example: Inserts a string surrounded by a border into a document.
DocumentBuilder builder = new DocumentBuilder();
Border border = builder.getFont().getBorder();
border.setColor(Color.GREEN);
border.setLineWidth(2.5);
border.setLineStyle(LineStyle.DASH_DOT_STROKER);
builder.write("run of text in a green border");
getLineWidth/setLineWidth | |
public double getLineWidth()
public void setLineWidth(double value)
|
-
Gets or sets the border width in points.
If you set line width greater than zero while line style is none, the line style is changed to single line. Example: Inserts a string surrounded by a border into a document.
DocumentBuilder builder = new DocumentBuilder();
Border border = builder.getFont().getBorder();
border.setColor(Color.GREEN);
border.setLineWidth(2.5);
border.setLineStyle(LineStyle.DASH_DOT_STROKER);
builder.write("run of text in a green border");
isVisible | |
public boolean isVisible()
|
-
Returns true if the LineStyle is not LineStyle.None and LineWidth is greater than zero.
getColor/setColor | |
public java.awt.Color getColor()
public void setColor(java.awt.Color value)
|
-
Gets or sets the border color.
Example: Inserts a string surrounded by a border into a document.
DocumentBuilder builder = new DocumentBuilder();
Border border = builder.getFont().getBorder();
border.setColor(Color.GREEN);
border.setLineWidth(2.5);
border.setLineStyle(LineStyle.DASH_DOT_STROKER);
builder.write("run of text in a green border");
getDistanceFromText/setDistanceFromText | |
public double getDistanceFromText()
public void setDistanceFromText(double value)
|
-
Gets or sets distance of the border from text in points.
Has no effect and will be automatically reset to zero for borders of table cells.
Example: Creates a page border that looks like a wide blue band at the top of the first page only.
Document doc = new Document();
PageSetup ps = doc.getSections().get(0).getPageSetup();
ps.setBorderAlwaysInFront(false);
ps.setBorderDistanceFrom(PageBorderDistanceFrom.PAGE_EDGE);
ps.setBorderAppliesTo(PageBorderAppliesTo.FIRST_PAGE);
Border border = ps.getBorders().get(BorderType.TOP);
border.setLineStyle(LineStyle.SINGLE);
border.setLineWidth(30);
border.setColor(Color.BLUE);
border.setDistanceFromText(0);
doc.save(getMyDir() + "PageSetup.PageBorderTop Out.doc");
getShadow/setShadow | |
public boolean getShadow()
public void setShadow(boolean value)
|
-
Gets or sets a value indicating whether the border has a shadow.
In Microsoft Word, for a border to have a shadow, the borders on all four sides
(left, top, right and bottom) should be of the same type, width, color and all should have
the Shadow property set to true.
clearFormatting | |
public void clearFormatting() |
-
Resets border properties to default values.
When border properties are reset to default values, the border is invisible.
equals | |
public boolean equals(Aspose.Words.IEquatableAttr rhs)
throws java.lang.Exception |
- Reserved for internal use.
isInherited | |
public boolean isInherited() |
- Reserved for internal use.
deepClone | |
public Aspose.Words.IComplexAttr deepClone()
throws com.aspose.words.PleaseReportException, java.lang.CloneNotSupportedException |
- Reserved for internal use.
See Also:
Aspose.Words Documentation - the home page for the Aspose.Words Product Documentation.
Aspose.Words Support Forum - our preferred method of support.
|