Class BoxBlur
- javafx.scene.effect.Effect
-
- javafx.scene.effect.BoxBlur
public class BoxBlur extends Effect
Example:
BoxBlur boxBlur = new BoxBlur();
boxBlur.setWidth(10);
boxBlur.setHeight(3);
boxBlur.setIterations(3);
Text text = new Text();
text.setText("Blurry Text!");
text.setFill(Color.web("0x3b596d"));
text.setFont(Font.font(null, FontWeight.BOLD, 50));
text.setX(10);
text.setY(50);
text.setEffect(boxBlur); The code above produces the following:
Since:
JavaFX 2.0
-
Property Summary
All MethodsInstance MethodsConcrete Methods Type Property and Description DoublePropertyheightThe vertical dimension of the blur effect.ObjectProperty<Effect>inputThe input for thisEffect.IntegerPropertyiterationsThe number of times to iterate the blur effect to improve its "quality" or "smoothness".DoublePropertywidthThe horizontal dimension of the blur effect.
-
Constructor Summary
Constructors Constructor and Description BoxBlur()Creates a new instance of BoxBlur with default parameters.BoxBlur(double width, double height, int iterations)Creates a new instance of BoxBlur with specified width, height and iterations.
-
Method Summary
All MethodsInstance MethodsConcrete Methods Modifier and Type Method and Description doublegetHeight()Gets the value of the property height.EffectgetInput()Gets the value of the property input.intgetIterations()Gets the value of the property iterations.doublegetWidth()Gets the value of the property width.DoublePropertyheightProperty()The vertical dimension of the blur effect.ObjectProperty<Effect>inputProperty()The input for thisEffect.IntegerPropertyiterationsProperty()The number of times to iterate the blur effect to improve its "quality" or "smoothness".voidsetHeight(double value)Sets the value of the property height.voidsetInput(Effect value)Sets the value of the property input.voidsetIterations(int value)Sets the value of the property iterations.voidsetWidth(double value)Sets the value of the property width.DoublePropertywidthProperty()The horizontal dimension of the blur effect.
-
Property Detail
-
input
public final ObjectProperty<Effect> inputProperty
The input for thisEffect. If set tonull, or left unspecified, a graphical image of theNodeto which theEffectis attached will be used as the input.Default value:
null
See Also:
-
width
public final DoubleProperty widthProperty
The horizontal dimension of the blur effect. The color information for a given pixel will be spread across a Box of the indicated width centered over the pixel. Values less than or equal to 1 will not spread the color data beyond the pixel where it originated from and so will have no effect.Min: 0.0 Max: 255.0 Default: 5.0 Identity: <1.0Default value:
5.0
See Also:
-
height
public final DoubleProperty heightProperty
The vertical dimension of the blur effect. The color information for a given pixel will be spread across a Box of the indicated height centered over the pixel. Values less than or equal to 1 will not spread the color data beyond the pixel where it originated from and so will have no effect.Min: 0.0 Max: 255.0 Default: 5.0 Identity: <1.0Default value:
5.0
See Also:
-
iterations
public final IntegerProperty iterationsProperty
The number of times to iterate the blur effect to improve its "quality" or "smoothness". Iterating the effect 3 times approximates the quality of a Gaussian Blur to within 3%.Min: 0 Max: 3 Default: 1 Identity: 0Default value:
1
See Also:
-
-
Constructor Detail
-
BoxBlur
public BoxBlur()
Creates a new instance of BoxBlur with default parameters.
-
BoxBlur
public BoxBlur(double width, double height, int iterations)Creates a new instance of BoxBlur with specified width, height and iterations.Parameters:
width- the horizontal dimension of the blur effect
-
-
Method Detail
-
setInput
public final void setInput(Effect value)
Sets the value of the property input.Property description:
The input for this
Effect. If set tonull, or left unspecified, a graphical image of theNodeto which theEffectis attached will be used as the input.Default value:
null
-
getInput
public final Effect getInput()
Gets the value of the property input.Property description:
The input for this
Effect. If set tonull, or left unspecified, a graphical image of theNodeto which theEffectis attached will be used as the input.Default value:
null
-
inputProperty
public final ObjectProperty<Effect> inputProperty()
The input for thisEffect. If set tonull, or left unspecified, a graphical image of theNodeto which theEffectis attached will be used as the input.Default value:
null
See Also:
-
setWidth
public final void setWidth(double value)
Sets the value of the property width.Property description:
The horizontal dimension of the blur effect. The color information for a given pixel will be spread across a Box of the indicated width centered over the pixel. Values less than or equal to 1 will not spread the color data beyond the pixel where it originated from and so will have no effect.
Min: 0.0 Max: 255.0 Default: 5.0 Identity: <1.0Default value:
5.0
-
getWidth
public final double getWidth()
Gets the value of the property width.Property description:
The horizontal dimension of the blur effect. The color information for a given pixel will be spread across a Box of the indicated width centered over the pixel. Values less than or equal to 1 will not spread the color data beyond the pixel where it originated from and so will have no effect.
Min: 0.0 Max: 255.0 Default: 5.0 Identity: <1.0Default value:
5.0
-
widthProperty
public final DoubleProperty widthProperty()
The horizontal dimension of the blur effect. The color information for a given pixel will be spread across a Box of the indicated width centered over the pixel. Values less than or equal to 1 will not spread the color data beyond the pixel where it originated from and so will have no effect.Min: 0.0 Max: 255.0 Default: 5.0 Identity: <1.0Default value:
5.0
See Also:
-
setHeight
public final void setHeight(double value)
Sets the value of the property height.Property description:
The vertical dimension of the blur effect. The color information for a given pixel will be spread across a Box of the indicated height centered over the pixel. Values less than or equal to 1 will not spread the color data beyond the pixel where it originated from and so will have no effect.
Min: 0.0 Max: 255.0 Default: 5.0 Identity: <1.0Default value:
5.0
-
getHeight
public final double getHeight()
Gets the value of the property height.Property description:
The vertical dimension of the blur effect. The color information for a given pixel will be spread across a Box of the indicated height centered over the pixel. Values less than or equal to 1 will not spread the color data beyond the pixel where it originated from and so will have no effect.
Min: 0.0 Max: 255.0 Default: 5.0 Identity: <1.0Default value:
5.0
-
heightProperty
public final DoubleProperty heightProperty()
The vertical dimension of the blur effect. The color information for a given pixel will be spread across a Box of the indicated height centered over the pixel. Values less than or equal to 1 will not spread the color data beyond the pixel where it originated from and so will have no effect.Min: 0.0 Max: 255.0 Default: 5.0 Identity: <1.0Default value:
5.0
See Also:
-
setIterations
public final void setIterations(int value)
Sets the value of the property iterations.Property description:
The number of times to iterate the blur effect to improve its "quality" or "smoothness". Iterating the effect 3 times approximates the quality of a Gaussian Blur to within 3%.
Min: 0 Max: 3 Default: 1 Identity: 0Default value:
1
-
getIterations
public final int getIterations()
Gets the value of the property iterations.Property description:
The number of times to iterate the blur effect to improve its "quality" or "smoothness". Iterating the effect 3 times approximates the quality of a Gaussian Blur to within 3%.
Min: 0 Max: 3 Default: 1 Identity: 0Default value:
1
-
iterationsProperty
public final IntegerProperty iterationsProperty()
The number of times to iterate the blur effect to improve its "quality" or "smoothness". Iterating the effect 3 times approximates the quality of a Gaussian Blur to within 3%.Min: 0 Max: 3 Default: 1 Identity: 0Default value:
1
See Also:
-
© 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.