java.lang.Object
javafx.scene.effect.Effect
javafx.scene.effect.Shadow
An effect which creates a monochrome duplicate of an input with
blurry edges.
This effect is primarily used along with its default black color for
purposes of combining it with the original to create a shadow.
It can also be used with a light color and combined with an original
to create a glow effect.
The
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
PropertiesTypePropertyDescriptionfinal ObjectProperty<BlurType>The algorithm used to blur the shadow.final ObjectProperty<Color>The shadowColor.final DoublePropertyThe vertical size of the shadow blur kernel.final ObjectProperty<Effect>The input for thisEffect.final DoublePropertyThe radius of the shadow blur kernel.final DoublePropertyThe horizontal size of the shadow blur kernel. -
Constructor Summary
ConstructorsConstructorDescriptionShadow()Creates a new instance of Shadow with default parameters.Creates a new instance of Shadow with specified radius and color.Creates a new instance of Shadow with the specified blurType, color, radius. -
Method Summary
Modifier and TypeMethodDescriptionfinal ObjectProperty<BlurType>The algorithm used to blur the shadow.final ObjectProperty<Color>The shadowColor.final BlurTypeGets the value of the property blurType.final ColorgetColor()Gets the value of the property color.final doubleGets the value of the property height.final EffectgetInput()Gets the value of the property input.final doubleGets the value of the property radius.final doublegetWidth()Gets the value of the property width.final DoublePropertyThe vertical size of the shadow blur kernel.final ObjectProperty<Effect>The input for thisEffect.final DoublePropertyThe radius of the shadow blur kernel.final voidsetBlurType(BlurType value) Sets the value of the property blurType.final voidSets the value of the property color.final voidsetHeight(double value) Sets the value of the property height.final voidSets the value of the property input.final voidsetRadius(double value) Sets the value of the property radius.final voidsetWidth(double value) Sets the value of the property width.final DoublePropertyThe horizontal size of the shadow blur kernel.
-
Property Details
-
input
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
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.0- Default value:
- 10.0
- See Also:
-
width
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.0- Default value:
- 21.0
- See Also:
-
height
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.0- Default value:
- 21.0
- See Also:
-
blurType
The algorithm used to blur the shadow.Min: n/a Max: n/a Default: BlurType.THREE_PASS_BOX Identity: n/a- Default value:
- THREE_PASS_BOX
- See Also:
-
color
The shadowColor.Min: n/a Max: n/a Default: Color.BLACK Identity: n/a- Default value:
- BLACK
- See Also:
-
-
Constructor Details
-
Shadow
public Shadow()Creates a new instance of Shadow with default parameters. -
Shadow
Creates a new instance of Shadow with specified radius and color.- Parameters:
radius- the radius of the shadow blur kernelcolor- the shadowColor- Since:
- JavaFX 2.1
-
Shadow
Creates a new instance of Shadow with the specified blurType, color, radius.- Parameters:
blurType- the algorithm used to blur the shadowcolor- the shadowColorradius- the radius of the shadow blur kernel- Since:
- JavaFX 2.1
-
-
Method Details
-
setInput
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
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
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.0 - Default 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.0 - Default value:
- 10.0
-
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.0- Default 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.0 - Default 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.0 - Default value:
- 21.0
-
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.0- Default 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.0 - Default 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.0 - Default value:
- 21.0
-
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.0- Default value:
- 21.0
- See Also:
-
setBlurType
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/a - Default value:
- THREE_PASS_BOX
-
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/a - Default value:
- THREE_PASS_BOX
-
blurTypeProperty
The algorithm used to blur the shadow.Min: n/a Max: n/a Default: BlurType.THREE_PASS_BOX Identity: n/a- Default value:
- THREE_PASS_BOX
- See Also:
-
setColor
Sets the value of the property color.- Property description:
- The shadow
Color.Min: n/a Max: n/a Default: Color.BLACK Identity: n/a - Default value:
- BLACK
-
getColor
Gets the value of the property color.- Property description:
- The shadow
Color.Min: n/a Max: n/a Default: Color.BLACK Identity: n/a - Default value:
- BLACK
-
colorProperty
The shadowColor.Min: n/a Max: n/a Default: Color.BLACK Identity: n/a- Default value:
- BLACK
- See Also:
-