public class HorizontalRuleFormat
Example:
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
Shape shape = builder.insertHorizontalRule();
HorizontalRuleFormat horizontalRuleFormat = shape.getHorizontalRuleFormat();
horizontalRuleFormat.setAlignment(HorizontalRuleAlignment.CENTER);
horizontalRuleFormat.setWidthPercent(70.0);
horizontalRuleFormat.setHeight(3.0);
horizontalRuleFormat.setColor(Color.BLUE);
horizontalRuleFormat.setNoShade(true);
Assert.assertTrue(shape.isHorizontalRule());
Assert.assertTrue(shape.getHorizontalRuleFormat().getNoShade());
Property Getters/Setters Summary | ||
---|---|---|
int | getAlignment() | |
void | setAlignment(intvalue) | |
Gets or sets the alignment of the horizontal rule. The value of the property is HorizontalRuleAlignment integer constant. | ||
java.awt.Color | getColor() | |
void | setColor(java.awt.Colorvalue) | |
Gets or sets the brush color that fills the horizontal rule. | ||
double | getHeight() | |
void | setHeight(doublevalue) | |
Gets or sets the height of the horizontal rule. | ||
boolean | getNoShade() | |
void | setNoShade(booleanvalue) | |
Indicates the presence of 3D shading for the horizontal rule. If true, then the horizontal rule is without 3D shading and solid color is used. | ||
double | getWidthPercent() | |
void | setWidthPercent(doublevalue) | |
Gets or sets the length of the specified horizontal rule expressed as a percentage of the window width. |
public int getAlignment() / public void setAlignment(int value)
The default value is
Example:
Shows how to insert a horizontal rule shape, and customize its formatting.Document doc = new Document(); DocumentBuilder builder = new DocumentBuilder(doc); Shape shape = builder.insertHorizontalRule(); HorizontalRuleFormat horizontalRuleFormat = shape.getHorizontalRuleFormat(); horizontalRuleFormat.setAlignment(HorizontalRuleAlignment.CENTER); horizontalRuleFormat.setWidthPercent(70.0); horizontalRuleFormat.setHeight(3.0); horizontalRuleFormat.setColor(Color.BLUE); horizontalRuleFormat.setNoShade(true); Assert.assertTrue(shape.isHorizontalRule()); Assert.assertTrue(shape.getHorizontalRuleFormat().getNoShade());
public java.awt.Color getColor() / public void setColor(java.awt.Color value)
This is a shortcut to the
The default value is
Example:
Shows how to insert a horizontal rule shape, and customize its formatting.Document doc = new Document(); DocumentBuilder builder = new DocumentBuilder(doc); Shape shape = builder.insertHorizontalRule(); HorizontalRuleFormat horizontalRuleFormat = shape.getHorizontalRuleFormat(); horizontalRuleFormat.setAlignment(HorizontalRuleAlignment.CENTER); horizontalRuleFormat.setWidthPercent(70.0); horizontalRuleFormat.setHeight(3.0); horizontalRuleFormat.setColor(Color.BLUE); horizontalRuleFormat.setNoShade(true); Assert.assertTrue(shape.isHorizontalRule()); Assert.assertTrue(shape.getHorizontalRuleFormat().getNoShade());
public double getHeight() / public void setHeight(double value)
This is a shortcut to the
Valid values range from 0 to 1584 inclusive.
The default value is 1.5.
Example:
Shows how to insert a horizontal rule shape, and customize its formatting.Document doc = new Document(); DocumentBuilder builder = new DocumentBuilder(doc); Shape shape = builder.insertHorizontalRule(); HorizontalRuleFormat horizontalRuleFormat = shape.getHorizontalRuleFormat(); horizontalRuleFormat.setAlignment(HorizontalRuleAlignment.CENTER); horizontalRuleFormat.setWidthPercent(70.0); horizontalRuleFormat.setHeight(3.0); horizontalRuleFormat.setColor(Color.BLUE); horizontalRuleFormat.setNoShade(true); Assert.assertTrue(shape.isHorizontalRule()); Assert.assertTrue(shape.getHorizontalRuleFormat().getNoShade());
public boolean getNoShade() / public void setNoShade(boolean value)
The default value is false.
Example:
Shows how to insert a horizontal rule shape, and customize its formatting.Document doc = new Document(); DocumentBuilder builder = new DocumentBuilder(doc); Shape shape = builder.insertHorizontalRule(); HorizontalRuleFormat horizontalRuleFormat = shape.getHorizontalRuleFormat(); horizontalRuleFormat.setAlignment(HorizontalRuleAlignment.CENTER); horizontalRuleFormat.setWidthPercent(70.0); horizontalRuleFormat.setHeight(3.0); horizontalRuleFormat.setColor(Color.BLUE); horizontalRuleFormat.setNoShade(true); Assert.assertTrue(shape.isHorizontalRule()); Assert.assertTrue(shape.getHorizontalRuleFormat().getNoShade());
public double getWidthPercent() / public void setWidthPercent(double value)
Valid values range from 1 to 100 inclusive.
The default value is 100.
Example:
Shows how to insert a horizontal rule shape, and customize its formatting.Document doc = new Document(); DocumentBuilder builder = new DocumentBuilder(doc); Shape shape = builder.insertHorizontalRule(); HorizontalRuleFormat horizontalRuleFormat = shape.getHorizontalRuleFormat(); horizontalRuleFormat.setAlignment(HorizontalRuleAlignment.CENTER); horizontalRuleFormat.setWidthPercent(70.0); horizontalRuleFormat.setHeight(3.0); horizontalRuleFormat.setColor(Color.BLUE); horizontalRuleFormat.setNoShade(true); Assert.assertTrue(shape.isHorizontalRule()); Assert.assertTrue(shape.getHorizontalRuleFormat().getNoShade());