ReflectionFormat
Inheritance: java.lang.Object
public class ReflectionFormat
Represents the reflection formatting for an object.
Remarks:
Use the ShapeBase.getReflection() property to access reflection properties of an object. You do not create instances of the ReflectionFormat class directly.
Examples:
Shows how to interact with reflection shape effect.
Document doc = new Document(getMyDir() + "Various shapes.docx");
Shape shape = (Shape)doc.getChild(NodeType.SHAPE, 0, true);
// Apply reflection effect to the shape.
shape.getReflection().setTransparency(0.37);
shape.getReflection().setSize(0.48);
shape.getReflection().setBlur(17.5);
shape.getReflection().setDistance(9.2);
doc.save(getArtifactsDir() + "Shape.Reflection.docx");
doc = new Document(getArtifactsDir() + "Shape.Reflection.docx");
shape = (Shape)doc.getChild(NodeType.SHAPE, 0, true);
// Check reflection effect attributes.
Assert.assertEquals(0.37d, shape.getReflection().getTransparency(), 0.01d);
Assert.assertEquals(0.48d, shape.getReflection().getSize(), 0.01d);
Assert.assertEquals(17.5d, shape.getReflection().getBlur(), 0.01d);
Assert.assertEquals(9.2d, shape.getReflection().getDistance(), 0.01d);
// Remove reflection effect from the shape.
shape.getReflection().remove();
Assert.assertEquals(0, shape.getReflection().getTransparency());
Assert.assertEquals(0, shape.getReflection().getSize());
Assert.assertEquals(0, shape.getReflection().getBlur());
Assert.assertEquals(0, shape.getReflection().getDistance());
Methods
Method | Description |
---|---|
getBlur() | Gets a double value that specifies the degree of blur effect applied to the reflection effect in points. |
getDistance() | Gets a double value that specifies the amount of separation of the reflected image from the object in points. |
getSize() | Gets a double value between 0.0 and 1.0 representing the size of the reflection as a percentage of the reflected object. |
getTransparency() | Gets a double value between 0.0 (opaque) and 1.0 (clear) representing the degree of transparency for the reflection effect. |
remove() | Removes ReflectionFormat from the parent object. |
setBlur(double value) | Sets a double value that specifies the degree of blur effect applied to the reflection effect in points. |
setDistance(double value) | Sets a double value that specifies the amount of separation of the reflected image from the object in points. |
setSize(double value) | Sets a double value between 0.0 and 1.0 representing the size of the reflection as a percentage of the reflected object. |
setTransparency(double value) | Sets a double value between 0.0 (opaque) and 1.0 (clear) representing the degree of transparency for the reflection effect. |
getBlur()
public double getBlur()
Gets a double value that specifies the degree of blur effect applied to the reflection effect in points. The default value is 0.0.
Examples:
Shows how to interact with reflection shape effect.
Document doc = new Document(getMyDir() + "Various shapes.docx");
Shape shape = (Shape)doc.getChild(NodeType.SHAPE, 0, true);
// Apply reflection effect to the shape.
shape.getReflection().setTransparency(0.37);
shape.getReflection().setSize(0.48);
shape.getReflection().setBlur(17.5);
shape.getReflection().setDistance(9.2);
doc.save(getArtifactsDir() + "Shape.Reflection.docx");
doc = new Document(getArtifactsDir() + "Shape.Reflection.docx");
shape = (Shape)doc.getChild(NodeType.SHAPE, 0, true);
// Check reflection effect attributes.
Assert.assertEquals(0.37d, shape.getReflection().getTransparency(), 0.01d);
Assert.assertEquals(0.48d, shape.getReflection().getSize(), 0.01d);
Assert.assertEquals(17.5d, shape.getReflection().getBlur(), 0.01d);
Assert.assertEquals(9.2d, shape.getReflection().getDistance(), 0.01d);
// Remove reflection effect from the shape.
shape.getReflection().remove();
Assert.assertEquals(0, shape.getReflection().getTransparency());
Assert.assertEquals(0, shape.getReflection().getSize());
Assert.assertEquals(0, shape.getReflection().getBlur());
Assert.assertEquals(0, shape.getReflection().getDistance());
Returns: double - A double value that specifies the degree of blur effect applied to the reflection effect in points.
getDistance()
public double getDistance()
Gets a double value that specifies the amount of separation of the reflected image from the object in points. The default value is 0.0.
Examples:
Shows how to interact with reflection shape effect.
Document doc = new Document(getMyDir() + "Various shapes.docx");
Shape shape = (Shape)doc.getChild(NodeType.SHAPE, 0, true);
// Apply reflection effect to the shape.
shape.getReflection().setTransparency(0.37);
shape.getReflection().setSize(0.48);
shape.getReflection().setBlur(17.5);
shape.getReflection().setDistance(9.2);
doc.save(getArtifactsDir() + "Shape.Reflection.docx");
doc = new Document(getArtifactsDir() + "Shape.Reflection.docx");
shape = (Shape)doc.getChild(NodeType.SHAPE, 0, true);
// Check reflection effect attributes.
Assert.assertEquals(0.37d, shape.getReflection().getTransparency(), 0.01d);
Assert.assertEquals(0.48d, shape.getReflection().getSize(), 0.01d);
Assert.assertEquals(17.5d, shape.getReflection().getBlur(), 0.01d);
Assert.assertEquals(9.2d, shape.getReflection().getDistance(), 0.01d);
// Remove reflection effect from the shape.
shape.getReflection().remove();
Assert.assertEquals(0, shape.getReflection().getTransparency());
Assert.assertEquals(0, shape.getReflection().getSize());
Assert.assertEquals(0, shape.getReflection().getBlur());
Assert.assertEquals(0, shape.getReflection().getDistance());
Returns: double - A double value that specifies the amount of separation of the reflected image from the object in points.
getSize()
public double getSize()
Gets a double value between 0.0 and 1.0 representing the size of the reflection as a percentage of the reflected object. The default value is 0.0.
Examples:
Shows how to interact with reflection shape effect.
Document doc = new Document(getMyDir() + "Various shapes.docx");
Shape shape = (Shape)doc.getChild(NodeType.SHAPE, 0, true);
// Apply reflection effect to the shape.
shape.getReflection().setTransparency(0.37);
shape.getReflection().setSize(0.48);
shape.getReflection().setBlur(17.5);
shape.getReflection().setDistance(9.2);
doc.save(getArtifactsDir() + "Shape.Reflection.docx");
doc = new Document(getArtifactsDir() + "Shape.Reflection.docx");
shape = (Shape)doc.getChild(NodeType.SHAPE, 0, true);
// Check reflection effect attributes.
Assert.assertEquals(0.37d, shape.getReflection().getTransparency(), 0.01d);
Assert.assertEquals(0.48d, shape.getReflection().getSize(), 0.01d);
Assert.assertEquals(17.5d, shape.getReflection().getBlur(), 0.01d);
Assert.assertEquals(9.2d, shape.getReflection().getDistance(), 0.01d);
// Remove reflection effect from the shape.
shape.getReflection().remove();
Assert.assertEquals(0, shape.getReflection().getTransparency());
Assert.assertEquals(0, shape.getReflection().getSize());
Assert.assertEquals(0, shape.getReflection().getBlur());
Assert.assertEquals(0, shape.getReflection().getDistance());
Returns: double - A double value between 0.0 and 1.0 representing the size of the reflection as a percentage of the reflected object.
getTransparency()
public double getTransparency()
Gets a double value between 0.0 (opaque) and 1.0 (clear) representing the degree of transparency for the reflection effect. The default value is 0.0.
Examples:
Shows how to interact with reflection shape effect.
Document doc = new Document(getMyDir() + "Various shapes.docx");
Shape shape = (Shape)doc.getChild(NodeType.SHAPE, 0, true);
// Apply reflection effect to the shape.
shape.getReflection().setTransparency(0.37);
shape.getReflection().setSize(0.48);
shape.getReflection().setBlur(17.5);
shape.getReflection().setDistance(9.2);
doc.save(getArtifactsDir() + "Shape.Reflection.docx");
doc = new Document(getArtifactsDir() + "Shape.Reflection.docx");
shape = (Shape)doc.getChild(NodeType.SHAPE, 0, true);
// Check reflection effect attributes.
Assert.assertEquals(0.37d, shape.getReflection().getTransparency(), 0.01d);
Assert.assertEquals(0.48d, shape.getReflection().getSize(), 0.01d);
Assert.assertEquals(17.5d, shape.getReflection().getBlur(), 0.01d);
Assert.assertEquals(9.2d, shape.getReflection().getDistance(), 0.01d);
// Remove reflection effect from the shape.
shape.getReflection().remove();
Assert.assertEquals(0, shape.getReflection().getTransparency());
Assert.assertEquals(0, shape.getReflection().getSize());
Assert.assertEquals(0, shape.getReflection().getBlur());
Assert.assertEquals(0, shape.getReflection().getDistance());
Returns: double - A double value between 0.0 (opaque) and 1.0 (clear) representing the degree of transparency for the reflection effect.
remove()
public void remove()
Removes ReflectionFormat from the parent object.
Examples:
Shows how to interact with reflection shape effect.
Document doc = new Document(getMyDir() + "Various shapes.docx");
Shape shape = (Shape)doc.getChild(NodeType.SHAPE, 0, true);
// Apply reflection effect to the shape.
shape.getReflection().setTransparency(0.37);
shape.getReflection().setSize(0.48);
shape.getReflection().setBlur(17.5);
shape.getReflection().setDistance(9.2);
doc.save(getArtifactsDir() + "Shape.Reflection.docx");
doc = new Document(getArtifactsDir() + "Shape.Reflection.docx");
shape = (Shape)doc.getChild(NodeType.SHAPE, 0, true);
// Check reflection effect attributes.
Assert.assertEquals(0.37d, shape.getReflection().getTransparency(), 0.01d);
Assert.assertEquals(0.48d, shape.getReflection().getSize(), 0.01d);
Assert.assertEquals(17.5d, shape.getReflection().getBlur(), 0.01d);
Assert.assertEquals(9.2d, shape.getReflection().getDistance(), 0.01d);
// Remove reflection effect from the shape.
shape.getReflection().remove();
Assert.assertEquals(0, shape.getReflection().getTransparency());
Assert.assertEquals(0, shape.getReflection().getSize());
Assert.assertEquals(0, shape.getReflection().getBlur());
Assert.assertEquals(0, shape.getReflection().getDistance());
setBlur(double value)
public void setBlur(double value)
Sets a double value that specifies the degree of blur effect applied to the reflection effect in points. The default value is 0.0.
Examples:
Shows how to interact with reflection shape effect.
Document doc = new Document(getMyDir() + "Various shapes.docx");
Shape shape = (Shape)doc.getChild(NodeType.SHAPE, 0, true);
// Apply reflection effect to the shape.
shape.getReflection().setTransparency(0.37);
shape.getReflection().setSize(0.48);
shape.getReflection().setBlur(17.5);
shape.getReflection().setDistance(9.2);
doc.save(getArtifactsDir() + "Shape.Reflection.docx");
doc = new Document(getArtifactsDir() + "Shape.Reflection.docx");
shape = (Shape)doc.getChild(NodeType.SHAPE, 0, true);
// Check reflection effect attributes.
Assert.assertEquals(0.37d, shape.getReflection().getTransparency(), 0.01d);
Assert.assertEquals(0.48d, shape.getReflection().getSize(), 0.01d);
Assert.assertEquals(17.5d, shape.getReflection().getBlur(), 0.01d);
Assert.assertEquals(9.2d, shape.getReflection().getDistance(), 0.01d);
// Remove reflection effect from the shape.
shape.getReflection().remove();
Assert.assertEquals(0, shape.getReflection().getTransparency());
Assert.assertEquals(0, shape.getReflection().getSize());
Assert.assertEquals(0, shape.getReflection().getBlur());
Assert.assertEquals(0, shape.getReflection().getDistance());
Parameters:
Parameter | Type | Description |
---|---|---|
value | double | A double value that specifies the degree of blur effect applied to the reflection effect in points. |
setDistance(double value)
public void setDistance(double value)
Sets a double value that specifies the amount of separation of the reflected image from the object in points. The default value is 0.0.
Examples:
Shows how to interact with reflection shape effect.
Document doc = new Document(getMyDir() + "Various shapes.docx");
Shape shape = (Shape)doc.getChild(NodeType.SHAPE, 0, true);
// Apply reflection effect to the shape.
shape.getReflection().setTransparency(0.37);
shape.getReflection().setSize(0.48);
shape.getReflection().setBlur(17.5);
shape.getReflection().setDistance(9.2);
doc.save(getArtifactsDir() + "Shape.Reflection.docx");
doc = new Document(getArtifactsDir() + "Shape.Reflection.docx");
shape = (Shape)doc.getChild(NodeType.SHAPE, 0, true);
// Check reflection effect attributes.
Assert.assertEquals(0.37d, shape.getReflection().getTransparency(), 0.01d);
Assert.assertEquals(0.48d, shape.getReflection().getSize(), 0.01d);
Assert.assertEquals(17.5d, shape.getReflection().getBlur(), 0.01d);
Assert.assertEquals(9.2d, shape.getReflection().getDistance(), 0.01d);
// Remove reflection effect from the shape.
shape.getReflection().remove();
Assert.assertEquals(0, shape.getReflection().getTransparency());
Assert.assertEquals(0, shape.getReflection().getSize());
Assert.assertEquals(0, shape.getReflection().getBlur());
Assert.assertEquals(0, shape.getReflection().getDistance());
Parameters:
Parameter | Type | Description |
---|---|---|
value | double | A double value that specifies the amount of separation of the reflected image from the object in points. |
setSize(double value)
public void setSize(double value)
Sets a double value between 0.0 and 1.0 representing the size of the reflection as a percentage of the reflected object. The default value is 0.0.
Examples:
Shows how to interact with reflection shape effect.
Document doc = new Document(getMyDir() + "Various shapes.docx");
Shape shape = (Shape)doc.getChild(NodeType.SHAPE, 0, true);
// Apply reflection effect to the shape.
shape.getReflection().setTransparency(0.37);
shape.getReflection().setSize(0.48);
shape.getReflection().setBlur(17.5);
shape.getReflection().setDistance(9.2);
doc.save(getArtifactsDir() + "Shape.Reflection.docx");
doc = new Document(getArtifactsDir() + "Shape.Reflection.docx");
shape = (Shape)doc.getChild(NodeType.SHAPE, 0, true);
// Check reflection effect attributes.
Assert.assertEquals(0.37d, shape.getReflection().getTransparency(), 0.01d);
Assert.assertEquals(0.48d, shape.getReflection().getSize(), 0.01d);
Assert.assertEquals(17.5d, shape.getReflection().getBlur(), 0.01d);
Assert.assertEquals(9.2d, shape.getReflection().getDistance(), 0.01d);
// Remove reflection effect from the shape.
shape.getReflection().remove();
Assert.assertEquals(0, shape.getReflection().getTransparency());
Assert.assertEquals(0, shape.getReflection().getSize());
Assert.assertEquals(0, shape.getReflection().getBlur());
Assert.assertEquals(0, shape.getReflection().getDistance());
Parameters:
Parameter | Type | Description |
---|---|---|
value | double | A double value between 0.0 and 1.0 representing the size of the reflection as a percentage of the reflected object. |
setTransparency(double value)
public void setTransparency(double value)
Sets a double value between 0.0 (opaque) and 1.0 (clear) representing the degree of transparency for the reflection effect. The default value is 0.0.
Examples:
Shows how to interact with reflection shape effect.
Document doc = new Document(getMyDir() + "Various shapes.docx");
Shape shape = (Shape)doc.getChild(NodeType.SHAPE, 0, true);
// Apply reflection effect to the shape.
shape.getReflection().setTransparency(0.37);
shape.getReflection().setSize(0.48);
shape.getReflection().setBlur(17.5);
shape.getReflection().setDistance(9.2);
doc.save(getArtifactsDir() + "Shape.Reflection.docx");
doc = new Document(getArtifactsDir() + "Shape.Reflection.docx");
shape = (Shape)doc.getChild(NodeType.SHAPE, 0, true);
// Check reflection effect attributes.
Assert.assertEquals(0.37d, shape.getReflection().getTransparency(), 0.01d);
Assert.assertEquals(0.48d, shape.getReflection().getSize(), 0.01d);
Assert.assertEquals(17.5d, shape.getReflection().getBlur(), 0.01d);
Assert.assertEquals(9.2d, shape.getReflection().getDistance(), 0.01d);
// Remove reflection effect from the shape.
shape.getReflection().remove();
Assert.assertEquals(0, shape.getReflection().getTransparency());
Assert.assertEquals(0, shape.getReflection().getSize());
Assert.assertEquals(0, shape.getReflection().getBlur());
Assert.assertEquals(0, shape.getReflection().getDistance());
Parameters:
Parameter | Type | Description |
---|---|---|
value | double | A double value between 0.0 (opaque) and 1.0 (clear) representing the degree of transparency for the reflection effect. |