Example:
Light.Distant light = new Light.Distant();
light.setAzimuth(-135.0);
Lighting lighting = new Lighting();
lighting.setLight(light);
lighting.setSurfaceScale(5.0);
Text text = new Text();
text.setText("JavaFX!");
text.setFill(Color.STEELBLUE);
text.setFont(Font.font(null, FontWeight.BOLD, 60));
text.setX(10.0);
text.setY(10.0);
text.setTextOrigin(VPos.TOP);
text.setEffect(lighting);
The code above produces the following:
| Modifier and Type | Class and Description |
|---|---|
| private class |
| Modifier and Type | Field and Description |
|---|---|
| private ObjectProperty | bumpInput
The optional bump map input. |
| private ObjectProperty | contentInput
The content input for this |
| private final Light | |
| private DoubleProperty | diffuseConstant
The diffuse constant. |
| private ObjectProperty | light
The light source for this |
| private final Lighting. | |
| private DoubleProperty | specularConstant
The specular constant. |
| private DoubleProperty | specularExponent
The specular exponent. |
| private DoubleProperty | surfaceScale
The surface scale factor. |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public final ObjectProperty | |
| pack-priv boolean | |
| public final ObjectProperty | |
| pack-priv Effect | |
| pack-priv PhongLighting | |
| public final DoubleProperty | |
| pack-priv BaseBounds | getBounds(BaseBounds bounds, BaseTransform tx, Node node, BoundsAccessor boundsAccessor)
Implements abstract javafx. Returns bounds of given node with applied effect. |
| public final Effect | |
| public final Effect | |
| public final double | |
| public final Light | |
| private Light | |
| public final double | |
| public final double | |
| public final double | |
| public final ObjectProperty | |
| public final void | |
| public final void | |
| public final void | |
| public final void | |
| public final void | |
| public final void | |
| public final void | |
| public final DoubleProperty | |
| public final DoubleProperty | |
| public final DoubleProperty | |
| pack-priv void |
| bumpInput | back to summary |
|---|---|
| private ObjectProperty<Effect> bumpInput The optional bump map input.
If not specified, a bump map will be automatically generated
from the default input.
If set to
| |
| contentInput | back to summary |
|---|---|
| private ObjectProperty<Effect> contentInput The content input for this
| |
| defaultLight | back to summary |
|---|---|
| private final Light defaultLight | |
| diffuseConstant | back to summary |
|---|---|
| private DoubleProperty diffuseConstant The diffuse constant.
Min: 0.0
Max: 2.0
Default: 1.0
Identity: n/a
| |
| light | back to summary |
|---|---|
| private ObjectProperty<Light> light The light source for this | |
| lightChangeListener | back to summary |
|---|---|
| private final Lighting. | |
| specularConstant | back to summary |
|---|---|
| private DoubleProperty specularConstant The specular constant.
Min: 0.0
Max: 2.0
Default: 0.3
Identity: n/a
| |
| specularExponent | back to summary |
|---|---|
| private DoubleProperty specularExponent The specular exponent.
Min: 0.0
Max: 40.0
Default: 20.0
Identity: n/a
| |
| surfaceScale | back to summary |
|---|---|
| private DoubleProperty surfaceScale The surface scale factor.
Min: 0.0
Max: 10.0
Default: 1.5
Identity: n/a
| |
| Lighting | back to summary |
|---|---|
| public Lighting() Creates a new instance of Lighting with default parameters. | |
| Lighting | back to summary |
|---|---|
| public Lighting(Light light) Creates a new instance of Lighting with the specified light.
| |
| bumpInputProperty | back to summary |
|---|---|
| public final ObjectProperty | |
| checkChainContains | back to summary |
|---|---|
| pack-priv boolean checkChainContains(Effect e) Implements abstract javafx.
| |
| contentInputProperty | back to summary |
|---|---|
| public final ObjectProperty | |
| copy | back to summary |
|---|---|
| pack-priv Effect copy() Implements abstract javafx.
| |
| createPeer | back to summary |
|---|---|
| pack-priv PhongLighting createPeer() Implements abstract javafx.
| |
| diffuseConstantProperty | back to summary |
|---|---|
| public final DoubleProperty diffuseConstantProperty() | |
| getBounds | back to summary |
|---|---|
| pack-priv BaseBounds getBounds(BaseBounds bounds, BaseTransform tx, Node node, BoundsAccessor boundsAccessor) Implements abstract javafx. Doc from javafx. Returns bounds of given node with applied effect. We *never* pass null in as a bounds. This method will NOT take a null bounds object. The returned value may be the same bounds object passed in, or it may be a new object.
| |
| getBumpInput | back to summary |
|---|---|
| public final Effect getBumpInput() | |
| getContentInput | back to summary |
|---|---|
| public final Effect getContentInput() | |
| getDiffuseConstant | back to summary |
|---|---|
| public final double getDiffuseConstant() | |
| getLight | back to summary |
|---|---|
| public final Light getLight() | |
| getLightInternal | back to summary |
|---|---|
| private Light getLightInternal() | |
| getSpecularConstant | back to summary |
|---|---|
| public final double getSpecularConstant() | |
| getSpecularExponent | back to summary |
|---|---|
| public final double getSpecularExponent() | |
| getSurfaceScale | back to summary |
|---|---|
| public final double getSurfaceScale() | |
| lightProperty | back to summary |
|---|---|
| public final ObjectProperty | |
| setBumpInput | back to summary |
|---|---|
| public final void setBumpInput(Effect value) | |
| setContentInput | back to summary |
|---|---|
| public final void setContentInput(Effect value) | |
| setDiffuseConstant | back to summary |
|---|---|
| public final void setDiffuseConstant(double value) | |
| setLight | back to summary |
|---|---|
| public final void setLight(Light value) | |
| setSpecularConstant | back to summary |
|---|---|
| public final void setSpecularConstant(double value) | |
| setSpecularExponent | back to summary |
|---|---|
| public final void setSpecularExponent(double value) | |
| setSurfaceScale | back to summary |
|---|---|
| public final void setSurfaceScale(double value) | |
| specularConstantProperty | back to summary |
|---|---|
| public final DoubleProperty specularConstantProperty() | |
| specularExponentProperty | back to summary |
|---|---|
| public final DoubleProperty specularExponentProperty() | |
| surfaceScaleProperty | back to summary |
|---|---|
| public final DoubleProperty surfaceScaleProperty() | |
| update | back to summary |
|---|---|
| pack-priv void update() Implements abstract javafx.
| |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv Light |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public void | invalidated(Observable valueModel)
Implements javafx. This method needs to be provided by an implementation of
|
| public void |
| light | back to summary |
|---|---|
| pack-priv Light light | |
| LightChangeListener | back to summary |
|---|---|
| private LightChangeListener() | |
| invalidated | back to summary |
|---|---|
| public void invalidated(Observable valueModel) Implements javafx. Doc from javafx. This method needs to be provided by an implementation of
In general, it is considered bad practice to modify the observed value in this method.
| |
| register | back to summary |
|---|---|
| public void register(Light value) | |