Note that the reflection of a Node with a Reflection
effect installed will not respond to mouse events or the containment
methods on the Node.
Example:
Reflection reflection = new Reflection();
reflection.setFraction(0.7);
Text text = new Text();
text.setX(10.0);
text.setY(50.0);
text.setCache(true);
text.setText("Reflections on JavaFX...");
text.setFill(Color.web("0x3b596d"));
text.setFont(Font.font(null, FontWeight.BOLD, 40));
text.setEffect(reflection);
The code above produces the following:
| Modifier and Type | Field and Description |
|---|---|
| private DoubleProperty | bottomOpacity
The bottom opacity value, which is the opacity of the reflection at its bottom extreme. |
| private DoubleProperty | fraction
The fraction of the input that is visible in the reflection. |
| private ObjectProperty | input
The input for this |
| private DoubleProperty | topOffset
The top offset adjustment, which is the distance between the bottom of the input and the top of the reflection. |
| private DoubleProperty | topOpacity
The top opacity value, which is the opacity of the reflection at its top extreme. |
| Access | Constructor and Description |
|---|---|
| public | |
| public | Reflection(double
the distance between the bottom of the input and the top of the reflection topOffset, double the fraction of the input that is visible in the reflection fraction, double the opacity of the reflection at its top extreme topOpacity, double the opacity of the reflection at its bottom extreme bottomOpacity)Creates a new instance of Reflection with the specified topOffset, fraction, topOpacity and bottomOpacity. |
| Modifier and Type | Method and Description |
|---|---|
| public final DoubleProperty | |
| pack-priv boolean | |
| pack-priv Effect | |
| pack-priv Reflection | |
| public final DoubleProperty | |
| public final double | |
| pack-priv BaseBounds | getBounds(BaseBounds bounds, BaseTransform tx, Node node, BoundsAccessor boundsAccessor)
Implements abstract javafx. Returns bounds of given node with applied effect. |
| private float | |
| private float | |
| private float | |
| public final double | |
| public final Effect | |
| public final double | |
| public final double | |
| public final ObjectProperty | |
| public final void | |
| public final void | |
| public final void | |
| public final void | |
| public final void | |
| public final DoubleProperty | |
| public final DoubleProperty | |
| pack-priv void |
| bottomOpacity | back to summary |
|---|---|
| private DoubleProperty bottomOpacity The bottom opacity value, which is the opacity of the reflection at its bottom extreme.
Min: 0.0
Max: 1.0
Default: 0.0
Identity: 1.0
| |
| fraction | back to summary |
|---|---|
| private DoubleProperty fraction The fraction of the input that is visible in the reflection. For example, a value of 0.5 means that only the bottom half of the input will be visible in the reflection.
Min: 0.0
Max: 1.0
Default: 0.75
Identity: 1.0
| |
| input | back to summary |
|---|---|
| private ObjectProperty<Effect> input The input for this
| |
| topOffset | back to summary |
|---|---|
| private DoubleProperty topOffset The top offset adjustment, which is the distance between the bottom of the input and the top of the reflection.
Min: n/a
Max: n/a
Default: 0.0
Identity: 0.0
| |
| topOpacity | back to summary |
|---|---|
| private DoubleProperty topOpacity The top opacity value, which is the opacity of the reflection at its top extreme.
Min: 0.0
Max: 1.0
Default: 0.5
Identity: 1.0
| |
| Reflection | back to summary |
|---|---|
| public Reflection() Creates a new instance of Reflection with default parameters. | |
| Reflection | back to summary |
|---|---|
| public Reflection(double topOffset, double fraction, double topOpacity, double bottomOpacity) Creates a new instance of Reflection with the specified topOffset, fraction, topOpacity and bottomOpacity.
| |
| bottomOpacityProperty | back to summary |
|---|---|
| public final DoubleProperty bottomOpacityProperty() | |
| 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 Reflection createPeer() Implements abstract javafx.
| |
| fractionProperty | back to summary |
|---|---|
| public final DoubleProperty fractionProperty() | |
| getBottomOpacity | back to summary |
|---|---|
| public final double getBottomOpacity() | |
| 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.
| |
| getClampedBottomOpacity | back to summary |
|---|---|
| private float getClampedBottomOpacity() | |
| getClampedFraction | back to summary |
|---|---|
| private float getClampedFraction() | |
| getClampedTopOpacity | back to summary |
|---|---|
| private float getClampedTopOpacity() | |
| getFraction | back to summary |
|---|---|
| public final double getFraction() | |
| getInput | back to summary |
|---|---|
| public final Effect getInput() | |
| getTopOffset | back to summary |
|---|---|
| public final double getTopOffset() | |
| getTopOpacity | back to summary |
|---|---|
| public final double getTopOpacity() | |
| inputProperty | back to summary |
|---|---|
| public final ObjectProperty | |
| setBottomOpacity | back to summary |
|---|---|
| public final void setBottomOpacity(double value) | |
| setFraction | back to summary |
|---|---|
| public final void setFraction(double value) | |
| setInput | back to summary |
|---|---|
| public final void setInput(Effect value) | |
| setTopOffset | back to summary |
|---|---|
| public final void setTopOffset(double value) | |
| setTopOpacity | back to summary |
|---|---|
| public final void setTopOpacity(double value) | |
| topOffsetProperty | back to summary |
|---|---|
| public final DoubleProperty topOffsetProperty() | |
| topOpacityProperty | back to summary |
|---|---|
| public final DoubleProperty topOpacityProperty() | |
| update | back to summary |
|---|---|
| pack-priv void update() Implements abstract javafx.
| |