FlexGanttFX Developer Manual : 3.4.1 System Layers

Introduction

System layers are used in the background and foreground of each row. A background layer gets drawn before the activities are drawn while a foreground layer gets drawn after the activities are drawn. Each layer is specialized on drawing one type of information: current time, selected time intervals, grid lines, and so on. The graphics view manages the layers in two lists and provides convenience methods to easily look them up.

Method Description
getBackgroundSystemLayers()
Returns the complete list of system layers used in the background of activities.
getForegroundSystemLayers()
Returns the complete list of system layers used in the foreground of activities.
getBackgroundSystemLayer(Class)
Returns the system background layer instance of the given type.
getForegroundSystemLayer(Class)
Returns the system foreground layer instance of the given type.
getSystemLayer(Class)
Returns the system layer instance of the given type, no matter if it is a foreground or background layer.
  • Layers can be added to or removed from the graphics view by adding them to or removing them from the foreground or background list.
  • Once you have looked up a layer you can set its properties to customize its appearance. The most common properties are used for line colors and widths.
System Layer Example
GraphicsBase<?> graphics = ganttChart.getGraphics();
NowLineLayer nowLayer = graphics.getBackgroundSystemLayer(NowLineLayer .class);
nowLayer.setStroke(Color.ORANGE);
nowLayer.setLineWidth(3); // thick line

System Layers vs. Model Layers

Please note that system layers are not related in any way to model layers. A system layer is basically a renderer for some graphical feedback while a model layer is used for grouping activities.

Available Layers

The following table lists all system layers that are shipping with FlexGanttFX. The last two columns (FG, BG) are used to indicate whether the layer is used as a foreground or as a background layer.

Layer Description FG BG
AgendaLinesLayer Draws the horizontal grid lines for a row if the row or any of its inner lines are using the agenda layout.
(tick)
CalendarLayer Draws the entries returned by the calendars attached to a row or attached to the entire graphics view. The calendar layer uses pluggable renderers that are mapped to the entry types. Applications can register their own renderers by calling CalendarLayer.setCalendarActivityRenderer().
(tick)
ChartLinesLayer Draws the horizontal grid lines for a row if the row or any of its inner lines are using the chart layout.
(tick)
DSTLineLayer Draws a vertical line at the time when the daylight saving time changes.
(tick)
GridLinesLayer Draws the vertical grid lines based on the scale resolutions currently present in the dateline. The layer can be configured to display 0 to 3 grid line levels. If the dateline is, for example, showing days and weeks then a level of 2 would cause the layer to draw grid lines for days and weeks, while a grid line level of 1 would only render grid lines for days.
(tick)
HoverTimeIntervalLayer Draws the hover time interval specified by the dateline. If the mouse cursor hovers over a week in the dateline then the layer will fill the time interval defined by this week with a highlighting color.
(tick)
InnerLinesLayer

Draws separator lines between inner lines.

By default the line width property of this layer is set to 0 and the lines will not be drawn at all. To change this simply set a line width greater than 0.


(tick)
LayoutLayer Draws the layout padding areas. Each layout may have some padding added to its top and bottom. This layer fills the padding area with a solid color. (tick)
NowLineLayer Draws a vertical line at the location of the current time / now time. The current time is defined in the timeline model.
(tick)
RowLayer Draws the background of each row. The layer can be configured with pluggable renderers that are mapped to the type of the row. Applications can register their own renderers by calling RowLayer.setRowRenderer(). For more information please read 3.4.7 Row Rendering.
(tick)
ScaleLayer Draws a scale for an entire row or for each line within the row. Scales vary depending on the layout used for the row / line. The scale for the chart layout displays the minimum and maximum values while the scale for the agenda layout displays a time scale (8am, 9am, 10am, .....). The labels and dashes in the scale layer have to align perfectly with the lines drawn by the agenda lines layer and the chart lines layer. (tick)
SelectedTimeIntervalsLayer Draws the time intervals that were selected by the user (or the application) in the dateline.
(tick)
ZoomIntervalLayer Draws the zoom interval as defined by the timeline. The zoom interval gets created by the user via the help of the timeline lasso.
(tick)