public static class Light.Point extends Light
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:
Type | Property and Description |
---|---|
DoubleProperty |
x
The x coordinate of the light position.
|
DoubleProperty |
y
The y coordinate of the light position.
|
DoubleProperty |
z
The z coordinate of the light position.
|
Light.Distant, Light.Point, Light.Spot
Constructor and Description |
---|
Point()
Creates a new instance of Point light with default parameters.
|
Point(double x,
double y,
double z,
Color color)
Creates a new instance of Point light with the specified x, y, x, and
color.
|
Modifier and Type | Method and Description |
---|---|
double |
getX()
Gets the value of the property x.
|
double |
getY()
Gets the value of the property y.
|
double |
getZ()
Gets the value of the property z.
|
void |
setX(double value)
Sets the value of the property x.
|
void |
setY(double value)
Sets the value of the property y.
|
void |
setZ(double value)
Sets the value of the property z.
|
DoubleProperty |
xProperty()
The x coordinate of the light position.
|
DoubleProperty |
yProperty()
The y coordinate of the light position.
|
DoubleProperty |
zProperty()
The z coordinate of the light position.
|
colorProperty, getColor, setColor
public final DoubleProperty xProperty
Min: n/a Max: n/a Default: 0.0 Identity: n/a
getX()
,
setX(double)
public final DoubleProperty yProperty
Min: n/a Max: n/a Default: 0.0 Identity: n/a
getY()
,
setY(double)
public final DoubleProperty zProperty
Min: n/a Max: n/a Default: 0.0 Identity: n/a
getZ()
,
setZ(double)
public Point()
public Point(double x, double y, double z, Color color)
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 lightpublic final void setX(double value)
Min: n/a Max: n/a Default: 0.0 Identity: n/a
public final double getX()
Min: n/a Max: n/a Default: 0.0 Identity: n/a
public final DoubleProperty xProperty()
Min: n/a Max: n/a Default: 0.0 Identity: n/a
getX()
,
setX(double)
public final void setY(double value)
Min: n/a Max: n/a Default: 0.0 Identity: n/a
public final double getY()
Min: n/a Max: n/a Default: 0.0 Identity: n/a
public final DoubleProperty yProperty()
Min: n/a Max: n/a Default: 0.0 Identity: n/a
getY()
,
setY(double)
public final void setZ(double value)
Min: n/a Max: n/a Default: 0.0 Identity: n/a
public final double getZ()
Min: n/a Max: n/a Default: 0.0 Identity: n/a
public final DoubleProperty zProperty()
Min: n/a Max: n/a Default: 0.0 Identity: n/a
getZ()
,
setZ(double)
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 2008, 2017, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.