Class Light.Point
java.lang.Object
javafx.scene.effect.Light
javafx.scene.effect.Light.Point
- Direct Known Subclasses:
Light.Spot
- Enclosing class:
Light
public static class Light.Point extends Light
Represents a light source at a given position in 3D space.
Example:
Light.Point light = new Light.Point();
light.setX(100);
light.setY(100);
light.setZ(50);
Lighting lighting = new Lighting();
lighting.setLight(light);
lighting.setSurfaceScale(5.0);
Text text = new Text();
text.setText("Point");
text.setFill(Color.STEELBLUE);
text.setFont(Font.font(null, FontWeight.BOLD, 80));
text.setX(10.0);
text.setY(10.0);
text.setTextOrigin(VPos.TOP);
Rectangle rect = new Rectangle(250, 150);
rect.setFill(Color.ALICEBLUE);
rect.setEffect(lighting);
text.setEffect(lighting);
The code above produces the following:
- Since:
- JavaFX 2.0
Nested Class Summary
Nested classes/interfaces declared in class javafx.scene.effect.Light
Light.Distant, Light.Point, Light.Spot
Property Summary
| Type | Property | Description |
|---|---|---|
final DoubleProperty |
x |
The x coordinate of the light position. |
final DoubleProperty |
y |
The y coordinate of the light position. |
final DoubleProperty |
z |
The z coordinate of the light position. |
Constructor Summary
| Constructor | Description |
|---|---|
Point() |
Creates a new instance of Point light with default parameters. |
Point |
Creates a new instance of Point light with the specified x, y, x, and color. |
Method Summary
| Modifier and Type | Method | Description |
|---|---|---|
final double |
getX() |
Gets the value of the x property. |
final double |
getY() |
Gets the value of the y property. |
final double |
getZ() |
Gets the value of the z property. |
final void |
setX |
Sets the value of the x property. |
final void |
setY |
Sets the value of the y property. |
final void |
setZ |
Sets the value of the z property. |
final DoubleProperty |
xProperty() |
The x coordinate of the light position. |
final DoubleProperty |
yProperty() |
The y coordinate of the light position. |
final DoubleProperty |
zProperty() |
The z coordinate of the light position. |
Methods declared in class javafx.scene.effect.Light
colorProperty, getColor, setColor
Property Details
x
public final DoubleProperty xProperty
The x coordinate of the light position.
Min: n/a
Max: n/a
Default: 0.0
Identity: n/a
- Default value:
- 0.0
- See Also:
y
public final DoubleProperty yProperty
The y coordinate of the light position.
Min: n/a
Max: n/a
Default: 0.0
Identity: n/a
- Default value:
- 0.0
- See Also:
z
public final DoubleProperty zProperty
The z coordinate of the light position.
Min: n/a
Max: n/a
Default: 0.0
Identity: n/a
- Default value:
- 0.0
- See Also:
Constructor Details
Point
public Point()
Creates a new instance of Point light with default parameters.
Point
public Point(double x, double y, double z, Color color)
Creates a new instance of Point light with the specified x, y, x, and color.
- Parameters:
-
x- the x coordinate of the light position -
y- the y coordinate of the light position -
z- the z coordinate of the light position -
color- the color of the light - Since:
- JavaFX 2.1
Method Details
setX
public final void setX(double value)
Sets the value of the
x property.- Property description:
- The x coordinate of the light position.
Min: n/a Max: n/a Default: 0.0 Identity: n/a - Default value:
- 0.0
- Parameters:
-
value- the value for thexproperty - See Also:
getX
public final double getX()
Gets the value of the
x property.- Property description:
- The x coordinate of the light position.
Min: n/a Max: n/a Default: 0.0 Identity: n/a - Default value:
- 0.0
- Returns:
- the value of the
xproperty - See Also:
xProperty
public final DoubleProperty xProperty()
The x coordinate of the light position.
Min: n/a
Max: n/a
Default: 0.0
Identity: n/a
- Default value:
- 0.0
- Returns:
- the
xproperty - See Also:
setY
public final void setY(double value)
Sets the value of the
y property.- Property description:
- The y coordinate of the light position.
Min: n/a Max: n/a Default: 0.0 Identity: n/a - Default value:
- 0.0
- Parameters:
-
value- the value for theyproperty - See Also:
getY
public final double getY()
Gets the value of the
y property.- Property description:
- The y coordinate of the light position.
Min: n/a Max: n/a Default: 0.0 Identity: n/a - Default value:
- 0.0
- Returns:
- the value of the
yproperty - See Also:
yProperty
public final DoubleProperty yProperty()
The y coordinate of the light position.
Min: n/a
Max: n/a
Default: 0.0
Identity: n/a
- Default value:
- 0.0
- Returns:
- the
yproperty - See Also:
setZ
public final void setZ(double value)
Sets the value of the
z property.- Property description:
- The z coordinate of the light position.
Min: n/a Max: n/a Default: 0.0 Identity: n/a - Default value:
- 0.0
- Parameters:
-
value- the value for thezproperty - See Also:
getZ
public final double getZ()
Gets the value of the
z property.- Property description:
- The z coordinate of the light position.
Min: n/a Max: n/a Default: 0.0 Identity: n/a - Default value:
- 0.0
- Returns:
- the value of the
zproperty - See Also:
zProperty
public final DoubleProperty zProperty()
The z coordinate of the light position.
Min: n/a
Max: n/a
Default: 0.0
Identity: n/a
- Default value:
- 0.0
- Returns:
- the
zproperty - 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.