Class MotionBlur
java.lang.Object
javafx.scene.effect.Effect
javafx.scene.effect.MotionBlur
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:
- Since:
- JavaFX 2.0
-
Property Summary
TypePropertyDescriptionfinal DoubleProperty
The angle of the motion effect, in degrees.final ObjectProperty
<Effect> The input for thisEffect
.final DoubleProperty
The radius of the blur kernel. -
Constructor Summary
ConstructorDescriptionCreates a new instance of MotionBlur with default parameters.MotionBlur
(double angle, double radius) Creates a new instance of MotionBlur with the specified angle and radius. -
Method Summary
Modifier and TypeMethodDescriptionfinal DoubleProperty
The angle of the motion effect, in degrees.final double
getAngle()
Gets the value of theangle
property.final Effect
getInput()
Gets the value of theinput
property.final double
Gets the value of theradius
property.final ObjectProperty
<Effect> The input for thisEffect
.final DoubleProperty
The radius of the blur kernel.final void
setAngle
(double value) Sets the value of theangle
property.final void
Sets the value of theinput
property.final void
setRadius
(double value) Sets the value of theradius
property.
-
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 blur kernel.Min: 0.0 Max: 63.0 Default: 10.0 Identity: 0.0
- Default value:
- 10.0
- See Also:
-
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
- See Also:
-
-
Constructor Details
-
MotionBlur
public MotionBlur()Creates a new instance of MotionBlur with default parameters. -
MotionBlur
public MotionBlur(double angle, double radius) Creates a new instance of MotionBlur with the specified angle and radius.- Parameters:
angle
- the angle of the motion effect, in degreesradius
- the radius of the blur kernel- 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 blur kernel.
Min: 0.0 Max: 63.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 blur kernel.
Min: 0.0 Max: 63.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 blur kernel.Min: 0.0 Max: 63.0 Default: 10.0 Identity: 0.0
- Default value:
- 10.0
- Returns:
- the
radius
property - See Also:
-
setAngle
public final void setAngle(double value) Sets the value of theangle
property.- Property description:
- The angle of the motion effect, in degrees.
Min: n/a Max: n/a Default: 0.0 Identity: n/a
- Default value:
- 0.0
- Parameters:
value
- the value for theangle
property- See Also:
-
getAngle
public final double getAngle()Gets the value of theangle
property.- Property description:
- The angle of the motion effect, in degrees.
Min: n/a Max: n/a Default: 0.0 Identity: n/a
- Default value:
- 0.0
- Returns:
- the value of the
angle
property - See Also:
-
angleProperty
The angle of the motion effect, in degrees.Min: n/a Max: n/a Default: 0.0 Identity: n/a
- Default value:
- 0.0
- Returns:
- the
angle
property - See Also:
-