com.aspose.words
Class ReflectionFormat

java.lang.Object
    extended by com.aspose.words.ReflectionFormat

public class ReflectionFormat 
extends java.lang.Object

Represents the reflection formatting for an object.

Use the ShapeBase.Reflection property to access reflection properties of an object. You do not create instances of the ReflectionFormat class directly.

Example:

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());

Property Getters/Setters Summary
doublegetBlur()
voidsetBlur(double value)
           Gets or sets a double value that specifies the degree of blur effect applied to the reflection effect in points. The default value is 0.0.
doublegetDistance()
voidsetDistance(double value)
           Gets or 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.
doublegetSize()
voidsetSize(double value)
           Gets or 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.
doublegetTransparency()
voidsetTransparency(double value)
           Gets or 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.
 
Method Summary
voidremove()
           Removes ReflectionFormat from the parent object.
 

Property Getters/Setters Detail

getBlur/setBlur

public double getBlur() / public void setBlur(double value)
Gets or sets a double value that specifies the degree of blur effect applied to the reflection effect in points. The default value is 0.0.

Example:

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());

getDistance/setDistance

public double getDistance() / public void setDistance(double value)
Gets or 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.

Example:

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());

getSize/setSize

public double getSize() / public void setSize(double value)
Gets or 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.

Example:

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());

getTransparency/setTransparency

public double getTransparency() / public void setTransparency(double value)
Gets or 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.

Example:

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());

Method Detail

remove

public void remove()
Removes ReflectionFormat from the parent object.

Example:

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());

See Also:
          Aspose.Words Documentation - the home page for the Aspose.Words Product Documentation.
          Aspose.Words Support Forum - our preferred method of support.