Skip to main content

ReflectionEffect Class

Contains properties used to configure a reflection effect.

Declaration

public class ReflectionEffect extends OfficeObject

Remarks

The following code snippet applies a reflection effect to a shape:

Shape Reflection Effect, DevExpress Presentation API for Java

import com.devexpress.docs.*;
import com.devexpress.docs.office.*;
import com.devexpress.system.drawing.*;
import com.devexpress.docs.presentation.*;

// Create a presentation.
try(Presentation presentation = new Presentation()) {
    // Customize shape effects.
    ShapeEffectProperties effectProperties = new ShapeEffectProperties();
    effectProperties.setReflection(new ReflectionEffect() {{
        setAngle(90);
        setBlurRadius(10);
        setDistance(100);
        setStartOpacity(50);
        setEndOpacity(100);
        setStartPosition(0);
        setEndPosition(50);
        setFadeAngle(45);
        setHorizontalScale(100);
        setVerticalScale(100);
        setHorizontalSkew(0);
        setVerticalSkew(0);
        setRotateWithShape(true);
        setAlignment(RectangleAlignType.CENTER);
    }});

    Shape shape = new Shape(ShapeType.getRectangle(), 100, 100, 300, 300) {{
        setFill(new SolidFill(Color.getRoyalBlue()));
        setEffects(effectProperties);
    }};

    // Access the first slide in the presentation.
    Slide slide = presentation.getSlides().getFirst();
    slide.getShapes().add(shape);

    // Perform additional presentation processing logic.
}

Inherited Members

com.devexpress.system.JavaObject.clone()
com.devexpress.system.JavaObject.equals(java.lang.Object)
com.devexpress.system.JavaObject.hashCode()
com.devexpress.system.JavaObject.initFields()
com.devexpress.system.JavaObject.memberwiseClone()
com.devexpress.system.JavaObject.toString()
java.lang.Object.finalize()
java.lang.Object.getClass()
java.lang.Object.notify()
java.lang.Object.notifyAll()
java.lang.Object.wait()
java.lang.Object.wait(long)
java.lang.Object.wait(long,int)

Inheritance

Object
JavaObject
OfficeObject
ReflectionEffect

ReflectionEffect()

Initializes a new instance of the ReflectionEffect class.

Declaration

public ReflectionEffect()

Methods

deepClone() Method

Returns a deep copy of this ReflectionEffect instance.

Declaration

public ReflectionEffect deepClone()

Returns

Type Description
ReflectionEffect

A deep copy of this ReflectionEffect.

getAlignment() Method

Returns the shadow alignment of the reflection effect.

Declaration

public RectangleAlignType getAlignment()

Returns

Type Description
RectangleAlignType

The shadow alignment of the reflection effect.

getAngle() Method

Returns the angle of the reflection effect.

Declaration

public float getAngle()

Returns

Type Description
float

The angle of the reflection effect in degrees.

getBlurRadius() Method

Returns the outer shadow’s blur radius.

Declaration

public float getBlurRadius()

Returns

Type Description
float

The outer shadow’s blur radius in Document units (1/300 of an inch).

getDistance() Method

Returns how far to offset the reflection.

Declaration

public float getDistance()

Returns

Type Description
float

The distance to offset the reflection in Document units (1/300 of an inch).

getEndOpacity() Method

Returns the opacity of the reflection’s end.

Declaration

public float getEndOpacity()

Returns

Type Description
float

The opacity of the reflection’s end as a percentage (from 0 to 100).

getEndPosition() Method

Returns the position of the reflection’s end.

Declaration

public float getEndPosition()

Returns

Type Description
float

The position of the reflection’s end as a percentage (from 0 to 100).

getFadeAngle() Method

Returns the angle of the reflection’s fade.

Declaration

public float getFadeAngle()

Returns

Type Description
float

The angle of the reflection’s fade in degrees.

getHorizontalScale() Method

Returns the horizontal scale of the reflection effect.

Declaration

public float getHorizontalScale()

Returns

Type Description
float

The horizontal scale of the reflection effect as a percentage (from 0 to 100).

getHorizontalSkew() Method

Returns the horizontal skew angle of the reflection effect.

Declaration

public float getHorizontalSkew()

Returns

Type Description
float

The horizontal skew angle in degrees in the (-90, 90) range.

getRotateWithShape() Method

Returns whether the shadow rotates with the shape.

Declaration

public boolean getRotateWithShape()

Returns

Type Description
boolean

true if the shadow rotates with the shape; otherwise, false.

getStartOpacity() Method

Returns the starting opacity of the reflection effect.

Declaration

public float getStartOpacity()

Returns

Type Description
float

The starting opacity of the reflection effect as a percentage (from 0 to 100).

getStartPosition() Method

Returns the starting position of the reflection effect.

Declaration

public float getStartPosition()

Returns

Type Description
float

The starting position of the reflection effect as a percentage (from 0 to 100).

getVerticalScale() Method

Returns the vertical scale of the reflection effect.

Declaration

public float getVerticalScale()

Returns

Type Description
float

The vertical scale of the reflection effect as a percentage (from 0 to 100).

getVerticalSkew() Method

Returns the vertical skew of the reflection effect.

Declaration

public float getVerticalSkew()

Returns

Type Description
float

The vertical skew angle in degrees in the (-90, 90) range.

setAlignment(RectangleAlignType value) Method

Sets the shadow alignment of the reflection effect.

Declaration

public void setAlignment(RectangleAlignType value)

Parameters

Name Type Description
value RectangleAlignType

The shadow alignment of the reflection effect.

setAngle(float value) Method

Sets the angle of the reflection effect.

Declaration

public void setAngle(float value)

Parameters

Name Type Description
value float

The angle of the reflection effect in degrees.

setBlurRadius(float value) Method

Sets the outer shadow’s blur radius.

Declaration

public void setBlurRadius(float value)

Parameters

Name Type Description
value float

The outer shadow’s blur radius in Document units (1/300 of an inch).

setDistance(float value) Method

Sets how far to offset the reflection.

Declaration

public void setDistance(float value)

Parameters

Name Type Description
value float

The distance to offset the reflection in Document units (1/300 of an inch).

setEndOpacity(float value) Method

Sets the opacity of the reflection’s end.

Declaration

public void setEndOpacity(float value)

Parameters

Name Type Description
value float

The opacity of the reflection’s end as a percentage (from 0 to 100).

setEndPosition(float value) Method

Sets the position of the reflection’s end.

Declaration

public void setEndPosition(float value)

Parameters

Name Type Description
value float

The position of the reflection’s end as a percentage (from 0 to 100).

setFadeAngle(float value) Method

Sets the angle of the reflection’s fade.

Declaration

public void setFadeAngle(float value)

Parameters

Name Type Description
value float

The angle of the reflection’s fade in degrees.

setHorizontalScale(float value) Method

Sets the horizontal scale of the reflection effect.

Declaration

public void setHorizontalScale(float value)

Parameters

Name Type Description
value float

The horizontal scale of the reflection effect as a percentage (from 0 to 100).

setHorizontalSkew(float value) Method

Sets the horizontal skew angle of the reflection effect.

Declaration

public void setHorizontalSkew(float value)

Parameters

Name Type Description
value float

The horizontal skew angle in degrees.

setRotateWithShape(boolean value) Method

Sets whether the shadow rotates with the shape.

Declaration

public void setRotateWithShape(boolean value)

Parameters

Name Type Description
value boolean

true if the shadow rotates with the shape; otherwise, false.

setStartOpacity(float value) Method

Sets the starting opacity of the reflection effect.

Declaration

public void setStartOpacity(float value)

Parameters

Name Type Description
value float

The starting opacity of the reflection effect as a percentage (from 0 to 100).

setStartPosition(float value) Method

Sets the starting position of the reflection effect.

Declaration

public void setStartPosition(float value)

Parameters

Name Type Description
value float

The starting position of the reflection effect as a percentage (from 0 to 100).

setVerticalScale(float value) Method

Sets the vertical scale of the reflection effect.

Declaration

public void setVerticalScale(float value)

Parameters

Name Type Description
value float

The vertical scale of the reflection effect as a percentage (from 0 to 100).

setVerticalSkew(float value) Method

Sets the vertical skew of the reflection effect.

Declaration

public void setVerticalSkew(float value)

Parameters

Name Type Description
value float

The vertical skew angle in degrees in the (-90, 90) range.