Class Lighting
java.lang.Object
javafx.scene.effect.Effect
javafx.scene.effect.Lighting
An effect that simulates a light source shining on the given content,
 which can be used to give flat objects a more realistic, three-dimensional
 appearance.
 
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:
  
 
- Since:
- JavaFX 2.0
- 
Property SummaryPropertiesTypePropertyDescriptionfinal ObjectProperty<Effect> The optional bump map input.final ObjectProperty<Effect> The content input for thisEffect.final DoublePropertyThe diffuse constant.final ObjectProperty<Light> The light source for thisLightingeffect.final DoublePropertyThe specular constant.final DoublePropertyThe specular exponent.final DoublePropertyThe surface scale factor.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionfinal ObjectProperty<Effect> The optional bump map input.final ObjectProperty<Effect> The content input for thisEffect.final DoublePropertyThe diffuse constant.final EffectGets the value of thebumpInputproperty.final EffectGets the value of thecontentInputproperty.final doubleGets the value of thediffuseConstantproperty.final LightgetLight()Gets the value of thelightproperty.final doubleGets the value of thespecularConstantproperty.final doubleGets the value of thespecularExponentproperty.final doubleGets the value of thesurfaceScaleproperty.final ObjectProperty<Light> The light source for thisLightingeffect.final voidsetBumpInput(Effect value) Sets the value of thebumpInputproperty.final voidsetContentInput(Effect value) Sets the value of thecontentInputproperty.final voidsetDiffuseConstant(double value) Sets the value of thediffuseConstantproperty.final voidSets the value of thelightproperty.final voidsetSpecularConstant(double value) Sets the value of thespecularConstantproperty.final voidsetSpecularExponent(double value) Sets the value of thespecularExponentproperty.final voidsetSurfaceScale(double value) Sets the value of thesurfaceScaleproperty.final DoublePropertyThe specular constant.final DoublePropertyThe specular exponent.final DoublePropertyThe surface scale factor.
- 
Property Details- 
lightThe light source for thisLightingeffect.- See Also:
 
- 
bumpInputThe optional bump map input. If not specified, a bump map will be automatically generated from the default input. If set tonull, or left unspecified, a graphical image of theNodeto which theEffectis attached will be used to generate a default bump map.- Default value:
- a Shadow effect with a radius of 10
- See Also:
 
- 
contentInputThe content input for thisEffect. If set tonull, or left unspecified, a graphical image of theNodeto which theEffectis attached will be used as the input.- Default value:
- null
- See Also:
 
- 
diffuseConstantThe diffuse constant.Min: 0.0 Max: 2.0 Default: 1.0 Identity: n/a- Default value:
- 1.0
- See Also:
 
- 
specularConstantThe specular constant.Min: 0.0 Max: 2.0 Default: 0.3 Identity: n/a- Default value:
- 0.3
- See Also:
 
- 
specularExponentThe specular exponent.Min: 0.0 Max: 40.0 Default: 20.0 Identity: n/a- Default value:
- 20.0
- See Also:
 
- 
surfaceScaleThe surface scale factor.Min: 0.0 Max: 10.0 Default: 1.5 Identity: n/a- Default value:
- 1.5
- See Also:
 
 
- 
- 
Constructor Details- 
Lightingpublic Lighting()Creates a new instance of Lighting with default parameters.
- 
LightingCreates a new instance of Lighting with the specified light.- Parameters:
- light- the light source for this- Lightingeffect
- Since:
- JavaFX 2.1
 
 
- 
- 
Method Details- 
setLightSets the value of thelightproperty.- Property description:
- The light source for this Lightingeffect.
- Parameters:
- value- the value for the- lightproperty
- See Also:
 
- 
getLightGets the value of thelightproperty.- Property description:
- The light source for this Lightingeffect.
- Returns:
- the value of the lightproperty
- See Also:
 
- 
lightPropertyThe light source for thisLightingeffect.- Returns:
- the lightproperty
- See Also:
 
- 
setBumpInputSets the value of thebumpInputproperty.- Property description:
- The optional bump map input.
 If not specified, a bump map will be automatically generated
 from the default input.
 If set to null, or left unspecified, a graphical image of theNodeto which theEffectis attached will be used to generate a default bump map.
- Default value:
- a Shadow effect with a radius of 10
- Parameters:
- value- the value for the- bumpInputproperty
- See Also:
 
- 
getBumpInputGets the value of thebumpInputproperty.- Property description:
- The optional bump map input.
 If not specified, a bump map will be automatically generated
 from the default input.
 If set to null, or left unspecified, a graphical image of theNodeto which theEffectis attached will be used to generate a default bump map.
- Default value:
- a Shadow effect with a radius of 10
- Returns:
- the value of the bumpInputproperty
- See Also:
 
- 
bumpInputPropertyThe optional bump map input. If not specified, a bump map will be automatically generated from the default input. If set tonull, or left unspecified, a graphical image of theNodeto which theEffectis attached will be used to generate a default bump map.- Default value:
- a Shadow effect with a radius of 10
- Returns:
- the bumpInputproperty
- See Also:
 
- 
setContentInputSets the value of thecontentInputproperty.- Property description:
- The content input for this Effect. If set tonull, or left unspecified, a graphical image of theNodeto which theEffectis attached will be used as the input.
- Default value:
- null
- Parameters:
- value- the value for the- contentInputproperty
- See Also:
 
- 
getContentInputGets the value of thecontentInputproperty.- Property description:
- The content input for this Effect. If set tonull, or left unspecified, a graphical image of theNodeto which theEffectis attached will be used as the input.
- Default value:
- null
- Returns:
- the value of the contentInputproperty
- See Also:
 
- 
contentInputPropertyThe content input for thisEffect. If set tonull, or left unspecified, a graphical image of theNodeto which theEffectis attached will be used as the input.- Default value:
- null
- Returns:
- the contentInputproperty
- See Also:
 
- 
setDiffuseConstantpublic final void setDiffuseConstant(double value) Sets the value of thediffuseConstantproperty.- Property description:
- The diffuse constant.
 Min: 0.0 Max: 2.0 Default: 1.0 Identity: n/a
- Default value:
- 1.0
- Parameters:
- value- the value for the- diffuseConstantproperty
- See Also:
 
- 
getDiffuseConstantpublic final double getDiffuseConstant()Gets the value of thediffuseConstantproperty.- Property description:
- The diffuse constant.
 Min: 0.0 Max: 2.0 Default: 1.0 Identity: n/a
- Default value:
- 1.0
- Returns:
- the value of the diffuseConstantproperty
- See Also:
 
- 
diffuseConstantPropertyThe diffuse constant.Min: 0.0 Max: 2.0 Default: 1.0 Identity: n/a- Default value:
- 1.0
- Returns:
- the diffuseConstantproperty
- See Also:
 
- 
setSpecularConstantpublic final void setSpecularConstant(double value) Sets the value of thespecularConstantproperty.- Property description:
- The specular constant.
 Min: 0.0 Max: 2.0 Default: 0.3 Identity: n/a
- Default value:
- 0.3
- Parameters:
- value- the value for the- specularConstantproperty
- See Also:
 
- 
getSpecularConstantpublic final double getSpecularConstant()Gets the value of thespecularConstantproperty.- Property description:
- The specular constant.
 Min: 0.0 Max: 2.0 Default: 0.3 Identity: n/a
- Default value:
- 0.3
- Returns:
- the value of the specularConstantproperty
- See Also:
 
- 
specularConstantPropertyThe specular constant.Min: 0.0 Max: 2.0 Default: 0.3 Identity: n/a- Default value:
- 0.3
- Returns:
- the specularConstantproperty
- See Also:
 
- 
setSpecularExponentpublic final void setSpecularExponent(double value) Sets the value of thespecularExponentproperty.- Property description:
- The specular exponent.
 Min: 0.0 Max: 40.0 Default: 20.0 Identity: n/a
- Default value:
- 20.0
- Parameters:
- value- the value for the- specularExponentproperty
- See Also:
 
- 
getSpecularExponentpublic final double getSpecularExponent()Gets the value of thespecularExponentproperty.- Property description:
- The specular exponent.
 Min: 0.0 Max: 40.0 Default: 20.0 Identity: n/a
- Default value:
- 20.0
- Returns:
- the value of the specularExponentproperty
- See Also:
 
- 
specularExponentPropertyThe specular exponent.Min: 0.0 Max: 40.0 Default: 20.0 Identity: n/a- Default value:
- 20.0
- Returns:
- the specularExponentproperty
- See Also:
 
- 
setSurfaceScalepublic final void setSurfaceScale(double value) Sets the value of thesurfaceScaleproperty.- Property description:
- The surface scale factor.
 Min: 0.0 Max: 10.0 Default: 1.5 Identity: n/a
- Default value:
- 1.5
- Parameters:
- value- the value for the- surfaceScaleproperty
- See Also:
 
- 
getSurfaceScalepublic final double getSurfaceScale()Gets the value of thesurfaceScaleproperty.- Property description:
- The surface scale factor.
 Min: 0.0 Max: 10.0 Default: 1.5 Identity: n/a
- Default value:
- 1.5
- Returns:
- the value of the surfaceScaleproperty
- See Also:
 
- 
surfaceScalePropertyThe surface scale factor.Min: 0.0 Max: 10.0 Default: 1.5 Identity: n/a- Default value:
- 1.5
- Returns:
- the surfaceScaleproperty
- See Also:
 
 
-