java.lang.Object
javafx.scene.effect.Light
javafx.scene.effect.Light.Point
- Direct Known Subclasses:
Light.Spot
- Enclosing class:
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
-
Property Summary
TypePropertyDescriptionfinal DoubleProperty
The x coordinate of the light position.final DoubleProperty
The y coordinate of the light position.final DoubleProperty
The z coordinate of the light position. -
Nested Class Summary
Nested classes/interfaces declared in class javafx.scene.effect.Light
Light.Distant, Light.Point, Light.Spot
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal double
getX()
Gets the value of thex
property.final double
getY()
Gets the value of they
property.final double
getZ()
Gets the value of thez
property.final void
setX
(double value) Sets the value of thex
property.final void
setY
(double value) Sets the value of they
property.final void
setZ
(double value) Sets the value of thez
property.final DoubleProperty
The x coordinate of the light position.final DoubleProperty
The y coordinate of the light position.final DoubleProperty
The z coordinate of the light position.Methods declared in class javafx.scene.effect.Light
colorProperty, getColor, setColor
-
Property Details
-
x
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
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
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
Creates a new instance of Point light with the specified x, y, x, and color.- Parameters:
x
- the x coordinate of the light positiony
- the y coordinate of the light positionz
- the z coordinate of the light positioncolor
- the color of the light- Since:
- JavaFX 2.1
-
-
Method Details
-
setX
public final void setX(double value) Sets the value of thex
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 thex
property- See Also:
-
getX
public final double getX()Gets the value of thex
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
x
property - See Also:
-
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
x
property - See Also:
-
setY
public final void setY(double value) Sets the value of they
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 they
property- See Also:
-
getY
public final double getY()Gets the value of they
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
y
property - See Also:
-
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
y
property - See Also:
-
setZ
public final void setZ(double value) Sets the value of thez
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 thez
property- See Also:
-
getZ
public final double getZ()Gets the value of thez
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
z
property - See Also:
-
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
z
property - See Also:
-