ShadowFormat

Inheritance: java.lang.Object

public class ShadowFormat

Represents shadow formatting for an object.

To learn more, visit the Working with Graphic Elements documentation article.

Methods

MethodDescription
clear()Clears shadow format.
getType()Gets the specified ShadowType for ShadowFormat.
getVisible()Returns true if the formatting applied to this instance is visible.
setType(int value)Sets the specified ShadowType for ShadowFormat.

clear()

public void clear()

Clears shadow format.

Examples:

Shows how to work with a shadow formatting for the shape.


 Document doc = new Document(getMyDir() + "Shape stroke pattern border.docx");
 Shape shape = (Shape)doc.getChildNodes(NodeType.SHAPE, true).get(0);

 if (shape.getShadowFormat().getVisible() && shape.getShadowFormat().getType() == ShadowType.SHADOW_2)
     shape.getShadowFormat().setType(ShadowType.SHADOW_7);

 if (shape.getShadowFormat().getType() == ShadowType.SHADOW_MIXED)
     shape.getShadowFormat().clear();
 

getType()

public int getType()

Gets the specified ShadowType for ShadowFormat.

Returns: int - The specified ShadowType for ShadowFormat. The returned value is one of ShadowType constants.

getVisible()

public boolean getVisible()

Returns true if the formatting applied to this instance is visible.

Remarks:

Unlike clear(), assigning false to Visible does not clear the formatting, it only hides the shape effect.

Examples:

Shows how to work with a shadow formatting for the shape.


 Document doc = new Document(getMyDir() + "Shape stroke pattern border.docx");
 Shape shape = (Shape)doc.getChildNodes(NodeType.SHAPE, true).get(0);

 if (shape.getShadowFormat().getVisible() && shape.getShadowFormat().getType() == ShadowType.SHADOW_2)
     shape.getShadowFormat().setType(ShadowType.SHADOW_7);

 if (shape.getShadowFormat().getType() == ShadowType.SHADOW_MIXED)
     shape.getShadowFormat().clear();
 

Returns: boolean - true if the formatting applied to this instance is visible.

setType(int value)

public void setType(int value)

Sets the specified ShadowType for ShadowFormat.

Parameters:

ParameterTypeDescription
valueintThe specified ShadowType for ShadowFormat. The value must be one of ShadowType constants.