APIdia Launch Partner
Top Description Fields Constructors Methods
javafx.scene.effect

public Class Shadow

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

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

Field Summary

Modifier and TypeField and Description
private ObjectProperty<BlurType>
blurType

The algorithm used to blur the shadow.

private boolean
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
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
Shadow()

Creates a new instance of Shadow with default parameters.

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

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

public
Shadow(BlurType
the algorithm used to blur the shadow
blurType
,
Color
the shadow Color
color
,
double
the radius of the shadow blur kernel
radius
)

Creates a new instance of Shadow with the specified blurType, color, radius.

Method Summary

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

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

pack-priv GeneralShadow
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.

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

public final void
setHeight(double value)

public final void
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
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
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

Shadowback to summary
public Shadow()

Creates a new instance of Shadow with default parameters.

Shadowback to summary
public Shadow(double radius, Color color)

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

Parameters
radius:double

the radius of the shadow blur kernel

color:Color

the shadow Color

Since
JavaFX 2.1
Shadowback to summary
public Shadow(BlurType blurType, Color color, double radius)

Creates a new instance of Shadow with the specified blurType, color, radius.

Parameters
blurType:BlurType

the algorithm used to blur the shadow

color:Color

the shadow Color

radius:double

the radius of the shadow blur kernel

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
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 GeneralShadow 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
getClampedHeightback to summary
private float getClampedHeight()
getClampedWidthback to summary
private float getClampedWidth()
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()
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()
radiusPropertyback to summary
public final DoubleProperty radiusProperty()
setBlurTypeback to summary
public final void setBlurType(BlurType 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)
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()