Class Shadow
- javafx.scene.effect.Effect
-
- javafx.scene.effect.Shadow
public class Shadow extends Effect
DropShadow effect is a utility effect which automatically combines this Shadow effect with an original graphic for ease of adding a shadow to an existing scene graph Node with a single effect.Since:
JavaFX 2.0
-
Property Summary
All MethodsInstance MethodsConcrete Methods Type Property and Description ObjectProperty<BlurType>blurTypeThe algorithm used to blur the shadow.ObjectProperty<Color>colorThe shadowColor.DoublePropertyheightThe vertical size of the shadow blur kernel.ObjectProperty<Effect>inputThe input for thisEffect.DoublePropertyradiusThe radius of the shadow blur kernel.DoublePropertywidthThe horizontal size of the shadow blur kernel.
-
Constructor Summary
Constructors Constructor and Description Shadow()Creates a new instance of Shadow with default parameters.Shadow(BlurType blurType, Color color, double radius)Creates a new instance of Shadow with the specified blurType, color, radius.Shadow(double radius, Color color)Creates a new instance of Shadow with specified radius and color.
-
Method Summary
All MethodsInstance MethodsConcrete Methods Modifier and Type Method and Description ObjectProperty<BlurType>blurTypeProperty()The algorithm used to blur the shadow.ObjectProperty<Color>colorProperty()The shadowColor.BlurTypegetBlurType()Gets the value of the property blurType.ColorgetColor()Gets the value of the property color.doublegetHeight()Gets the value of the property height.EffectgetInput()Gets the value of the property input.doublegetRadius()Gets the value of the property radius.doublegetWidth()Gets the value of the property width.DoublePropertyheightProperty()The vertical size of the shadow blur kernel.ObjectProperty<Effect>inputProperty()The input for thisEffect.DoublePropertyradiusProperty()The radius of the shadow blur kernel.voidsetBlurType(BlurType value)Sets the value of the property blurType.voidsetColor(Color value)Sets the value of the property color.voidsetHeight(double value)Sets the value of the property height.voidsetInput(Effect value)Sets the value of the property input.voidsetRadius(double value)Sets the value of the property radius.voidsetWidth(double value)Sets the value of the property width.DoublePropertywidthProperty()The horizontal size of the shadow blur kernel.
-
Property Detail
-
input
public final ObjectProperty<Effect> inputProperty
The input for thisEffect. If set tonull, or left unspecified, a graphical image of theNodeto which theEffectis attached will be used as the input.Default value:
null
See Also:
-
radius
public final DoubleProperty radiusProperty
The radius of the shadow blur kernel. This attribute controls the distance that the shadow is spread to each side of the source pixels. Setting the radius is equivalent to setting both thewidthandheightattributes to a value of(2 * radius + 1).Min: 0.0 Max: 127.0 Default: 10.0 Identity: 0.0Default value:
10.0
See Also:
-
width
public final DoubleProperty widthProperty
The horizontal size of the shadow blur kernel. This attribute controls the horizontal size of the total area over which the shadow of a single pixel is distributed by the blur algorithm. Values less than1.0are not distributed beyond the original pixel and so have no blurring effect on the shadow.Min: 0.0 Max: 255.0 Default: 21.0 Identity: <1.0Default value:
21.0
See Also:
-
height
public final DoubleProperty heightProperty
The vertical size of the shadow blur kernel. This attribute controls the vertical size of the total area over which the shadow of a single pixel is distributed by the blur algorithm. Values less than1.0are not distributed beyond the original pixel and so have no blurring effect on the shadow.Min: 0.0 Max: 255.0 Default: 21.0 Identity: <1.0Default value:
21.0
See Also:
-
blurType
public final ObjectProperty<BlurType> blurTypeProperty
The algorithm used to blur the shadow.Min: n/a Max: n/a Default: BlurType.THREE_PASS_BOX Identity: n/aDefault value:
THREE_PASS_BOX
See Also:
-
color
public final ObjectProperty<Color> colorProperty
The shadowColor.Min: n/a Max: n/a Default: Color.BLACK Identity: n/aDefault value:
BLACK
See Also:
-
-
Constructor Detail
-
Shadow
public Shadow()
Creates a new instance of Shadow with default parameters.
-
Shadow
public Shadow(double radius, Color color)Creates a new instance of Shadow with specified radius and color.Parameters:
radius- the radius of the shadow blur kernelSince:
JavaFX 2.1
-
Shadow
public Shadow(BlurType blurType, Color color, double radius)Creates a new instance of Shadow with the specified blurType, color, radius.Parameters:
blurType- the algorithm used to blur the shadowSince:
JavaFX 2.1
-
-
Method Detail
-
setInput
public final void setInput(Effect value)
Sets the value of the property input.Property description:
The input for this
Effect. If set tonull, or left unspecified, a graphical image of theNodeto which theEffectis attached will be used as the input.Default value:
null
-
getInput
public final Effect getInput()
Gets the value of the property input.Property description:
The input for this
Effect. If set tonull, or left unspecified, a graphical image of theNodeto which theEffectis attached will be used as the input.Default value:
null
-
inputProperty
public final ObjectProperty<Effect> inputProperty()
The input for thisEffect. If set tonull, or left unspecified, a graphical image of theNodeto which theEffectis attached will be used as the input.Default value:
null
See Also:
-
setRadius
public final void setRadius(double value)
Sets the value of the property radius.Property description:
The radius of the shadow blur kernel. This attribute controls the distance that the shadow is spread to each side of the source pixels. Setting the radius is equivalent to setting both the
widthandheightattributes to a value of(2 * radius + 1).Min: 0.0 Max: 127.0 Default: 10.0 Identity: 0.0Default value:
10.0
-
getRadius
public final double getRadius()
Gets the value of the property radius.Property description:
The radius of the shadow blur kernel. This attribute controls the distance that the shadow is spread to each side of the source pixels. Setting the radius is equivalent to setting both the
widthandheightattributes to a value of(2 * radius + 1).Min: 0.0 Max: 127.0 Default: 10.0 Identity: 0.0Default value:
10.0
-
radiusProperty
public final DoubleProperty radiusProperty()
The radius of the shadow blur kernel. This attribute controls the distance that the shadow is spread to each side of the source pixels. Setting the radius is equivalent to setting both thewidthandheightattributes to a value of(2 * radius + 1).Min: 0.0 Max: 127.0 Default: 10.0 Identity: 0.0Default value:
10.0
See Also:
-
setWidth
public final void setWidth(double value)
Sets the value of the property width.Property description:
The horizontal size of the shadow blur kernel. This attribute controls the horizontal size of the total area over which the shadow of a single pixel is distributed by the blur algorithm. Values less than
1.0are not distributed beyond the original pixel and so have no blurring effect on the shadow.Min: 0.0 Max: 255.0 Default: 21.0 Identity: <1.0Default value:
21.0
-
getWidth
public final double getWidth()
Gets the value of the property width.Property description:
The horizontal size of the shadow blur kernel. This attribute controls the horizontal size of the total area over which the shadow of a single pixel is distributed by the blur algorithm. Values less than
1.0are not distributed beyond the original pixel and so have no blurring effect on the shadow.Min: 0.0 Max: 255.0 Default: 21.0 Identity: <1.0Default value:
21.0
-
widthProperty
public final DoubleProperty widthProperty()
The horizontal size of the shadow blur kernel. This attribute controls the horizontal size of the total area over which the shadow of a single pixel is distributed by the blur algorithm. Values less than1.0are not distributed beyond the original pixel and so have no blurring effect on the shadow.Min: 0.0 Max: 255.0 Default: 21.0 Identity: <1.0Default value:
21.0
See Also:
-
setHeight
public final void setHeight(double value)
Sets the value of the property height.Property description:
The vertical size of the shadow blur kernel. This attribute controls the vertical size of the total area over which the shadow of a single pixel is distributed by the blur algorithm. Values less than
1.0are not distributed beyond the original pixel and so have no blurring effect on the shadow.Min: 0.0 Max: 255.0 Default: 21.0 Identity: <1.0Default value:
21.0
-
getHeight
public final double getHeight()
Gets the value of the property height.Property description:
The vertical size of the shadow blur kernel. This attribute controls the vertical size of the total area over which the shadow of a single pixel is distributed by the blur algorithm. Values less than
1.0are not distributed beyond the original pixel and so have no blurring effect on the shadow.Min: 0.0 Max: 255.0 Default: 21.0 Identity: <1.0Default value:
21.0
-
heightProperty
public final DoubleProperty heightProperty()
The vertical size of the shadow blur kernel. This attribute controls the vertical size of the total area over which the shadow of a single pixel is distributed by the blur algorithm. Values less than1.0are not distributed beyond the original pixel and so have no blurring effect on the shadow.Min: 0.0 Max: 255.0 Default: 21.0 Identity: <1.0Default value:
21.0
See Also:
-
setBlurType
public final void setBlurType(BlurType value)
Sets the value of the property blurType.Property description:
The algorithm used to blur the shadow.
Min: n/a Max: n/a Default: BlurType.THREE_PASS_BOX Identity: n/aDefault value:
THREE_PASS_BOX
-
getBlurType
public final BlurType getBlurType()
Gets the value of the property blurType.Property description:
The algorithm used to blur the shadow.
Min: n/a Max: n/a Default: BlurType.THREE_PASS_BOX Identity: n/aDefault value:
THREE_PASS_BOX
-
blurTypeProperty
public final ObjectProperty<BlurType> blurTypeProperty()
The algorithm used to blur the shadow.Min: n/a Max: n/a Default: BlurType.THREE_PASS_BOX Identity: n/aDefault value:
THREE_PASS_BOX
See Also:
-
setColor
public final void setColor(Color value)
Sets the value of the property color.Property description:
The shadow
Color.Min: n/a Max: n/a Default: Color.BLACK Identity: n/aDefault value:
BLACK
-
getColor
public final Color getColor()
Gets the value of the property color.Property description:
The shadow
Color.Min: n/a Max: n/a Default: Color.BLACK Identity: n/aDefault value:
BLACK
-
colorProperty
public final ObjectProperty<Color> colorProperty()
The shadowColor.Min: n/a Max: n/a Default: Color.BLACK Identity: n/aDefault value:
BLACK
See Also:
-
© 2008, 2025, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from JavaFX API Documentation.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Java, JavaFX and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.