Class InnerShadow
java.lang.Object
javafx.scene.effect.Effect
javafx.scene.effect.InnerShadow
A high-level effect that renders a shadow inside the edges of the
given content with the specified color, radius, and offset.
Example:
InnerShadow innerShadow = new InnerShadow();
innerShadow.setOffsetX(4);
innerShadow.setOffsetY(4);
innerShadow.setColor(Color.web("0x3b596d"));
Text text = new Text();
text.setEffect(innerShadow);
text.setX(20);
text.setY(100);
text.setText("InnerShadow");
text.setFill(Color.ALICEBLUE);
text.setFont(Font.font(null, FontWeight.BOLD, 50));
The code above produces the following:
- Since:
- JavaFX 2.0
-
Property Summary
TypePropertyDescriptionfinal ObjectProperty
<BlurType> The algorithm used to blur the shadow.final DoubleProperty
The choke of the shadow.final ObjectProperty
<Color> The shadowColor
.final DoubleProperty
The vertical size of the shadow blur kernel.final ObjectProperty
<Effect> The input for thisEffect
.final DoubleProperty
The shadow offset in the x direction, in pixels.final DoubleProperty
The shadow offset in the y direction, in pixels.final DoubleProperty
The radius of the shadow blur kernel.final DoubleProperty
The horizontal size of the shadow blur kernel. -
Constructor Summary
ConstructorDescriptionCreates a new instance of InnerShadow with default parameters.InnerShadow
(double radius, double offsetX, double offsetY, Color color) Creates a new instance of InnerShadow with specified radius, offsetX, offsetY and color.InnerShadow
(double radius, Color color) Creates a new instance of InnerShadow with specified radius and color.InnerShadow
(BlurType blurType, Color color, double radius, double choke, double offsetX, double offsetY) Creates a new instance of InnerShadow with the specified blurType, color, radius, spread, offsetX and offsetY. -
Method Summary
Modifier and TypeMethodDescriptionfinal ObjectProperty
<BlurType> The algorithm used to blur the shadow.final DoubleProperty
The choke of the shadow.final ObjectProperty
<Color> The shadowColor
.final BlurType
Gets the value of theblurType
property.final double
getChoke()
Gets the value of thechoke
property.final Color
getColor()
Gets the value of thecolor
property.final double
Gets the value of theheight
property.final Effect
getInput()
Gets the value of theinput
property.final double
Gets the value of theoffsetX
property.final double
Gets the value of theoffsetY
property.final double
Gets the value of theradius
property.final double
getWidth()
Gets the value of thewidth
property.final DoubleProperty
The vertical size of the shadow blur kernel.final ObjectProperty
<Effect> The input for thisEffect
.final DoubleProperty
The shadow offset in the x direction, in pixels.final DoubleProperty
The shadow offset in the y direction, in pixels.final DoubleProperty
The radius of the shadow blur kernel.final void
setBlurType
(BlurType value) Sets the value of theblurType
property.final void
setChoke
(double value) Sets the value of thechoke
property.final void
Sets the value of thecolor
property.final void
setHeight
(double value) Sets the value of theheight
property.final void
Sets the value of theinput
property.final void
setOffsetX
(double value) Sets the value of theoffsetX
property.final void
setOffsetY
(double value) Sets the value of theoffsetY
property.final void
setRadius
(double value) Sets the value of theradius
property.final void
setWidth
(double value) Sets the value of thewidth
property.final DoubleProperty
The horizontal size of the shadow blur kernel.
-
Property Details
-
input
The input for thisEffect
. If set tonull
, or left unspecified, a graphical image of theNode
to which theEffect
is 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 thewidth
andheight
attributes 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.0
are 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.0
are 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:
-
choke
The choke of the shadow. The choke is the portion of the radius where the contribution of the source material will be 100%. The remaining portion of the radius will have a contribution controlled by the blur kernel. A choke of0.0
will result in a distribution of the shadow determined entirely by the blur algorithm. A choke of1.0
will result in a solid growth inward of the shadow from the edges to the limit of the radius with a very sharp cutoff to transparency inside the radius.Min: 0.0 Max: 1.0 Default: 0.0 Identity: 0.0
- Default value:
- 0.0
- See Also:
-
color
The shadowColor
.Min: n/a Max: n/a Default: Color.BLACK Identity: n/a
- Default value:
- BLACK
- See Also:
-
offsetX
The shadow offset in the x direction, in pixels.Min: n/a Max: n/a Default: 0.0 Identity: 0.0
- Default value:
- 0.0
- See Also:
-
offsetY
The shadow offset in the y direction, in pixels.Min: n/a Max: n/a Default: 0.0 Identity: 0.0
- Default value:
- 0.0
- See Also:
-
-
Constructor Details
-
InnerShadow
public InnerShadow()Creates a new instance of InnerShadow with default parameters. -
InnerShadow
Creates a new instance of InnerShadow with specified radius and color.- Parameters:
radius
- the radius of the shadow blur kernelcolor
- the shadowColor
-
InnerShadow
Creates a new instance of InnerShadow with specified radius, offsetX, offsetY and color.- Parameters:
radius
- the radius of the shadow blur kerneloffsetX
- the shadow offset in the x directionoffsetY
- the shadow offset in the y directioncolor
- the shadowColor
-
InnerShadow
public InnerShadow(BlurType blurType, Color color, double radius, double choke, double offsetX, double offsetY) Creates a new instance of InnerShadow with the specified blurType, color, radius, spread, offsetX and offsetY.- Parameters:
blurType
- the algorithm used to blur the shadowcolor
- the shadowColor
radius
- the radius of the shadow blur kernelchoke
- the portion of the radius where the contribution of the source material will be 100%offsetX
- the shadow offset in the x directionoffsetY
- the shadow offset in the y direction- Since:
- JavaFX 2.1
-
-
Method Details
-
setInput
Sets the value of theinput
property.- Property description:
- The input for this
Effect
. If set tonull
, or left unspecified, a graphical image of theNode
to which theEffect
is attached will be used as the input. - Default value:
- null
- Parameters:
value
- the value for theinput
property- See Also:
-
getInput
Gets the value of theinput
property.- Property description:
- The input for this
Effect
. If set tonull
, or left unspecified, a graphical image of theNode
to which theEffect
is attached will be used as the input. - Default value:
- null
- Returns:
- the value of the
input
property - See Also:
-
inputProperty
The input for thisEffect
. If set tonull
, or left unspecified, a graphical image of theNode
to which theEffect
is attached will be used as the input.- Default value:
- null
- Returns:
- the
input
property - See Also:
-
setRadius
public final void setRadius(double value) Sets the value of theradius
property.- 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
width
andheight
attributes to a value of(2 * radius + 1)
.Min: 0.0 Max: 127.0 Default: 10.0 Identity: 0.0
- Default value:
- 10.0
- Parameters:
value
- the value for theradius
property- See Also:
-
getRadius
public final double getRadius()Gets the value of theradius
property.- 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
width
andheight
attributes to a value of(2 * radius + 1)
.Min: 0.0 Max: 127.0 Default: 10.0 Identity: 0.0
- Default value:
- 10.0
- Returns:
- the value of the
radius
property - See Also:
-
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 thewidth
andheight
attributes to a value of(2 * radius + 1)
.Min: 0.0 Max: 127.0 Default: 10.0 Identity: 0.0
- Default value:
- 10.0
- Returns:
- the
radius
property - See Also:
-
setWidth
public final void setWidth(double value) Sets the value of thewidth
property.- 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.0
are 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
- Parameters:
value
- the value for thewidth
property- See Also:
-
getWidth
public final double getWidth()Gets the value of thewidth
property.- 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.0
are 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
- Returns:
- the value of the
width
property - See Also:
-
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.0
are 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
- Returns:
- the
width
property - See Also:
-
setHeight
public final void setHeight(double value) Sets the value of theheight
property.- 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.0
are 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
- Parameters:
value
- the value for theheight
property- See Also:
-
getHeight
public final double getHeight()Gets the value of theheight
property.- 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.0
are 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
- Returns:
- the value of the
height
property - See Also:
-
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.0
are 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
- Returns:
- the
height
property - See Also:
-
setBlurType
Sets the value of theblurType
property.- 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
- Parameters:
value
- the value for theblurType
property- See Also:
-
getBlurType
Gets the value of theblurType
property.- 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
- Returns:
- the value of the
blurType
property - See Also:
-
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
- Returns:
- the
blurType
property - See Also:
-
setChoke
public final void setChoke(double value) Sets the value of thechoke
property.- Property description:
- The choke of the shadow.
The choke is the portion of the radius where the contribution of
the source material will be 100%.
The remaining portion of the radius will have a contribution
controlled by the blur kernel.
A choke of
0.0
will result in a distribution of the shadow determined entirely by the blur algorithm. A choke of1.0
will result in a solid growth inward of the shadow from the edges to the limit of the radius with a very sharp cutoff to transparency inside the radius.Min: 0.0 Max: 1.0 Default: 0.0 Identity: 0.0
- Default value:
- 0.0
- Parameters:
value
- the value for thechoke
property- See Also:
-
getChoke
public final double getChoke()Gets the value of thechoke
property.- Property description:
- The choke of the shadow.
The choke is the portion of the radius where the contribution of
the source material will be 100%.
The remaining portion of the radius will have a contribution
controlled by the blur kernel.
A choke of
0.0
will result in a distribution of the shadow determined entirely by the blur algorithm. A choke of1.0
will result in a solid growth inward of the shadow from the edges to the limit of the radius with a very sharp cutoff to transparency inside the radius.Min: 0.0 Max: 1.0 Default: 0.0 Identity: 0.0
- Default value:
- 0.0
- Returns:
- the value of the
choke
property - See Also:
-
chokeProperty
The choke of the shadow. The choke is the portion of the radius where the contribution of the source material will be 100%. The remaining portion of the radius will have a contribution controlled by the blur kernel. A choke of0.0
will result in a distribution of the shadow determined entirely by the blur algorithm. A choke of1.0
will result in a solid growth inward of the shadow from the edges to the limit of the radius with a very sharp cutoff to transparency inside the radius.Min: 0.0 Max: 1.0 Default: 0.0 Identity: 0.0
- Default value:
- 0.0
- Returns:
- the
choke
property - See Also:
-
setColor
Sets the value of thecolor
property.- Property description:
- The shadow
Color
.Min: n/a Max: n/a Default: Color.BLACK Identity: n/a
- Default value:
- BLACK
- Parameters:
value
- the value for thecolor
property- See Also:
-
getColor
Gets the value of thecolor
property.- Property description:
- The shadow
Color
.Min: n/a Max: n/a Default: Color.BLACK Identity: n/a
- Default value:
- BLACK
- Returns:
- the value of the
color
property - See Also:
-
colorProperty
The shadowColor
.Min: n/a Max: n/a Default: Color.BLACK Identity: n/a
- Default value:
- BLACK
- Returns:
- the
color
property - See Also:
-
setOffsetX
public final void setOffsetX(double value) Sets the value of theoffsetX
property.- Property description:
- The shadow offset in the x direction, in pixels.
Min: n/a Max: n/a Default: 0.0 Identity: 0.0
- Default value:
- 0.0
- Parameters:
value
- the value for theoffsetX
property- See Also:
-
getOffsetX
public final double getOffsetX()Gets the value of theoffsetX
property.- Property description:
- The shadow offset in the x direction, in pixels.
Min: n/a Max: n/a Default: 0.0 Identity: 0.0
- Default value:
- 0.0
- Returns:
- the value of the
offsetX
property - See Also:
-
offsetXProperty
The shadow offset in the x direction, in pixels.Min: n/a Max: n/a Default: 0.0 Identity: 0.0
- Default value:
- 0.0
- Returns:
- the
offsetX
property - See Also:
-
setOffsetY
public final void setOffsetY(double value) Sets the value of theoffsetY
property.- Property description:
- The shadow offset in the y direction, in pixels.
Min: n/a Max: n/a Default: 0.0 Identity: 0.0
- Default value:
- 0.0
- Parameters:
value
- the value for theoffsetY
property- See Also:
-
getOffsetY
public final double getOffsetY()Gets the value of theoffsetY
property.- Property description:
- The shadow offset in the y direction, in pixels.
Min: n/a Max: n/a Default: 0.0 Identity: 0.0
- Default value:
- 0.0
- Returns:
- the value of the
offsetY
property - See Also:
-
offsetYProperty
The shadow offset in the y direction, in pixels.Min: n/a Max: n/a Default: 0.0 Identity: 0.0
- Default value:
- 0.0
- Returns:
- the
offsetY
property - See Also:
-