Class Light.Distant
- javafx.scene.effect.Light
-
- javafx.scene.effect.Light.Distant
Enclosing class:
public static class Light.Distant extends Light
Example:
Light.Distant light = new Light.Distant();
light.setAzimuth(45.0);
light.setElevation(30.0);
Lighting lighting = new Lighting();
lighting.setLight(light);
lighting.setSurfaceScale(5.0);
Text text = new Text();
text.setText("Distant");
text.setFill(Color.STEELBLUE);
text.setFont(Font.font("null", FontWeight.BOLD, 80));
text.setX(10.0f);
text.setY(10.0f);
text.setTextOrigin(VPos.TOP);
text.setEffect(lighting);
Rectangle rect = new Rectangle(300,150);
rect.setFill(Color.ALICEBLUE);
rect.setEffect(lighting); The code above produces the following:
Since:
JavaFX 2.0
-
Property Summary
All MethodsInstance MethodsConcrete Methods Type Property and Description DoublePropertyazimuthThe azimuth of the light.DoublePropertyelevationThe elevation of the light.
-
Nested Class Summary
-
Nested classes/interfaces inherited from class javafx.scene.effect.Light
Light.Distant, Light.Point, Light.Spot
-
-
Constructor Summary
Constructors Constructor and Description Distant()Creates a new instance of Distant light with default parameters.Distant(double azimuth, double elevation, Color color)Creates a new instance of Distant light with the specified azimuth, elevation, and color.
-
Method Summary
All MethodsInstance MethodsConcrete Methods Modifier and Type Method and Description DoublePropertyazimuthProperty()The azimuth of the light.DoublePropertyelevationProperty()The elevation of the light.doublegetAzimuth()Gets the value of the property azimuth.doublegetElevation()Gets the value of the property elevation.voidsetAzimuth(double value)Sets the value of the property azimuth.voidsetElevation(double value)Sets the value of the property elevation.-
Methods inherited from class javafx.scene.effect.Light
colorProperty, getColor, setColor
-
-
Property Detail
-
azimuth
public final DoubleProperty azimuthProperty
The azimuth of the light. The azimuth is the direction angle for the light source on the XY plane, in degrees.Min: n/a Max: n/a Default: 45.0 Identity: n/aDefault value:
45.0
See Also:
-
elevation
public final DoubleProperty elevationProperty
The elevation of the light. The elevation is the direction angle for the light source on the YZ plane, in degrees.Min: n/a Max: n/a Default: 45.0 Identity: n/aDefault value:
45.0
See Also:
-
-
Constructor Detail
-
Distant
public Distant()
Creates a new instance of Distant light with default parameters.
-
Distant
public Distant(double azimuth, double elevation, Color color)Creates a new instance of Distant light with the specified azimuth, elevation, and color.Parameters:
azimuth- the azimuth of the lightSince:
JavaFX 2.1
-
-
Method Detail
-
setAzimuth
public final void setAzimuth(double value)
Sets the value of the property azimuth.Property description:
The azimuth of the light. The azimuth is the direction angle for the light source on the XY plane, in degrees.
Min: n/a Max: n/a Default: 45.0 Identity: n/aDefault value:
45.0
-
getAzimuth
public final double getAzimuth()
Gets the value of the property azimuth.Property description:
The azimuth of the light. The azimuth is the direction angle for the light source on the XY plane, in degrees.
Min: n/a Max: n/a Default: 45.0 Identity: n/aDefault value:
45.0
-
azimuthProperty
public final DoubleProperty azimuthProperty()
The azimuth of the light. The azimuth is the direction angle for the light source on the XY plane, in degrees.Min: n/a Max: n/a Default: 45.0 Identity: n/aDefault value:
45.0
See Also:
-
setElevation
public final void setElevation(double value)
Sets the value of the property elevation.Property description:
The elevation of the light. The elevation is the direction angle for the light source on the YZ plane, in degrees.
Min: n/a Max: n/a Default: 45.0 Identity: n/aDefault value:
45.0
-
getElevation
public final double getElevation()
Gets the value of the property elevation.Property description:
The elevation of the light. The elevation is the direction angle for the light source on the YZ plane, in degrees.
Min: n/a Max: n/a Default: 45.0 Identity: n/aDefault value:
45.0
-
elevationProperty
public final DoubleProperty elevationProperty()
The elevation of the light. The elevation is the direction angle for the light source on the YZ plane, in degrees.Min: n/a Max: n/a Default: 45.0 Identity: n/aDefault value:
45.0
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.