Class Layer


  • public class Layer
    extends Object
    Layers are used to group activities together. Activities on the same layer are drawn at the same time (z-order). A layer has a name, an ID, it can be turned on / off, and their opacity can be changed. These changes have an impact on all activities on that layer.

    The ID of the layer is used for drag and drop operations of activities between different Gantt charts. Dropped activities will be added to the layer with the same ID. The layer name will be used as the default ID for newly created layers. The ID only needs to be changed if the same layer type will be used with different names in different Gantt charts.

    Since:
    1.0
    • Constructor Detail

      • Layer

        public Layer​(String name)
        Constructs a new layer with the given name.
        Parameters:
        name - the name of the layer
        Since:
        1.0
      • Layer

        public Layer()
        Constructs a new layer.
        Since:
        1.0
    • Method Detail

      • nameProperty

        public final StringProperty nameProperty()
        The property used to store the name of the layer.
        Returns:
        the name of the layer
        Since:
        1.0
      • setName

        public final void setName​(String name)
        Sets the value of the nameProperty().
        Parameters:
        name - the new name of the layer
        Since:
        1.0
      • getName

        public final String getName()
        Returns the value of the nameProperty().
        Returns:
        the layer name
        Since:
        1.0
      • idProperty

        public final StringProperty idProperty()
        The property used to store the id of the layer.
        Returns:
        the id of the layer
        Since:
        1.0
      • setId

        public final void setId​(String id)
        Sets the value of the idProperty().
        Parameters:
        id - the new id of the layer
        Since:
        1.0
      • getId

        public final String getId()
        Returns the value of the idProperty().
        Returns:
        the layer id
        Since:
        1.0
      • opacityProperty

        public final DoubleProperty opacityProperty()
        The property used to store the opacity of the layer.
        Returns:
        the layer opacity
        Since:
        1.0
      • setOpacity

        public final void setOpacity​(double opacity)
        Sets the value of the opacityProperty().
        Parameters:
        opacity - the new opacity of the layer
        Since:
        1.0
      • getOpacity

        public final double getOpacity()
        Returns the value of opacityProperty().
        Returns:
        the opacity of the layer
        Since:
        1.0
      • fadeInOutOpacityProperty

        public final DoubleProperty fadeInOutOpacityProperty()
        The property used to store the temporary opacity of the layer while the layer is being made visible or hidden. This property is needed for the animation that takes place while this is done.
        Returns:
        the fade in / fade out temporary opacity of the layer
        Since:
        1.0
      • getFadeInOutOpacity

        public final double getFadeInOutOpacity()
        Returns the value of fadeInOutOpacityProperty().
        Returns:
        the fade in / fade out opacity value
        Since:
        1.0
      • setFadeInOutOpacity

        public final void setFadeInOutOpacity​(double opacity)
        Sets the value of fadeInOutOpacityProperty().
        Parameters:
        opacity - the new opacity
        Since:
        1.0
      • visibleProperty

        public final BooleanProperty visibleProperty()
        The property used to store the visibility of the layer.
        Returns:
        the visibility of the layer
        Since:
        1.0
      • isVisible

        public final boolean isVisible()
        Returns the value of visibleProperty().
        Returns:
        true if the layer is visible
        Since:
        1.0
      • setVisible

        public final void setVisible​(boolean visible)
        Sets the value of visibleProperty().
        Parameters:
        visible - the new visibility of the layer
      • deletableProperty

        public final BooleanProperty deletableProperty()
        The property used to define whether the layer can be deleted by the user or not.
        Returns:
        true if the layer can be deleted
        Since:
        1.0
      • isDeletable

        public final boolean isDeletable()
        Returns the value of deletableProperty().
        Returns:
        true if the layer can be deleted
        Since:
        1.0
      • setDeletable

        public final void setDeletable​(boolean deletable)
        Sets the value of deletableProperty().
        Parameters:
        deletable - the new deletable value
        Since:
        1.0