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:
Modifier and Type | Class and Description |
---|---|
private class |
Lighting.LightChangeListener |
Effect.EffectInputChangeListener, Effect.EffectInputProperty
Modifier and Type | Field and Description |
---|---|
private ObjectProperty<Effect> |
bumpInput
The optional bump map input.
|
private ObjectProperty<Effect> |
contentInput
The content input for this
Effect . |
private Light |
defaultLight |
private DoubleProperty |
diffuseConstant
The diffuse constant.
|
private ObjectProperty<Light> |
light
The light source for this
Lighting effect. |
private Lighting.LightChangeListener |
lightChangeListener |
private DoubleProperty |
specularConstant
The specular constant.
|
private DoubleProperty |
specularExponent
The specular exponent.
|
private 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.
|
effectBoundsChanged, getInputBounds, getKernelSize, getShadowBounds, impl_containsCycles, impl_effectDirtyProperty, impl_getImpl, impl_isEffectDirty, impl_sync, markDirty, transformBounds
private final Light defaultLight
private ObjectProperty<Light> light
Lighting
effect.private final Lighting.LightChangeListener lightChangeListener
private ObjectProperty<Effect> bumpInput
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.private ObjectProperty<Effect> contentInput
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.private DoubleProperty diffuseConstant
Min: 0.0 Max: 2.0 Default: 1.0 Identity: n/a
private DoubleProperty specularConstant
Min: 0.0 Max: 2.0 Default: 0.3 Identity: n/a
private DoubleProperty specularExponent
Min: 0.0 Max: 40.0 Default: 20.0 Identity: n/a
private DoubleProperty surfaceScale
Min: 0.0 Max: 10.0 Default: 1.5 Identity: n/a
public Lighting()
public Lighting(Light light)
light
- the light source for this Lighting
effectPhongLighting impl_createImpl()
impl_createImpl
in class Effect
public final void setLight(Light value)
public final Light getLight()
public final ObjectProperty<Light> lightProperty()
@Deprecated public Effect impl_copy()
public final void setBumpInput(Effect value)
public final Effect getBumpInput()
public final ObjectProperty<Effect> bumpInputProperty()
public final void setContentInput(Effect value)
public final Effect getContentInput()
public final ObjectProperty<Effect> contentInputProperty()
boolean impl_checkChainContains(Effect e)
impl_checkChainContains
in class Effect
public final void setDiffuseConstant(double value)
public final double getDiffuseConstant()
public final DoubleProperty diffuseConstantProperty()
public final void setSpecularConstant(double value)
public final double getSpecularConstant()
public final DoubleProperty specularConstantProperty()
public final void setSpecularExponent(double value)
public final double getSpecularExponent()
public final DoubleProperty specularExponentProperty()
public final void setSurfaceScale(double value)
public final double getSurfaceScale()
public final DoubleProperty surfaceScaleProperty()
private Light getLightInternal()
void impl_update()
impl_update
in class Effect
@Deprecated public BaseBounds impl_getBounds(BaseBounds bounds, BaseTransform tx, Node node, BoundsAccessor boundsAccessor)
Effect
impl_getBounds
in class Effect