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:
| Modifier and Type | Field and Description |
|---|---|
| private DoubleProperty | height
The vertical dimension of the blur effect. |
| private ObjectProperty | input
The input for this |
| private IntegerProperty | iterations
The number of times to iterate the blur effect to improve its "quality" or "smoothness". |
| private DoubleProperty | width
The horizontal dimension of the blur effect. |
| Access | Constructor and Description |
|---|---|
| public | |
| public | BoxBlur(double
the horizontal dimension of the blur effect width, double the vertical dimension of the blur effect height, int the number of times to iterate the blur effect to
improve its "quality" or "smoothness" iterations)Creates a new instance of BoxBlur with specified width, height and iterations. |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv boolean | |
| pack-priv Effect | |
| pack-priv BoxBlur | |
| pack-priv BaseBounds | getBounds(BaseBounds bounds, BaseTransform tx, Node node, BoundsAccessor boundsAccessor)
Implements abstract javafx. Returns bounds of given node with applied effect. |
| private int | |
| private int | |
| private int | |
| public final double | |
| public final Effect | |
| public final int | |
| public final double | |
| public final DoubleProperty | |
| public final ObjectProperty | |
| public final IntegerProperty | |
| public final void | |
| public final void | |
| public final void | |
| public final void | |
| pack-priv void | |
| public final DoubleProperty |
| height | back to summary |
|---|---|
| private DoubleProperty height 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.0
| |
| input | back to summary |
|---|---|
| private ObjectProperty<Effect> input The input for this
| |
| iterations | back to summary |
|---|---|
| private IntegerProperty iterations 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: 0
| |
| width | back to summary |
|---|---|
| private DoubleProperty width 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.0
| |
| BoxBlur | back to summary |
|---|---|
| public BoxBlur() Creates a new instance of BoxBlur with default parameters. | |
| BoxBlur | back to summary |
|---|---|
| public BoxBlur(double width, double height, int iterations) Creates a new instance of BoxBlur with specified width, height and iterations.
| |
| checkChainContains | back to summary |
|---|---|
| pack-priv boolean checkChainContains(Effect e) Implements abstract javafx.
| |
| copy | back to summary |
|---|---|
| pack-priv Effect copy() Implements abstract javafx.
| |
| createPeer | back to summary |
|---|---|
| pack-priv BoxBlur createPeer() Implements abstract javafx.
| |
| getBounds | back to summary |
|---|---|
| pack-priv BaseBounds getBounds(BaseBounds bounds, BaseTransform tx, Node node, BoundsAccessor boundsAccessor) Implements abstract javafx. Doc from javafx. 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.
| |
| getClampedHeight | back to summary |
|---|---|
| private int getClampedHeight() | |
| getClampedIterations | back to summary |
|---|---|
| private int getClampedIterations() | |
| getClampedWidth | back to summary |
|---|---|
| private int getClampedWidth() | |
| getHeight | back to summary |
|---|---|
| public final double getHeight() | |
| getInput | back to summary |
|---|---|
| public final Effect getInput() | |
| getIterations | back to summary |
|---|---|
| public final int getIterations() | |
| getWidth | back to summary |
|---|---|
| public final double getWidth() | |
| heightProperty | back to summary |
|---|---|
| public final DoubleProperty heightProperty() | |
| inputProperty | back to summary |
|---|---|
| public final ObjectProperty | |
| iterationsProperty | back to summary |
|---|---|
| public final IntegerProperty iterationsProperty() | |
| setHeight | back to summary |
|---|---|
| public final void setHeight(double value) | |
| setInput | back to summary |
|---|---|
| public final void setInput(Effect value) | |
| setIterations | back to summary |
|---|---|
| public final void setIterations(int value) | |
| setWidth | back to summary |
|---|---|
| public final void setWidth(double value) | |
| update | back to summary |
|---|---|
| pack-priv void update() Implements abstract javafx.
| |
| widthProperty | back to summary |
|---|---|
| public final DoubleProperty widthProperty() | |