Top Description Fields Constructors Methods
javafx.scene.effect

public Class InnerShadow

extends Effect
Class Inheritance
Imports
javafx.beans.property.DoubleProperty, .DoublePropertyBase, .ObjectProperty, .ObjectPropertyBase, javafx.scene.Node, javafx.scene.paint.Color, com.sun.javafx.util.Utils, com.sun.javafx.effect.EffectDirtyBits, com.sun.javafx.geom.BaseBounds, com.sun.javafx.geom.transform.BaseTransform, com.sun.javafx.scene.BoundsAccessor, com.sun.javafx.tk.Toolkit

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

Field Summary

Modifier and TypeField and Description
private ObjectProperty<BlurType>
blurType

The algorithm used to blur the shadow.

private boolean
private DoubleProperty
choke

The choke of the shadow.

private ObjectProperty<Color>
color

The shadow Color.

private DoubleProperty
height

The vertical size of the shadow blur kernel.

private ObjectProperty<Effect>
input

The input for this Effect.

private DoubleProperty
offsetX

The shadow offset in the x direction, in pixels.

private DoubleProperty
offsetY

The shadow offset in the y direction, in pixels.

private DoubleProperty
radius

The radius of the shadow blur kernel.

private DoubleProperty
width

The horizontal size of the shadow blur kernel.

Constructor Summary

AccessConstructor and Description
public
InnerShadow()

Creates a new instance of InnerShadow with default parameters.

public
InnerShadow(double
the radius of the shadow blur kernel
radius
,
Color
the shadow Color
color
)

Creates a new instance of InnerShadow with specified radius and color.

public
InnerShadow(double
the radius of the shadow blur kernel
radius
,
double
the shadow offset in the x direction
offsetX
,
double
the shadow offset in the y direction
offsetY
,
Color
the shadow Color
color
)

Creates a new instance of InnerShadow with specified radius, offsetX, offsetY and color.

public
InnerShadow(BlurType
the algorithm used to blur the shadow
blurType
,
Color
the shadow Color
color
,
double
the radius of the shadow blur kernel
radius
,
double
the portion of the radius where the contribution of the source material will be 100%
choke
,
double
the shadow offset in the x direction
offsetX
,
double
the shadow offset in the y direction
offsetY
)

Creates a new instance of InnerShadow with the specified blurType, color, radius, spread, offsetX and offsetY.

Method Summary

Modifier and TypeMethod and Description
public final ObjectProperty<BlurType>
pack-priv boolean
public final DoubleProperty
public final ObjectProperty<Color>
pack-priv Effect
copy()

Implements abstract javafx.scene.effect.Effect.copy.

pack-priv InnerShadow
public final BlurType
private BlurType
pack-priv BaseBounds
getBounds(BaseBounds bounds, BaseTransform tx, Node node, BoundsAccessor boundsAccessor)

Implements abstract javafx.scene.effect.Effect.getBounds.

Returns bounds of given node with applied effect.

public final double
public final Color
private Color
public final double
public final Effect
public final double
public final double
public final double
public final double
public final DoubleProperty
public final ObjectProperty<Effect>
public final DoubleProperty
public final DoubleProperty
public final DoubleProperty
public final void
public final void
setChoke(double value)

public final void
setColor(Color value)

public final void
setHeight(double value)

public final void
public final void
setOffsetX(double value)

public final void
setOffsetY(double value)

public final void
setRadius(double value)

public final void
setWidth(double value)

pack-priv void
private void
updateHeight(double value)

private void
updateRadius(double value)

private void
updateWidth(double value)

public final DoubleProperty
Inherited from javafx.scene.effect.Effect:
containsCycleseffectBoundsChangedgetInputBoundsgetKernelSizegetPeergetShadowBoundsmarkDirtysynctransformBounds

Field Detail

blurTypeback to summary
private ObjectProperty<BlurType> 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
changeIsLocalback to summary
private boolean changeIsLocal
chokeback to summary
private DoubleProperty 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 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
colorback to summary
private ObjectProperty<Color> color

The shadow Color.

      Min: n/a
      Max: n/a
  Default: Color.BLACK
 Identity: n/a
Default Value
BLACK
heightback to summary
private DoubleProperty 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 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
inputback to summary
private ObjectProperty<Effect> input

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
offsetXback to summary
private DoubleProperty 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
offsetYback to summary
private DoubleProperty 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
radiusback to summary
private DoubleProperty 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 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
widthback to summary
private DoubleProperty 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 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

Constructor Detail

InnerShadowback to summary
public InnerShadow()

Creates a new instance of InnerShadow with default parameters.

InnerShadowback to summary
public InnerShadow(double radius, Color color)

Creates a new instance of InnerShadow with specified radius and color.

Parameters
radius:double

the radius of the shadow blur kernel

color:Color

the shadow Color

InnerShadowback to summary
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:double

the radius of the shadow blur kernel

offsetX:double

the shadow offset in the x direction

offsetY:double

the shadow offset in the y direction

color:Color

the shadow Color

InnerShadowback to summary
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:BlurType

the algorithm used to blur the shadow

color:Color

the shadow Color

radius:double

the radius of the shadow blur kernel

choke:double

the portion of the radius where the contribution of the source material will be 100%

offsetX:double

the shadow offset in the x direction

offsetY:double

the shadow offset in the y direction

Since
JavaFX 2.1

Method Detail

blurTypePropertyback to summary
public final ObjectProperty<BlurType> blurTypeProperty()
checkChainContainsback to summary
pack-priv boolean checkChainContains(Effect e)

Implements abstract javafx.scene.effect.Effect.checkChainContains.

Annotations
@Override
chokePropertyback to summary
public final DoubleProperty chokeProperty()
colorPropertyback to summary
public final ObjectProperty<Color> colorProperty()
copyback to summary
pack-priv Effect copy()

Implements abstract javafx.scene.effect.Effect.copy.

Annotations
@Override
createPeerback to summary
pack-priv InnerShadow createPeer()

Implements abstract javafx.scene.effect.Effect.createPeer.

Annotations
@Override
getBlurTypeback to summary
public final BlurType getBlurType()
getBlurTypeInternalback to summary
private BlurType getBlurTypeInternal()
getBoundsback to summary
pack-priv BaseBounds getBounds(BaseBounds bounds, BaseTransform tx, Node node, BoundsAccessor boundsAccessor)

Implements abstract javafx.scene.effect.Effect.getBounds.

Doc from javafx.scene.effect.Effect.getBounds.

Returns bounds of given node with applied effect. We *never* pass null in as a bounds. This method will NOT take a null bounds object. The returned value may be the same bounds object passed in, or it may be a new object.

Annotations
@Override
getChokeback to summary
public final double getChoke()
getColorback to summary
public final Color getColor()
getColorInternalback to summary
private Color getColorInternal()
getHeightback to summary
public final double getHeight()
getInputback to summary
public final Effect getInput()
getOffsetXback to summary
public final double getOffsetX()
getOffsetYback to summary
public final double getOffsetY()
getRadiusback to summary
public final double getRadius()
getWidthback to summary
public final double getWidth()
heightPropertyback to summary
public final DoubleProperty heightProperty()
inputPropertyback to summary
public final ObjectProperty<Effect> inputProperty()
offsetXPropertyback to summary
public final DoubleProperty offsetXProperty()
offsetYPropertyback to summary
public final DoubleProperty offsetYProperty()
radiusPropertyback to summary
public final DoubleProperty radiusProperty()
setBlurTypeback to summary
public final void setBlurType(BlurType value)
setChokeback to summary
public final void setChoke(double value)
setColorback to summary
public final void setColor(Color value)
setHeightback to summary
public final void setHeight(double value)
setInputback to summary
public final void setInput(Effect value)
setOffsetXback to summary
public final void setOffsetX(double value)
setOffsetYback to summary
public final void setOffsetY(double value)
setRadiusback to summary
public final void setRadius(double value)
setWidthback to summary
public final void setWidth(double value)
updateback to summary
pack-priv void update()

Implements abstract javafx.scene.effect.Effect.update.

Annotations
@Override
updateHeightback to summary
private void updateHeight(double value)
updateRadiusback to summary
private void updateRadius(double value)
updateWidthback to summary
private void updateWidth(double value)
widthPropertyback to summary
public final DoubleProperty widthProperty()