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:
- setColor(OfficeColor value) — Specifies the preset shadow color.
- setAngle(int value) — Specifies the angle of the shadow’s offset.
- setDistance(float value) — Specifies how far to offset the shadow.
- setType(PresetShadowType value) — Specifies the preset shadow type.
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
Inheritance
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 |
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. |