Top Description Fields Constructors Methods
javafx.scene.effect

public Class MotionBlur

extends Effect
Class Inheritance
Imports
javafx.beans.property.DoubleProperty, .DoublePropertyBase, .ObjectProperty, javafx.scene.Node, 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

A motion blur effect using a Gaussian convolution kernel, with a configurable radius and angle.

Example:

MotionBlur motionBlur = new MotionBlur();
motionBlur.setRadius(30);
motionBlur.setAngle(-15.0);

Text text = new Text();
text.setX(20.0);
text.setY(100.0);
text.setText("Motion!");
text.setFill(Color.web("0x3b596d"));
text.setFont(Font.font(null, FontWeight.BOLD, 60));
text.setEffect(motionBlur);

The code above produces the following:

The visual effect of MotionBlur on text

Since
JavaFX 2.0

Field Summary

Modifier and TypeField and Description
private DoubleProperty
angle

The angle of the motion effect, in degrees.

private ObjectProperty<Effect>
input

The input for this Effect.

private DoubleProperty
radius

The radius of the blur kernel.

Constructor Summary

AccessConstructor and Description
public
MotionBlur()

Creates a new instance of MotionBlur with default parameters.

public
MotionBlur(double
the angle of the motion effect, in degrees
angle
,
double
the radius of the blur kernel
radius
)

Creates a new instance of MotionBlur with the specified angle and radius.

Method Summary

Modifier and TypeMethod and Description
public final DoubleProperty
pack-priv boolean
pack-priv Effect
copy()

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

pack-priv MotionBlur
public final double
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 int
public final Effect
public final double
private int
public final ObjectProperty<Effect>
public final DoubleProperty
public final void
setAngle(double value)

public final void
public final void
setRadius(double value)

pack-priv void
Inherited from javafx.scene.effect.Effect:
containsCycleseffectBoundsChangedgetInputBoundsgetKernelSizegetPeergetShadowBoundsmarkDirtysynctransformBounds

Field Detail

angleback to summary
private DoubleProperty angle

The angle of the motion effect, in degrees.

      Min: n/a
      Max: n/a
  Default: 0.0
 Identity: n/a
Default Value
0.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 blur kernel.

      Min:  0.0
      Max: 63.0
  Default: 10.0
 Identity:  0.0
Default Value
10.0

Constructor Detail

MotionBlurback to summary
public MotionBlur()

Creates a new instance of MotionBlur with default parameters.

MotionBlurback to summary
public MotionBlur(double angle, double radius)

Creates a new instance of MotionBlur with the specified angle and radius.

Parameters
angle:double

the angle of the motion effect, in degrees

radius:double

the radius of the blur kernel

Since
JavaFX 2.1

Method Detail

anglePropertyback to summary
public final DoubleProperty angleProperty()
checkChainContainsback to summary
pack-priv boolean checkChainContains(Effect e)

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

Annotations
@Override
copyback to summary
pack-priv Effect copy()

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

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

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

Annotations
@Override
getAngleback to summary
public final double getAngle()
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
getClampedRadiusback to summary
private float getClampedRadius()
getHPadback to summary
private int getHPad()
getInputback to summary
public final Effect getInput()
getRadiusback to summary
public final double getRadius()
getVPadback to summary
private int getVPad()
inputPropertyback to summary
public final ObjectProperty<Effect> inputProperty()
radiusPropertyback to summary
public final DoubleProperty radiusProperty()
setAngleback to summary
public final void setAngle(double value)
setInputback to summary
public final void setInput(Effect value)
setRadiusback to summary
public final void setRadius(double value)
updateback to summary
pack-priv void update()

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

Annotations
@Override