Spec-Zone.ru › OpenJavaFX 21

Class Light.Distant

java.lang.Object
javafx.scene.effect.Light
javafx.scene.effect.Light.Distant
Enclosing class:
Light
public static class Light.Distant extends Light
Represents a distant light source.

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:

The visual effect of distant
 Light on text

Since:
JavaFX 2.0

Property Summary

Type Property Description
final DoubleProperty azimuth
The azimuth of the light.
final DoubleProperty elevation
The elevation of the light.

Properties declared in class javafx.scene.effect.Light

color

Nested Class Summary

Nested classes/interfaces declared in class javafx.scene.effect.Light

Light.Distant, Light.Point, Light.Spot

Constructor Summary

Constructor 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

Modifier and Type Method Description
final DoubleProperty azimuthProperty()
The azimuth of the light.
final DoubleProperty elevationProperty()
The elevation of the light.
final double getAzimuth()
Gets the value of the azimuth property.
final double getElevation()
Gets the value of the elevation property.
final void setAzimuth(double value)
Sets the value of the azimuth property.
final void setElevation(double value)
Sets the value of the elevation property.

Methods declared in class javafx.scene.effect.Light

colorProperty, getColor, setColor

Methods declared in class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Property Details

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/a
 
Default value:
45.0
See Also:
  • getAzimuth()
  • setAzimuth(double)
  • azimuthProperty()

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/a
 
Default value:
45.0
See Also:
  • getElevation()
  • setElevation(double)
  • elevationProperty()

Constructor Details

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 light
elevation - the elevation of the light
color - the color of the light
Since:
JavaFX 2.1

Method Details

setAzimuth

public final void setAzimuth(double value)
Sets the value of the azimuth property.
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/a
 
Default value:
45.0
Parameters:
value - the value for the azimuth property
See Also:
  • getAzimuth()
  • azimuthProperty()

getAzimuth

public final double getAzimuth()
Gets the value of the azimuth property.
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/a
 
Default value:
45.0
Returns:
the value of the azimuth property
See Also:
  • setAzimuth(double)
  • azimuthProperty()

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/a
 
Default value:
45.0
Returns:
the azimuth property
See Also:
  • getAzimuth()
  • setAzimuth(double)

setElevation

public final void setElevation(double value)
Sets the value of the elevation property.
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/a
 
Default value:
45.0
Parameters:
value - the value for the elevation property
See Also:
  • getElevation()
  • elevationProperty()

getElevation

public final double getElevation()
Gets the value of the elevation property.
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/a
 
Default value:
45.0
Returns:
the value of the elevation property
See Also:
  • setElevation(double)
  • elevationProperty()

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/a
 
Default value:
45.0
Returns:
the elevation property
See Also:
  • getElevation()
  • setElevation(double)

© 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.

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API