Namespace EasyXLS.Drawings.Formatting
Class ShadowFormat
- System.Object
-
- EasyXLS.Drawings.Formatting.ShadowFormat
-
public class ShadowFormat extends System.Object
This class stores the shadow options for images, shapes and other drawing objects. It allows to set a predefined shadow or to create a new one. There are 4 types of base shadows: none, outer, inner or perspective shadow.
-
-
Constant Summary
Fields Modifier and Type Field Description const System.String
ALIGNMENT_BOTTOM
A constant indicating the bottom alignment.const System.String
ALIGNMENT_BOTTOM_LEFT
A constant indicating the bottom left alignment.const System.String
ALIGNMENT_BOTTOM_RIGHT
A constant indicating the bottom right alignment.const System.String
ALIGNMENT_CENTER
A constant indicating the center alignment.const System.String
ALIGNMENT_LEFT
A constant indicating the left alignment.const System.String
ALIGNMENT_RIGHT
A constant indicating the right alignment.const System.String
ALIGNMENT_TOP
A constant indicating the top alignment.const System.String
ALIGNMENT_TOP_LEFT
A constant indicating the top left alignment.const System.String
ALIGNMENT_TOP_RIGHT
A constant indicating the top right alignment.const short
INSIDE_BOTTOM
A constant indicating the inside bottom shadow.const short
INSIDE_CENTER
A constant indicating the inside center shadow.const short
INSIDE_DIAGONAL_BOTTOM_LEFT
A constant indicating the inside diagonal bottom left shadow.const short
INSIDE_DIAGONAL_BOTTOM_RIGHT
A constant indicating the inside diagonal bottom right shadow.const short
INSIDE_DIAGONAL_TOP_LEFT
A constant indicating the inside diagonal top left shadow.const short
INSIDE_DIAGONAL_TOP_RIGHT
A constant indicating the inside diagonal top right shadow.const short
INSIDE_LEFT
A constant indicating the inside left shadow.const short
INSIDE_RIGHT
A constant indicating the inside right shadow.const short
INSIDE_TOP
A constant indicating the inside top shadow.const short
NO_SHADOW
A constant indicating that no shadow is set.const short
OFFSET_BOTTOM
A constant indicating the offset bottom shadow.const short
OFFSET_CENTER
A constant indicating the offset center shadow.const short
OFFSET_DIAGONAL_BOTTOM_LEFT
A constant indicating the offset diagonal bottom left shadow.const short
OFFSET_DIAGONAL_BOTTOM_RIGHT
A constant indicating the offset diagonal bottom right shadow.const short
OFFSET_DIAGONAL_TOP_LEFT
A constant indicating the offset diagonal top left shadow.const short
OFFSET_DIAGONAL_TOP_RIGHT
A constant indicating the offset diagonal top right shadow.const short
OFFSET_LEFT
A constant indicating the offset left shadow.const short
OFFSET_RIGHT
A constant indicating the offset right shadow.const short
OFFSET_TOP
A constant indicating the offset top shadow.const short
PERSPECTIVE_BELOW
A constant indicating the perspective below shadow.const short
PERSPECTIVE_DIAGONAL_LOWER_LEFT
A constant indicating the perspective diagonal lower left shadow.const short
PERSPECTIVE_DIAGONAL_LOWER_RIGHT
A constant indicating the perspective diagonal lower right shadow.const short
PERSPECTIVE_DIAGONAL_UPPER_LEFT
A constant indicating the perspective diagonal upper left shadow.const short
PERSPECTIVE_DIAGONAL_UPPER_RIGHT
A constant indicating the perspective diagonal upper right shadow.const short
TYPE_INNER
A constant indicating the inner shadow type.const short
TYPE_NO_SHADOW
A constant indicating that no shadow type is set.const short
TYPE_OUTER
A constant indicating the outer shadow type.const short
TYPE_PERSPECTIVE
A constant indicating the perspective shadow type.
-
Constructor Summary
Constructors Constructor Description ShadowFormat()
Defines an instance of the shadow formatting.
-
Method Summary
Modifier and Type Method Description ShadowFormat
Clone()
Creates and returns a copy of this object.System.String
getAlignment()
Returns the alignment of the shadow.float
getAngle()
Returns the angle of the shadow.float
getBlur()
Returns the blur of the shadow.System.Drawing.Color
getColor()
Returns the shadow colorfloat
getDistance()
Returns the distance of the shadow.int
getShadowType()
Returns the shadow type of the shape.float
getSize()
Returns the size of the shadow.ThemeColor
getThemeColor()
Returns the shadow colorint
getTransparency()
Returns the transparency of the shadow.bool
HasShadow()
Returns true if the shape has shadow, false otherwise.bool
IsLowerPerspective()
Returns true if it is a perspective shadow displayed in front of the shape, false otherwise.void
setAngle(float angle)
Sets the angle of the shadow.void
setBlur(float blur)
Sets the blur of the shadow.void
setColor(ThemeColor themeColor)
Sets the shadow color.void
setColor(System.Drawing.Color color)
Sets the shadow color.void
setDistance(float distance)
Sets the distance of the shadow.void
setInnerShadow(int transparency, float blur, float angle, float distance)
Sets the inner shadow option of the shape.void
setNoShadow(bool hasShadow)
Sets the no shadow option of the shape.void
setOuterShadow(int transparency, float size, float blur, float angle, float distance, System.String alignment)
Sets the outer shadow option of the shape.void
setPerspectiveShadow(int transparency, float size, float blur, float angle, float distance, System.String alignment, bool isLower)
Sets the perspective shadow option of the shape.void
setShadow(int presetShadows)
Sets the shadow of the shape.void
setSize(float size)
Sets the size of the shadow.void
setTransparency(int transparency)
Sets the transparency of the shadow.
-
-
-
Field Detail
-
TYPE_NO_SHADOW
public const short TYPE_NO_SHADOW
A constant indicating that no shadow type is set. Embedded value is "0".- See Also:
- Constant Values
-
TYPE_OUTER
public const short TYPE_OUTER
A constant indicating the outer shadow type. Embedded value is "1".- See Also:
- Constant Values
-
TYPE_INNER
public const short TYPE_INNER
A constant indicating the inner shadow type. Embedded value is "2".- See Also:
- Constant Values
-
TYPE_PERSPECTIVE
public const short TYPE_PERSPECTIVE
A constant indicating the perspective shadow type. Embedded value is "3".- See Also:
- Constant Values
-
NO_SHADOW
public const short NO_SHADOW
A constant indicating that no shadow is set. Embedded value is "0".- See Also:
- Constant Values
-
OFFSET_DIAGONAL_BOTTOM_RIGHT
public const short OFFSET_DIAGONAL_BOTTOM_RIGHT
A constant indicating the offset diagonal bottom right shadow. Embedded value is "1".- See Also:
- Constant Values
-
OFFSET_BOTTOM
public const short OFFSET_BOTTOM
A constant indicating the offset bottom shadow. Embedded value is "2".- See Also:
- Constant Values
-
OFFSET_DIAGONAL_BOTTOM_LEFT
public const short OFFSET_DIAGONAL_BOTTOM_LEFT
A constant indicating the offset diagonal bottom left shadow. Embedded value is "3".- See Also:
- Constant Values
-
OFFSET_RIGHT
public const short OFFSET_RIGHT
A constant indicating the offset right shadow. Embedded value is "4".- See Also:
- Constant Values
-
OFFSET_CENTER
public const short OFFSET_CENTER
A constant indicating the offset center shadow. Embedded value is "5".- See Also:
- Constant Values
-
OFFSET_LEFT
public const short OFFSET_LEFT
A constant indicating the offset left shadow. Embedded value is "6".- See Also:
- Constant Values
-
OFFSET_DIAGONAL_TOP_RIGHT
public const short OFFSET_DIAGONAL_TOP_RIGHT
A constant indicating the offset diagonal top right shadow. Embedded value is "7".- See Also:
- Constant Values
-
OFFSET_TOP
public const short OFFSET_TOP
A constant indicating the offset top shadow. Embedded value is "8".- See Also:
- Constant Values
-
OFFSET_DIAGONAL_TOP_LEFT
public const short OFFSET_DIAGONAL_TOP_LEFT
A constant indicating the offset diagonal top left shadow. Embedded value is "9".- See Also:
- Constant Values
-
INSIDE_DIAGONAL_TOP_LEFT
public const short INSIDE_DIAGONAL_TOP_LEFT
A constant indicating the inside diagonal top left shadow. Embedded value is "10".- See Also:
- Constant Values
-
INSIDE_TOP
public const short INSIDE_TOP
A constant indicating the inside top shadow. Embedded value is "11".- See Also:
- Constant Values
-
INSIDE_DIAGONAL_TOP_RIGHT
public const short INSIDE_DIAGONAL_TOP_RIGHT
A constant indicating the inside diagonal top right shadow. Embedded value is "12".- See Also:
- Constant Values
-
INSIDE_LEFT
public const short INSIDE_LEFT
A constant indicating the inside left shadow. Embedded value is "13".- See Also:
- Constant Values
-
INSIDE_CENTER
public const short INSIDE_CENTER
A constant indicating the inside center shadow. Embedded value is "14".- See Also:
- Constant Values
-
INSIDE_RIGHT
public const short INSIDE_RIGHT
A constant indicating the inside right shadow. Embedded value is "15".- See Also:
- Constant Values
-
INSIDE_DIAGONAL_BOTTOM_LEFT
public const short INSIDE_DIAGONAL_BOTTOM_LEFT
A constant indicating the inside diagonal bottom left shadow. Embedded value is "16".- See Also:
- Constant Values
-
INSIDE_BOTTOM
public const short INSIDE_BOTTOM
A constant indicating the inside bottom shadow. Embedded value is "17".- See Also:
- Constant Values
-
INSIDE_DIAGONAL_BOTTOM_RIGHT
public const short INSIDE_DIAGONAL_BOTTOM_RIGHT
A constant indicating the inside diagonal bottom right shadow. Embedded value is "18".- See Also:
- Constant Values
-
PERSPECTIVE_DIAGONAL_UPPER_LEFT
public const short PERSPECTIVE_DIAGONAL_UPPER_LEFT
A constant indicating the perspective diagonal upper left shadow. Embedded value is "19".- See Also:
- Constant Values
-
PERSPECTIVE_DIAGONAL_UPPER_RIGHT
public const short PERSPECTIVE_DIAGONAL_UPPER_RIGHT
A constant indicating the perspective diagonal upper right shadow. Embedded value is "20".- See Also:
- Constant Values
-
PERSPECTIVE_BELOW
public const short PERSPECTIVE_BELOW
A constant indicating the perspective below shadow. Embedded value is "21".- See Also:
- Constant Values
-
PERSPECTIVE_DIAGONAL_LOWER_LEFT
public const short PERSPECTIVE_DIAGONAL_LOWER_LEFT
A constant indicating the perspective diagonal lower left shadow. Embedded value is "22".- See Also:
- Constant Values
-
PERSPECTIVE_DIAGONAL_LOWER_RIGHT
public const short PERSPECTIVE_DIAGONAL_LOWER_RIGHT
A constant indicating the perspective diagonal lower right shadow. Embedded value is "23".- See Also:
- Constant Values
-
ALIGNMENT_TOP_LEFT
public const System.String ALIGNMENT_TOP_LEFT
A constant indicating the top left alignment. Embedded value is "tl".- See Also:
- Constant Values
-
ALIGNMENT_TOP
public const System.String ALIGNMENT_TOP
A constant indicating the top alignment. Embedded value is "t".- See Also:
- Constant Values
-
ALIGNMENT_TOP_RIGHT
public const System.String ALIGNMENT_TOP_RIGHT
A constant indicating the top right alignment. Embedded value is "tr".- See Also:
- Constant Values
-
ALIGNMENT_LEFT
public const System.String ALIGNMENT_LEFT
A constant indicating the left alignment. Embedded value is "l".- See Also:
- Constant Values
-
ALIGNMENT_CENTER
public const System.String ALIGNMENT_CENTER
A constant indicating the center alignment. Embedded value is "ctr".- See Also:
- Constant Values
-
ALIGNMENT_RIGHT
public const System.String ALIGNMENT_RIGHT
A constant indicating the right alignment. Embedded value is "r".- See Also:
- Constant Values
-
ALIGNMENT_BOTTOM_LEFT
public const System.String ALIGNMENT_BOTTOM_LEFT
A constant indicating the bottom left alignment. Embedded value is "bl".- See Also:
- Constant Values
-
ALIGNMENT_BOTTOM
public const System.String ALIGNMENT_BOTTOM
A constant indicating the bottom alignment. Embedded value is "b".- See Also:
- Constant Values
-
ALIGNMENT_BOTTOM_RIGHT
public const System.String ALIGNMENT_BOTTOM_RIGHT
A constant indicating the bottom right alignment. Embedded value is "br".- See Also:
- Constant Values
-
-
Method Detail
-
getShadowType
public int getShadowType()
Returns the shadow type of the shape. Possible values are available inShadowFormat
class.- Returns:
- the shadow type of the shape
- See Also:
setShadow(int)
,setNoShadow(bool)
,setOuterShadow(int, float, float, float, float, System.String)
,setInnerShadow(int, float, float, float)
,setPerspectiveShadow(int, float, float, float, float, System.String, bool)
-
HasShadow
public bool HasShadow()
Returns true if the shape has shadow, false otherwise.- Returns:
- true if the shape has shadow, false otherwise
- See Also:
setShadow(int)
,setNoShadow(bool)
,setOuterShadow(int, float, float, float, float, System.String)
,setInnerShadow(int, float, float, float)
,setPerspectiveShadow(int, float, float, float, float, System.String, bool)
-
setNoShadow
public void setNoShadow(bool hasShadow)
Sets the no shadow option of the shape.- Parameters:
hasShadow
- whether no shadow option is set- See Also:
setOuterShadow(int, float, float, float, float, System.String)
,setInnerShadow(int, float, float, float)
,setPerspectiveShadow(int, float, float, float, float, System.String, bool)
,setShadow(int)
-
setOuterShadow
public void setOuterShadow(int transparency, float size, float blur, float angle, float distance, System.String alignment)
Sets the outer shadow option of the shape. Possible values are available inShadowFormat
class.- Parameters:
transparency
- the transparency option of the shapesize
- the size option of the shapeblur
- the blur option of the shapeangle
- the angle option of the shapedistance
- the distance option of the shapealignment
- the alignment option of the shape. Possible values are available inShadowFormat
class.- See Also:
getShadowType()
,setShadow(int)
,setNoShadow(bool)
,setInnerShadow(int, float, float, float)
,setPerspectiveShadow(int, float, float, float, float, System.String, bool)
-
setInnerShadow
public void setInnerShadow(int transparency, float blur, float angle, float distance)
Sets the inner shadow option of the shape.- Parameters:
transparency
- the transparency option of the shapeblur
- the blur option of the shapeangle
- the angle option of the shapedistance
- the distance option of the shape- See Also:
getShadowType()
,setShadow(int)
,setNoShadow(bool)
,setOuterShadow(int, float, float, float, float, System.String)
,setPerspectiveShadow(int, float, float, float, float, System.String, bool)
-
setPerspectiveShadow
public void setPerspectiveShadow(int transparency, float size, float blur, float angle, float distance, System.String alignment, bool isLower)
Sets the perspective shadow option of the shape. Possible values are available inShadowFormat
class.- Parameters:
transparency
- the transparency option of the shapesize
- the size option of the shapeblur
- the blur option of the shapeangle
- the angle option of the shapedistance
- the distance option of the shapealignment
- the alignment option of the shape. Possible values are available inShadowFormat
class.isLower
- a lower shadow displayed in front of the shape- See Also:
getShadowType()
,setShadow(int)
,setNoShadow(bool)
,setOuterShadow(int, float, float, float, float, System.String)
,setInnerShadow(int, float, float, float)
-
IsLowerPerspective
public bool IsLowerPerspective()
Returns true if it is a perspective shadow displayed in front of the shape, false otherwise.- Returns:
- true if it is a perspective shadow displayed in front of the shape, false otherwise
- See Also:
setPerspectiveShadow(int, float, float, float, float, System.String, bool)
-
setShadow
public void setShadow(int presetShadows)
Sets the shadow of the shape. Possible values are available inShadowFormat
class.- Parameters:
presetShadows
- the built-in shadow of the shape- See Also:
HasShadow()
,setNoShadow(bool)
,setOuterShadow(int, float, float, float, float, System.String)
,setInnerShadow(int, float, float, float)
,setPerspectiveShadow(int, float, float, float, float, System.String, bool)
-
getColor
public System.Drawing.Color getColor()
Returns the shadow color- Returns:
- the shadow color
- See Also:
setColor(Color)
-
setColor
public void setColor(System.Drawing.Color color)
Sets the shadow color.- Parameters:
color
- the shadow color- See Also:
getColor()
-
getThemeColor
public ThemeColor getThemeColor()
Returns the shadow color- Returns:
- the shadow color
- See Also:
setColor(ThemeColor)
-
setColor
public void setColor(ThemeColor themeColor)
Sets the shadow color.- Parameters:
themeColor
- the shadow color- See Also:
getThemeColor()
-
getTransparency
public int getTransparency()
Returns the transparency of the shadow.- Returns:
- the transparency of the shadow
- See Also:
setTransparency(int)
,getSize()
,getBlur()
,getAngle()
,getDistance()
-
setTransparency
public void setTransparency(int transparency)
Sets the transparency of the shadow.- Parameters:
transparency
- the transparency of the shadow- See Also:
getTransparency()
,setSize(float)
,setBlur(float)
,setAngle(float)
,setDistance(float)
-
getSize
public float getSize()
Returns the size of the shadow.- Returns:
- the size of the shadow
- See Also:
setSize(float)
,getTransparency()
,getBlur()
,getAngle()
,getDistance()
-
setSize
public void setSize(float size)
Sets the size of the shadow.- Parameters:
size
- the size of the shadow- See Also:
getSize()
,setTransparency(int)
,setBlur(float)
,setAngle(float)
,setDistance(float)
-
getBlur
public float getBlur()
Returns the blur of the shadow.- Returns:
- the blur of the shadow
- See Also:
setBlur(float)
,getTransparency()
,getSize()
,getAngle()
,getDistance()
-
setBlur
public void setBlur(float blur)
Sets the blur of the shadow.- Parameters:
blur
- the blur of the shadow- See Also:
getBlur()
,setTransparency(int)
,setSize(float)
,setAngle(float)
,setDistance(float)
-
getAngle
public float getAngle()
Returns the angle of the shadow.- Returns:
- the angle of the shadow
- See Also:
setAngle(float)
,getTransparency()
,getBlur()
,getSize()
,getDistance()
-
setAngle
public void setAngle(float angle)
Sets the angle of the shadow.- Parameters:
angle
- the angle of the shadow- See Also:
getAngle()
,setTransparency(int)
,getBlur()
,setSize(float)
,setDistance(float)
-
getDistance
public float getDistance()
Returns the distance of the shadow.- Returns:
- the distance of the shadow
- See Also:
setDistance(float)
,getTransparency()
,getBlur()
,getSize()
,getAngle()
-
setDistance
public void setDistance(float distance)
Sets the distance of the shadow.- Parameters:
distance
- the distance of the shadow- See Also:
getDistance()
,setTransparency(int)
,setBlur(float)
,setSize(float)
,setAngle(float)
-
getAlignment
public System.String getAlignment()
Returns the alignment of the shadow. Possible values are available inShadowFormat
class.- Returns:
- the alignment of the shadow
-
Clone
public ShadowFormat Clone()
Creates and returns a copy of this object.- Returns:
- a clone of this instance.
-
-