Class ShadowConf
StyleConf
configuration object.
The state of this object can only be updated by using wither like update methods,
like horizontalOffset(double)
, verticalOffset(double)
, blurRadius(double)
...
which return a new instance of this class with the updated state.
The following properties with their respective purpose are available:
- Horizontal Offset
The horizontal shadow offset, if positive the shadow will move to the right, if negative the shadow will move to the left.
- Vertical Offset
The vertical shadow offset, if positive the shadow will move down, if negative the shadow will move up.
- Blur Radius
The blur radius of the shadow, which defines the width of the blur effect. The higher the value, the bigger the blur, so the shadow transition will be stretched over a wider area.
- Spread Radius
The spread radius of the shadow defines how far inwards or outwards (
isInset()
) the shadow begins. This offsets the start of the shadow similarly to the vertical and horizontal offsets, but instead of moving the shadow, it extends the shadow so that it either grows or shrinks in size.
You can imagine a shadow effect as a rectangular box, where the gradients of the shadow start at the edges of said box. The spread radius then defines the scale of the box, so that the shadow either grows or shrinks in size. - Color
The color of the shadow.
- Inset
Whether the shadow is inset or outset. If true, the shadow is inset, otherwise it is outset. Inset shadows go inward, starting from the inner edge of the box (and its border), whereas outset shadows go outward, starting from the outer edge of the box's border.
Note that you can use the none()
method to specify that no shadow should be used,
as the instance returned by that method is a shadow with no offset, no blur, no spread and no color,
effectively making it a representation of the absence of a shadow.
-
Method Summary
Modifier and TypeMethodDescriptionblurRadius
(double shadowBlurRadius) The blur radius of a shadow defines the gap size between the start and end of the shadow gradient.color
(double red, double green, double blue) Use this to define the color of the visible shadow gradient in terms of the red, green and blue components consisting of three double values ranging from 0.0 to 1.0, where 0.0 represents the absence of the color component and 1.0 represents the color component at full strength.color
(double red, double green, double blue, double alpha) Use this to define the color of the visible shadow gradient in terms of the red, green, blue and alpha components consisting of four double values ranging from 0.0 to 1.0, where 0.0 represents the absence of the color component and 1.0 represents the color component at full strength.Use this to define the color of the visible shadow gradient.Updates the color of the shadow using a color string which can be specified in various formats.boolean
int
hashCode()
horizontalOffset
(double horizontalShadowOffset) Use this to offset the shadow position along the X axis.isInset
(boolean shadowInset) TheisInset
parameter determines whether the shadow is inset or outset, in terms of the direction of the shadow gradient either going inward or outward.isOutset
(boolean shadowOutset) Use this to define whether the shadow is outset or inset, which will determine the direction of the shadow gradient.static ShadowConf
none()
offset
(double shadowOffset) Use this to offset the shadow diagonally between the top left corner and the bottom right corner.offset
(double horizontalShadowOffset, double verticalShadowOffset) Use this to offset the shadow position along the X or Y axis using the two suppliedhorizontalShadowOffset
andverticalShadowOffset
doubles.float
spreadRadius
(double shadowSpreadRadius) The spread radius of a shadow is a sort of scale for the shadow box.toString()
verticalOffset
(double verticalShadowOffset) Defines the shadow position along the Y axis in terms of the "vertical shadow offset".
-
Method Details
-
none
-
spreadRadius
public float spreadRadius() -
horizontalOffset
Use this to offset the shadow position along the X axis. If thehorizontalShadowOffset
is positive, the shadow will move to the right, if negative the shadow will move to the left.- Parameters:
horizontalShadowOffset
- The horizontal shadow offset, if positive the shadow will move to the right, if negative the shadow will move to the left.- Returns:
- A new
ShadowConf
with the specified horizontal shadow offset.
-
verticalOffset
Defines the shadow position along the Y axis in terms of the "vertical shadow offset". It will move the shadow up if negative and down if positive.- Parameters:
verticalShadowOffset
- The vertical shadow offset, if positive the shadow will move down, if negative the shadow will move up.- Returns:
- A new
ShadowConf
with the specified vertical shadow offset.
-
offset
Use this to offset the shadow position along the X or Y axis using the two suppliedhorizontalShadowOffset
andverticalShadowOffset
doubles. ThehorizontalShadowOffset
will shift the shadow along the X axis, while theverticalShadowOffset
will shift the shadow along the Y axis.- Parameters:
horizontalShadowOffset
- The horizontal shadow offset, if positive the shadow will move to the right, if negative the shadow will move to the left.verticalShadowOffset
- The vertical shadow offset, if positive the shadow will move down, if negative the shadow will move up.- Returns:
- A new
ShadowConf
with the specified horizontal and vertical shadow offsets.
-
offset
Use this to offset the shadow diagonally between the top left corner and the bottom right corner. This is effectively a diagonal shadow offset as it is applied to both the X and Y axis. (seeoffset(double, double)
for more information)- Parameters:
shadowOffset
- The shadow offset, if positive the shadow will move to the right and down, if negative the shadow will move to the left and up.- Returns:
- A new
ShadowConf
with the specified horizontal and vertical shadow offsets.
-
blurRadius
The blur radius of a shadow defines the gap size between the start and end of the shadow gradient. The higher the value, the bigger the blur, so the shadow transition will extend further inwards or outwards (isInset()
) from the shadow center.- Parameters:
shadowBlurRadius
- The blur radius of the shadow, which defines the width of the blur effect. The higher the value, the bigger the blur, so the shadow transition will be stretched over a wider area.- Returns:
- A new
ShadowConf
with the specified blur radius.
-
spreadRadius
The spread radius of a shadow is a sort of scale for the shadow box. So when the spread radius is large the shadow will both begin and end further away from the shadow center. When the spread radius is small the shadow will be more concentrated around the shadow center.- Parameters:
shadowSpreadRadius
- The spread radius of the shadow, which defines how far the shadow spreads outwards or inwards (isInset()
) from the element. This offsets the start of the shadow similarly to the vertical and horizontal offsets, but instead of moving the shadow, it extends the shadow so that it either grows or shrinks in size.- Returns:
- A new
ShadowConf
with the specified spread radius.
-
color
Use this to define the color of the visible shadow gradient.- Parameters:
shadowColor
- The color of the shadow.- Returns:
- A new
ShadowConf
with the specified color.
-
color
Updates the color of the shadow using a color string which can be specified in various formats. (seeUIFactoryMethods.color(String)
for more information)- Parameters:
shadowColor
- The color of the shadow in the form of a String. The color can be specified in the following formats:- HTML color name - like "red"
- Hexadecimal RGB value - like "#ff0000"
- Hexadecimal RGBA value - like "#ff0000ff"
- RGB value - like "rgb(255, 0, 0)"
- RGBA value - like "rgba(255, 0, 0, 1.0)"
- HSB value - like "hsb(0, 100%, 100%)"
- HSBA value - like "hsba(0, 100%, 100%, 1.0)"
- Returns:
- A new
ShadowConf
with the specified color.
-
color
Use this to define the color of the visible shadow gradient in terms of the red, green and blue components consisting of three double values ranging from 0.0 to 1.0, where 0.0 represents the absence of the color component and 1.0 represents the color component at full strength.- Parameters:
red
- The red component of the shadow color.green
- The green component of the shadow color.blue
- The blue component of the shadow color.- Returns:
- A new
ShadowConf
with the specified color.
-
color
Use this to define the color of the visible shadow gradient in terms of the red, green, blue and alpha components consisting of four double values ranging from 0.0 to 1.0, where 0.0 represents the absence of the color component and 1.0 represents the color component at full strength.- Parameters:
red
- The red component of the shadow color.green
- The green component of the shadow color.blue
- The blue component of the shadow color.alpha
- The alpha component of the shadow color.- Returns:
- A new
ShadowConf
with the specified color.
-
isInset
TheisInset
parameter determines whether the shadow is inset or outset, in terms of the direction of the shadow gradient either going inward or outward. If theisInset
parameter is true, the shadow color will fade away towards the center of the shadow box, whereas if theisInset
parameter is false, the shadow color will fade away towards the outer edge of the shadow box.
This is essentially the inverse of theisOutset(boolean)
method.- Parameters:
shadowInset
- Whether the shadow is inset or outset. If true, the shadow is inset, otherwise it is outset. Inset shadows go inward, starting from the inner edge of the box (and its border), whereas outset shadows go outward, starting from the outer edge of the box's border.- Returns:
- A new
ShadowConf
with the specified inset/outset state.
-
isOutset
Use this to define whether the shadow is outset or inset, which will determine the direction of the shadow gradient. If theisOutset
parameter is true, the shadow gradient color will fade away towards the outer edge of the shadow box. If theisOutset
parameter is false on the other hand, the shadow color fades away towards the center of the shadow box.
This is essentially the inverse of theisInset(boolean)
method.- Parameters:
shadowOutset
- Whether the shadow is outset or inset. If true, the shadow is outset, otherwise it is inset. Outset shadows go outward, starting from the outer edge of the box's border, whereas inset shadows go inward, starting from the inner edge of the box (and its border).- Returns:
- A new
ShadowConf
with the specified outset/inset state.
-
hashCode
public int hashCode() -
equals
-
toString
-
simplified
-