Spec-Zone.ru › OpenJavaFX 21

Class InnerShadow

java.lang.Object
javafx.scene.effect.Effect
javafx.scene.effect.InnerShadow
public class InnerShadow extends Effect
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:

The visual effect of InnerShadow on
 text

Since:
JavaFX 2.0

Property Summary

Type Property Description
final ObjectProperty<BlurType> blurType
The algorithm used to blur the shadow.
final DoubleProperty choke
The choke of the shadow.
final ObjectProperty<Color> color
The shadow Color.
final DoubleProperty height
The vertical size of the shadow blur kernel.
final ObjectProperty<Effect> input
The input for this Effect.
final DoubleProperty offsetX
The shadow offset in the x direction, in pixels.
final DoubleProperty offsetY
The shadow offset in the y direction, in pixels.
final DoubleProperty radius
The radius of the shadow blur kernel.
final DoubleProperty width
The horizontal size of the shadow blur kernel.

Constructor Summary

Constructor Description
InnerShadow()
Creates 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 Type Method Description
final ObjectProperty<BlurType> blurTypeProperty()
The algorithm used to blur the shadow.
final DoubleProperty chokeProperty()
The choke of the shadow.
final ObjectProperty<Color> colorProperty()
The shadow Color.
final BlurType getBlurType()
Gets the value of the blurType property.
final double getChoke()
Gets the value of the choke property.
final Color getColor()
Gets the value of the color property.
final double getHeight()
Gets the value of the height property.
final Effect getInput()
Gets the value of the input property.
final double getOffsetX()
Gets the value of the offsetX property.
final double getOffsetY()
Gets the value of the offsetY property.
final double getRadius()
Gets the value of the radius property.
final double getWidth()
Gets the value of the width property.
final DoubleProperty heightProperty()
The vertical size of the shadow blur kernel.
final ObjectProperty<Effect> inputProperty()
The input for this Effect.
final DoubleProperty offsetXProperty()
The shadow offset in the x direction, in pixels.
final DoubleProperty offsetYProperty()
The shadow offset in the y direction, in pixels.
final DoubleProperty radiusProperty()
The radius of the shadow blur kernel.
final void setBlurType(BlurType value)
Sets the value of the blurType property.
final void setChoke(double value)
Sets the value of the choke property.
final void setColor(Color value)
Sets the value of the color property.
final void setHeight(double value)
Sets the value of the height property.
final void setInput(Effect value)
Sets the value of the input property.
final void setOffsetX(double value)
Sets the value of the offsetX property.
final void setOffsetY(double value)
Sets the value of the offsetY property.
final void setRadius(double value)
Sets the value of the radius property.
final void setWidth(double value)
Sets the value of the width property.
final DoubleProperty widthProperty()
The horizontal size of the shadow blur kernel.

Methods declared in class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Property Details

input

public final ObjectProperty<Effect> inputProperty
The input for this Effect. If set to null, or left unspecified, a graphical image of the Node to which the Effect is attached will be used as the input.
Default value:
null
See Also:
  • getInput()
  • setInput(Effect)
  • inputProperty()

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 the width and height 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:
  • getRadius()
  • setRadius(double)
  • radiusProperty()

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 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
See Also:
  • getWidth()
  • setWidth(double)
  • widthProperty()

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 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
See Also:
  • getHeight()
  • setHeight(double)
  • heightProperty()

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/a
 
Default value:
THREE_PASS_BOX
See Also:
  • getBlurType()
  • setBlurType(BlurType)
  • blurTypeProperty()

choke

public final DoubleProperty 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 of 0.0 will result in a distribution of the shadow determined entirely by the blur algorithm. A choke of 1.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:
  • getChoke()
  • setChoke(double)
  • chokeProperty()

color

public final ObjectProperty<Color> colorProperty
The shadow Color.
       Min: n/a
       Max: n/a
   Default: Color.BLACK
  Identity: n/a
 
Default value:
BLACK
See Also:
  • getColor()
  • setColor(Color)
  • colorProperty()

offsetX

public final DoubleProperty 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
See Also:
  • getOffsetX()
  • setOffsetX(double)
  • offsetXProperty()

offsetY

public final DoubleProperty 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
See Also:
  • getOffsetY()
  • setOffsetY(double)
  • offsetYProperty()

Constructor Details

InnerShadow

public InnerShadow()
Creates a new instance of InnerShadow with default parameters.

InnerShadow

public InnerShadow(double radius, Color color)
Creates a new instance of InnerShadow with specified radius and color.
Parameters:
radius - the radius of the shadow blur kernel
color - the shadow Color

InnerShadow

public InnerShadow(double radius, double offsetX, double offsetY, Color color)
Creates a new instance of InnerShadow with specified radius, offsetX, offsetY and color.
Parameters:
radius - the radius of the shadow blur kernel
offsetX - the shadow offset in the x direction
offsetY - the shadow offset in the y direction
color - the shadow Color

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 shadow
color - the shadow Color
radius - the radius of the shadow blur kernel
choke - the portion of the radius where the contribution of the source material will be 100%
offsetX - the shadow offset in the x direction
offsetY - the shadow offset in the y direction
Since:
JavaFX 2.1

Method Details

setInput

public final void setInput(Effect value)
Sets the value of the input property.
Property description:
The input for this Effect. If set to null, or left unspecified, a graphical image of the Node to which the Effect is attached will be used as the input.
Default value:
null
Parameters:
value - the value for the input property
See Also:
  • getInput()
  • inputProperty()

getInput

public final Effect getInput()
Gets the value of the input property.
Property description:
The input for this Effect. If set to null, or left unspecified, a graphical image of the Node to which the Effect is attached will be used as the input.
Default value:
null
Returns:
the value of the input property
See Also:
  • setInput(Effect)
  • inputProperty()

inputProperty

public final ObjectProperty<Effect> inputProperty()
The input for this Effect. If set to null, or left unspecified, a graphical image of the Node to which the Effect is attached will be used as the input.
Default value:
null
Returns:
the input property
See Also:
  • getInput()
  • setInput(Effect)

setRadius

public final void setRadius(double value)
Sets the value of the radius 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 and height 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 the radius property
See Also:
  • getRadius()
  • radiusProperty()

getRadius

public final double getRadius()
Gets the value of the radius 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 and height 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:
  • setRadius(double)
  • radiusProperty()

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 the width and height 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:
  • getRadius()
  • setRadius(double)

setWidth

public final void setWidth(double value)
Sets the value of the width 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 the width property
See Also:
  • getWidth()
  • widthProperty()

getWidth

public final double getWidth()
Gets the value of the width 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:
  • setWidth(double)
  • widthProperty()

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 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 width property
See Also:
  • getWidth()
  • setWidth(double)

setHeight

public final void setHeight(double value)
Sets the value of the height 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 the height property
See Also:
  • getHeight()
  • heightProperty()

getHeight

public final double getHeight()
Gets the value of the height 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:
  • setHeight(double)
  • heightProperty()

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 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 height property
See Also:
  • getHeight()
  • setHeight(double)

setBlurType

public final void setBlurType(BlurType value)
Sets the value of the blurType 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 the blurType property
See Also:
  • getBlurType()
  • blurTypeProperty()

getBlurType

public final BlurType getBlurType()
Gets the value of the blurType 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:
  • setBlurType(BlurType)
  • blurTypeProperty()

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/a
 
Default value:
THREE_PASS_BOX
Returns:
the blurType property
See Also:
  • getBlurType()
  • setBlurType(BlurType)

setChoke

public final void setChoke(double value)
Sets the value of the choke 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 of 1.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 the choke property
See Also:
  • getChoke()
  • chokeProperty()

getChoke

public final double getChoke()
Gets the value of the choke 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 of 1.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:
  • setChoke(double)
  • chokeProperty()

chokeProperty

public final DoubleProperty 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 of 0.0 will result in a distribution of the shadow determined entirely by the blur algorithm. A choke of 1.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:
  • getChoke()
  • setChoke(double)

setColor

public final void setColor(Color value)
Sets the value of the color 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 the color property
See Also:
  • getColor()
  • colorProperty()

getColor

public final Color getColor()
Gets the value of the color 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:
  • setColor(Color)
  • colorProperty()

colorProperty

public final ObjectProperty<Color> colorProperty()
The shadow Color.
       Min: n/a
       Max: n/a
   Default: Color.BLACK
  Identity: n/a
 
Default value:
BLACK
Returns:
the color property
See Also:
  • getColor()
  • setColor(Color)

setOffsetX

public final void setOffsetX(double value)
Sets the value of the offsetX 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 the offsetX property
See Also:
  • getOffsetX()
  • offsetXProperty()

getOffsetX

public final double getOffsetX()
Gets the value of the offsetX 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:
  • setOffsetX(double)
  • offsetXProperty()

offsetXProperty

public final DoubleProperty 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:
  • getOffsetX()
  • setOffsetX(double)

setOffsetY

public final void setOffsetY(double value)
Sets the value of the offsetY 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 the offsetY property
See Also:
  • getOffsetY()
  • offsetYProperty()

getOffsetY

public final double getOffsetY()
Gets the value of the offsetY 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:
  • setOffsetY(double)
  • offsetYProperty()

offsetYProperty

public final DoubleProperty 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:
  • getOffsetY()
  • setOffsetY(double)

© 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.

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API