Class Reflection
- javafx.scene.effect.Effect
-
- javafx.scene.effect.Reflection
public class Reflection extends Effect
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:
Since:
JavaFX 2.0
-
Property Summary
All MethodsInstance MethodsConcrete Methods Type Property and Description DoublePropertybottomOpacityThe bottom opacity value, which is the opacity of the reflection at its bottom extreme.DoublePropertyfractionThe fraction of the input that is visible in the reflection.ObjectProperty<Effect>inputThe input for thisEffect.DoublePropertytopOffsetThe top offset adjustment, which is the distance between the bottom of the input and the top of the reflection.DoublePropertytopOpacityThe top opacity value, which is the opacity of the reflection at its top extreme.
-
Constructor Summary
Constructors Constructor and Description Reflection()Creates a new instance of Reflection with default parameters.Reflection(double topOffset, double fraction, double topOpacity, double bottomOpacity)Creates a new instance of Reflection with the specified topOffset, fraction, topOpacity and bottomOpacity.
-
Method Summary
All MethodsInstance MethodsConcrete Methods Modifier and Type Method and Description DoublePropertybottomOpacityProperty()The bottom opacity value, which is the opacity of the reflection at its bottom extreme.DoublePropertyfractionProperty()The fraction of the input that is visible in the reflection.doublegetBottomOpacity()Gets the value of the property bottomOpacity.doublegetFraction()Gets the value of the property fraction.EffectgetInput()Gets the value of the property input.doublegetTopOffset()Gets the value of the property topOffset.doublegetTopOpacity()Gets the value of the property topOpacity.ObjectProperty<Effect>inputProperty()The input for thisEffect.voidsetBottomOpacity(double value)Sets the value of the property bottomOpacity.voidsetFraction(double value)Sets the value of the property fraction.voidsetInput(Effect value)Sets the value of the property input.voidsetTopOffset(double value)Sets the value of the property topOffset.voidsetTopOpacity(double value)Sets the value of the property topOpacity.DoublePropertytopOffsetProperty()The top offset adjustment, which is the distance between the bottom of the input and the top of the reflection.DoublePropertytopOpacityProperty()The top opacity value, which is the opacity of the reflection at its top extreme.
-
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:
-
topOffset
public final DoubleProperty topOffsetProperty
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.0Default value:
0.0
See Also:
-
topOpacity
public final DoubleProperty topOpacityProperty
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.0Default value:
0.5
See Also:
-
bottomOpacity
public final DoubleProperty bottomOpacityProperty
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.0Default value:
0.0
See Also:
-
fraction
public final DoubleProperty fractionProperty
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.0Default value:
0.75
See Also:
-
-
Constructor Detail
-
Reflection
public Reflection()
Creates a new instance of Reflection with default parameters.
-
Reflection
public Reflection(double topOffset, double fraction, double topOpacity, double bottomOpacity)Creates a new instance of Reflection with the specified topOffset, fraction, topOpacity and bottomOpacity.Parameters:
topOffset- the distance between the bottom of the input and the top of the reflectionSince:
JavaFX 2.1
-
-
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:
-
setTopOffset
public final void setTopOffset(double value)
Sets the value of the property topOffset.Property description:
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.0Default value:
0.0
-
getTopOffset
public final double getTopOffset()
Gets the value of the property topOffset.Property description:
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.0Default value:
0.0
-
topOffsetProperty
public final DoubleProperty topOffsetProperty()
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.0Default value:
0.0
See Also:
-
setTopOpacity
public final void setTopOpacity(double value)
Sets the value of the property topOpacity.Property description:
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.0Default value:
0.5
-
getTopOpacity
public final double getTopOpacity()
Gets the value of the property topOpacity.Property description:
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.0Default value:
0.5
-
topOpacityProperty
public final DoubleProperty topOpacityProperty()
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.0Default value:
0.5
See Also:
-
setBottomOpacity
public final void setBottomOpacity(double value)
Sets the value of the property bottomOpacity.Property description:
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.0Default value:
0.0
-
getBottomOpacity
public final double getBottomOpacity()
Gets the value of the property bottomOpacity.Property description:
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.0Default value:
0.0
-
bottomOpacityProperty
public final DoubleProperty bottomOpacityProperty()
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.0Default value:
0.0
See Also:
-
setFraction
public final void setFraction(double value)
Sets the value of the property fraction.Property description:
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.0Default value:
0.75
-
getFraction
public final double getFraction()
Gets the value of the property fraction.Property description:
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.0Default value:
0.75
-
fractionProperty
public final DoubleProperty fractionProperty()
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.0Default value:
0.75
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.