- java.lang.Object
-
- com.flexganttfx.model.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
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BooleanProperty
deletableProperty()
The property used to define whether the layer can be deleted by the user or not.DoubleProperty
fadeInOutOpacityProperty()
The property used to store the temporary opacity of the layer while the layer is being made visible or hidden.double
getFadeInOutOpacity()
Returns the value offadeInOutOpacityProperty()
.String
getId()
Returns the value of theidProperty()
.String
getName()
Returns the value of thenameProperty()
.double
getOpacity()
Returns the value ofopacityProperty()
.StringProperty
idProperty()
The property used to store the id of the layer.boolean
isDeletable()
Returns the value ofdeletableProperty()
.boolean
isVisible()
Returns the value ofvisibleProperty()
.StringProperty
nameProperty()
The property used to store the name of the layer.DoubleProperty
opacityProperty()
The property used to store the opacity of the layer.void
setDeletable(boolean deletable)
Sets the value ofdeletableProperty()
.void
setFadeInOutOpacity(double opacity)
Sets the value offadeInOutOpacityProperty()
.void
setId(String id)
Sets the value of theidProperty()
.void
setName(String name)
Sets the value of thenameProperty()
.void
setOpacity(double opacity)
Sets the value of theopacityProperty()
.void
setVisible(boolean visible)
Sets the value ofvisibleProperty()
.String
toString()
BooleanProperty
visibleProperty()
The property used to store the visibility of the layer.
-
-
-
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 thenameProperty()
.- Parameters:
name
- the new name of the layer- Since:
- 1.0
-
getName
public final String getName()
Returns the value of thenameProperty()
.- 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 theidProperty()
.- Parameters:
id
- the new id of the layer- Since:
- 1.0
-
getId
public final String getId()
Returns the value of theidProperty()
.- 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 theopacityProperty()
.- Parameters:
opacity
- the new opacity of the layer- Since:
- 1.0
-
getOpacity
public final double getOpacity()
Returns the value ofopacityProperty()
.- 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 offadeInOutOpacityProperty()
.- Returns:
- the fade in / fade out opacity value
- Since:
- 1.0
-
setFadeInOutOpacity
public final void setFadeInOutOpacity(double opacity)
Sets the value offadeInOutOpacityProperty()
.- 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 ofvisibleProperty()
.- Returns:
- true if the layer is visible
- Since:
- 1.0
-
setVisible
public final void setVisible(boolean visible)
Sets the value ofvisibleProperty()
.- 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 ofdeletableProperty()
.- Returns:
- true if the layer can be deleted
- Since:
- 1.0
-
setDeletable
public final void setDeletable(boolean deletable)
Sets the value ofdeletableProperty()
.- Parameters:
deletable
- the new deletable value- Since:
- 1.0
-
-