Skip to main content

PresetShadowEffect Class

Contains properties to configure a preset shadow effect.

Declaration

public class PresetShadowEffect extends OfficeObject

Remarks

Use the following methods to configure the preset shadow effect:

The following code snippet applies a preset shadow effect to a shape:

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

// Create a presentation.
try(Presentation presentation = new Presentation()) {

    ShapeEffectProperties effectProperties = new ShapeEffectProperties();
    effectProperties.setPresetShadow(new PresetShadowEffect() {{
        setColor(new OfficeColor(Color.getGray()));
        setAngle(45);
        setDistance(50);
        setType(PresetShadowType.BOTTOM_LEFT_DROP);
    }});


    Shape shape = new Shape(ShapeType.getRectangle(), 10, 10, 300, 300) {{
        setOutline(new LineStyle());
        getOutline().setFill(new SolidFill(Color.getRoyalBlue()));
        getOutline().setWidth(8);
        setFill(new SolidFill(Color.getWhite()));
        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
PresetShadowEffect

PresetShadowEffect()

Initializes a new instance of the PresetShadowEffect class.

Declaration

public PresetShadowEffect()

Methods

deepClone() Method

Returns a deep copy of this PresetShadowEffect instance.

Declaration

public PresetShadowEffect deepClone()

Returns

Type Description
PresetShadowEffect

A deep copy of this PresetShadowEffect.

getAngle() Method

Returns the shadow angle in degrees.

Declaration

public int getAngle()

Returns

Type Description
int

The shadow angle in degrees.

getColor() Method

Returns the shadow color.

Declaration

public OfficeColor getColor()

Returns

Type Description
OfficeColor

The shadow color.

getDistance() Method

Returns how far to offset the shadow.

Declaration

public float getDistance()

Returns

Type Description
float

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

getType() Method

Returns the preset shadow effect type.

Declaration

public PresetShadowType getType()

Returns

Type Description
PresetShadowType

The shadow effect type.

setAngle(int value) Method

Sets the shadow angle in degrees.

Declaration

public void setAngle(int value)

Parameters

Name Type Description
value int

The shadow angle in degrees.

setColor(OfficeColor value) Method

Sets the shadow color.

Declaration

public void setColor(OfficeColor value)

Parameters

Name Type Description
value OfficeColor

The shadow color.

setDistance(float value) Method

Sets how far to offset the shadow.

Declaration

public void setDistance(float value)

Parameters

Name Type Description
value float

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

setType(PresetShadowType value) Method

Sets the preset shadow effect type.

Declaration

public void setType(PresetShadowType value)

Parameters

Name Type Description
value PresetShadowType

The shadow effect type.