public class Lighting extends Effect
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:
| Type | Property and Description |
|---|---|
ObjectProperty<Effect> |
bumpInput
The optional bump map input.
|
ObjectProperty<Effect> |
contentInput
The content input for this
Effect. |
DoubleProperty |
diffuseConstant
The diffuse constant.
|
ObjectProperty<Light> |
light
The light source for this
Lighting effect. |
DoubleProperty |
specularConstant
The specular constant.
|
DoubleProperty |
specularExponent
The specular exponent.
|
DoubleProperty |
surfaceScale
The surface scale factor.
|
| Constructor and Description |
|---|
Lighting()
Creates a new instance of Lighting with default parameters.
|
Lighting(Light light)
Creates a new instance of Lighting with the specified light.
|
| Modifier and Type | Method and Description |
|---|---|
ObjectProperty<Effect> |
bumpInputProperty()
The optional bump map input.
|
ObjectProperty<Effect> |
contentInputProperty()
The content input for this
Effect. |
DoubleProperty |
diffuseConstantProperty()
The diffuse constant.
|
Effect |
getBumpInput()
Gets the value of the property bumpInput.
|
Effect |
getContentInput()
Gets the value of the property contentInput.
|
double |
getDiffuseConstant()
Gets the value of the property diffuseConstant.
|
Light |
getLight()
Gets the value of the property light.
|
double |
getSpecularConstant()
Gets the value of the property specularConstant.
|
double |
getSpecularExponent()
Gets the value of the property specularExponent.
|
double |
getSurfaceScale()
Gets the value of the property surfaceScale.
|
ObjectProperty<Light> |
lightProperty()
The light source for this
Lighting effect. |
void |
setBumpInput(Effect value)
Sets the value of the property bumpInput.
|
void |
setContentInput(Effect value)
Sets the value of the property contentInput.
|
void |
setDiffuseConstant(double value)
Sets the value of the property diffuseConstant.
|
void |
setLight(Light value)
Sets the value of the property light.
|
void |
setSpecularConstant(double value)
Sets the value of the property specularConstant.
|
void |
setSpecularExponent(double value)
Sets the value of the property specularExponent.
|
void |
setSurfaceScale(double value)
Sets the value of the property surfaceScale.
|
DoubleProperty |
specularConstantProperty()
The specular constant.
|
DoubleProperty |
specularExponentProperty()
The specular exponent.
|
DoubleProperty |
surfaceScaleProperty()
The surface scale factor.
|
public final ObjectProperty<Light> lightProperty
Lighting effect.getLight(),
setLight(Light)public final ObjectProperty<Effect> bumpInputProperty
null, or left unspecified, a graphical image of
the Node to which the Effect is attached will be
used to generate a default bump map.getBumpInput(),
setBumpInput(Effect)public final ObjectProperty<Effect> contentInputProperty
Effect.
If set to null, or left unspecified, a graphical image of
the Node to which the Effect is attached will be
used as the input.getContentInput(),
setContentInput(Effect)public final DoubleProperty diffuseConstantProperty
Min: 0.0
Max: 2.0
Default: 1.0
Identity: n/a
getDiffuseConstant(),
setDiffuseConstant(double)public final DoubleProperty specularConstantProperty
Min: 0.0
Max: 2.0
Default: 0.3
Identity: n/a
getSpecularConstant(),
setSpecularConstant(double)public final DoubleProperty specularExponentProperty
Min: 0.0
Max: 40.0
Default: 20.0
Identity: n/a
getSpecularExponent(),
setSpecularExponent(double)public final DoubleProperty surfaceScaleProperty
Min: 0.0
Max: 10.0
Default: 1.5
Identity: n/a
getSurfaceScale(),
setSurfaceScale(double)public Lighting()
public Lighting(Light light)
light - the light source for this Lighting effectpublic final void setLight(Light value)
Lighting effect.public final Light getLight()
Lighting effect.public final ObjectProperty<Light> lightProperty()
Lighting effect.getLight(),
setLight(Light)public final void setBumpInput(Effect value)
null, or left unspecified, a graphical image of
the Node to which the Effect is attached will be
used to generate a default bump map.public final Effect getBumpInput()
null, or left unspecified, a graphical image of
the Node to which the Effect is attached will be
used to generate a default bump map.public final ObjectProperty<Effect> bumpInputProperty()
null, or left unspecified, a graphical image of
the Node to which the Effect is attached will be
used to generate a default bump map.getBumpInput(),
setBumpInput(Effect)public final void setContentInput(Effect value)
Effect.
If set to null, or left unspecified, a graphical image of
the Node to which the Effect is attached will be
used as the input.public final Effect getContentInput()
Effect.
If set to null, or left unspecified, a graphical image of
the Node to which the Effect is attached will be
used as the input.public final ObjectProperty<Effect> contentInputProperty()
Effect.
If set to null, or left unspecified, a graphical image of
the Node to which the Effect is attached will be
used as the input.getContentInput(),
setContentInput(Effect)public final void setDiffuseConstant(double value)
Min: 0.0
Max: 2.0
Default: 1.0
Identity: n/a
public final double getDiffuseConstant()
Min: 0.0
Max: 2.0
Default: 1.0
Identity: n/a
public final DoubleProperty diffuseConstantProperty()
Min: 0.0
Max: 2.0
Default: 1.0
Identity: n/a
getDiffuseConstant(),
setDiffuseConstant(double)public final void setSpecularConstant(double value)
Min: 0.0
Max: 2.0
Default: 0.3
Identity: n/a
public final double getSpecularConstant()
Min: 0.0
Max: 2.0
Default: 0.3
Identity: n/a
public final DoubleProperty specularConstantProperty()
Min: 0.0
Max: 2.0
Default: 0.3
Identity: n/a
getSpecularConstant(),
setSpecularConstant(double)public final void setSpecularExponent(double value)
Min: 0.0
Max: 40.0
Default: 20.0
Identity: n/a
public final double getSpecularExponent()
Min: 0.0
Max: 40.0
Default: 20.0
Identity: n/a
public final DoubleProperty specularExponentProperty()
Min: 0.0
Max: 40.0
Default: 20.0
Identity: n/a
getSpecularExponent(),
setSpecularExponent(double)public final void setSurfaceScale(double value)
Min: 0.0
Max: 10.0
Default: 1.5
Identity: n/a
public final double getSurfaceScale()
Min: 0.0
Max: 10.0
Default: 1.5
Identity: n/a
public final DoubleProperty surfaceScaleProperty()
Min: 0.0
Max: 10.0
Default: 1.5
Identity: n/a
getSurfaceScale(),
setSurfaceScale(double)Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.