Package javafx.scene

Class LightBase

  • All Implemented Interfaces:
    Styleable, EventTarget
    Direct Known Subclasses:
    AmbientLight, PointLight

    public abstract class LightBase
    extends Node
    The LightBase class provides definitions of common properties for objects that represent a form of Light source. These properties include:
    • The color that defines color of the light source.
    Note that this is a conditional feature. See ConditionalFeature.SCENE3D for more information.

    An application should not extend the LightBase class directly. Doing so may lead to an UnsupportedOperationException being thrown.

    Since:
    JavaFX 8.0
    • Constructor Detail

      • LightBase

        protected LightBase()
        Creates a new instance of LightBase class with a default Color.WHITE light source.
      • LightBase

        protected LightBase​(Color color)
        Creates a new instance of LightBase class using the specified color.
        Parameters:
        color - the color of the light source
    • Method Detail

      • setColor

        public final void setColor​(Color value)
        Sets the value of the property color.
        Property description:
        Specifies the color of light source.
        Default value:
        null
      • getColor

        public final Color getColor()
        Gets the value of the property color.
        Property description:
        Specifies the color of light source.
        Default value:
        null
      • setLightOn

        public final void setLightOn​(boolean value)
        Sets the value of the property lightOn.
        Property description:
        Defines the light on or off.
        Default value:
        true
      • isLightOn

        public final boolean isLightOn()
        Gets the value of the property lightOn.
        Property description:
        Defines the light on or off.
        Default value:
        true
      • getScope

        public ObservableList<Node> getScope()
        Gets the list of nodes that specifies the hierarchical scope of this Light. If the scope list is empty, the Light node has universe scope: all nodes under it's scene are affected by it. If the scope list is non-empty, only those 3D Shape nodes in the scope list and under the Group nodes in the scope list are affected by this Light node.
        Returns:
        the list of nodes that specifies the hierarchical scope of this Light