Class Dateline

All Implemented Interfaces:
Styleable, EventTarget, Skinnable

public class Dateline
extends FlexGanttFXControl
The dateline is a control that displays the actual dates (Mo, Tu, We, ...) in cells in one or more rows. The dateline is timezone aware (see setZoneId(ZoneId)) and keeps track of currently selected time intervals (getSelectedIntervals()). Furthermore the dateline control constantly updates the hoverTimeIntervalProperty() whenever the mouse moves over it.

 

Dateline
Since:
1.0
  • Property Details

    • selectedTimeInterval

      public final ReadOnlyObjectProperty<TimeInterval> selectedTimeIntervalProperty
      A read-only property used to store the currently selected time interval. The value of this property gets updated whenever the user performs a time interval selection by dragging the mouse inside the timeline.
      Since:
      1.0
      See Also:
      getSelectedTimeInterval()
    • zoomLassoEnabled

      public final BooleanProperty zoomLassoEnabledProperty
      A property used to control whether the zoom lasso feature will be available to the user or not. The zoom lasso allows the user to select a time range inside the dateline so that the dateline will zoom in as much as needed in order to make the range completely fill the visible area.
      Since:
      1.0
      See Also:
      isZoomLassoEnabled(), setZoomLassoEnabled(boolean)
    • model

      public final ObjectProperty<DatelineModel<? extends TemporalUnit>> modelProperty
      A property used to store the model of the dateline control. The model provides information about the list of supported resolutions, available time zones, number of scales inside the dateline.
      Since:
      1.0
      See Also:
      getModel(), setModel(DatelineModel)
    • firstDayOfWeek

      public final ObjectProperty<DayOfWeek> firstDayOfWeekProperty
      A property used to store the weekday that is considered the "first day of the week". In Germany the first day of the week is "Monday", in the US it is "Sunday". This is, for example, relevant for displaying grid lines correctly (between weeks).
      Since:
      1.1
      See Also:
      getFirstDayOfWeek(), setFirstDayOfWeek(DayOfWeek)
    • zoneId

      public final ObjectProperty<ZoneId> zoneIdProperty
      A property used to store the time zone that is currently shown by the dateline. In this framework the dateline and each row can have their own time zones.
      Since:
      1.0
      See Also:
      getZoneId(), setZoneId(ZoneId)
    • primaryTemporalUnit

      public final ReadOnlyObjectProperty<TemporalUnit> primaryTemporalUnitProperty
      A read-only property used to store the "primary" temporal unit, which is the unit shown at the bottom of the dateline. Example: the dateline shows "Year / Month" at the top and "Days" at the bottom. In this case "Days" will be the primary temporal unit. The primary temporal unit is always passed to the activity repositories when querying for the activities inside the visible time range. This allows the repository to return more or less activities. Example: calendars can decide to not return weekend days if the user is currently looking at "Years".
      Since:
      1.0
      See Also:
      getPrimaryTemporalUnit()
    • hoverTimeInterval

      public final ReadOnlyObjectProperty<TimeInterval> hoverTimeIntervalProperty
      A read-only property that can be used to find out the time shown at the current mouse hover location.
      Since:
      1.0
      See Also:
      getHoverTimeInterval()
    • selectionMode

      public final ObjectProperty<SelectionMode> selectionModeProperty
      A property used to store the selection mode applied by the dateline when the user adds time interval selections. The value of this property enables the application to switch between a single selection model and a multi selection model.
      Since:
      1.0
      See Also:
      getSelectionMode(), setSelectionMode(SelectionMode)
    • datelineBuffer

      public DoubleProperty datelineBufferProperty
      See Also:
      getDatelineBuffer(), setDatelineBuffer(double)
  • Constructor Details

    • Dateline

      protected Dateline​(Timeline timeline)
      Constructs a new dateline.
      Parameters:
      timeline - the parent timeline
      Since:
      1.0
  • Method Details

    • createDefaultSkin

      protected Skin<?> createDefaultSkin()
      Overrides:
      createDefaultSkin in class Control
    • getUserAgentStylesheet

      public String getUserAgentStylesheet()
      Overrides:
      getUserAgentStylesheet in class Region
    • selectedTimeIntervalProperty

      public final ReadOnlyObjectProperty<TimeInterval> selectedTimeIntervalProperty()
      A read-only property used to store the currently selected time interval. The value of this property gets updated whenever the user performs a time interval selection by dragging the mouse inside the timeline.
      Since:
      1.0
      See Also:
      getSelectedTimeInterval()
    • getSelectedTimeInterval

      public final TimeInterval getSelectedTimeInterval()
      Returns the value of selectedTimeIntervalProperty().
      Returns:
      the currently selected time interval
      Since:
      1.0
    • zoomLassoEnabledProperty

      public final BooleanProperty zoomLassoEnabledProperty()
      A property used to control whether the zoom lasso feature will be available to the user or not. The zoom lasso allows the user to select a time range inside the dateline so that the dateline will zoom in as much as needed in order to make the range completely fill the visible area.
      Since:
      1.0
      See Also:
      isZoomLassoEnabled(), setZoomLassoEnabled(boolean)
    • isZoomLassoEnabled

      public final boolean isZoomLassoEnabled()
      Returns the value of zoomLassoEnabledProperty().
      Returns:
      true if the zoom lasso is enabled
      Since:
      1.0
    • setZoomLassoEnabled

      public final void setZoomLassoEnabled​(boolean enabled)
      Sets the value of zoomLassoEnabledProperty().
      Parameters:
      enabled - if true then the zoom lasso is enabled
      Since:
      1.0
    • setCellFactory

      public final <T extends TemporalUnit> void setCellFactory​(Class<T> temporalUnitType, Callback<T,​DatelineCell<T>> factory)
      Sets a cell factory on the dateline used to create dateline cells for the given temporal unit type (e.g. ChronoUnit, SimpleUnit).
      Type Parameters:
      T - the type of the temporal unit (e.g. ChronoUnit)
      Parameters:
      temporalUnitType - the type of the temporal unit (e.g. ChronoUnit)
      factory - the factory used for creating new cells
      Since:
      1.0
    • getCellFactory

      public final Callback<TemporalUnit,​DatelineCell> getCellFactory​(Class<? extends TemporalUnit> temporalUnitType)
      Returns the cell factory used for the given temporal unit type (e.g. ChronoUnit).
      Parameters:
      temporalUnitType - the type of the temporal unit (e.g. ChronoUnit)
      Returns:
      the factory callback
      Since:
      1.0
    • getTimeline

      public final Timeline getTimeline()
      Returns the parent timeline container / node.
      Returns:
      the parent timeline
      Since:
      1.0
    • modelProperty

      public final ObjectProperty<DatelineModel<? extends TemporalUnit>> modelProperty()
      A property used to store the model of the dateline control. The model provides information about the list of supported resolutions, available time zones, number of scales inside the dateline.
      Since:
      1.0
      See Also:
      getModel(), setModel(DatelineModel)
    • getModel

      public final DatelineModel<? extends TemporalUnit> getModel()
      Returns the value of modelProperty().
      Returns:
      the dateline model
      Since:
      1.0
    • setModel

      public final void setModel​(DatelineModel<? extends TemporalUnit> model)
      Sets the value of modelProperty().
      Parameters:
      model - the dateline model
      Since:
      1.0
    • firstDayOfWeekProperty

      public final ObjectProperty<DayOfWeek> firstDayOfWeekProperty()
      A property used to store the weekday that is considered the "first day of the week". In Germany the first day of the week is "Monday", in the US it is "Sunday". This is, for example, relevant for displaying grid lines correctly (between weeks).
      Since:
      1.1
      See Also:
      getFirstDayOfWeek(), setFirstDayOfWeek(DayOfWeek)
    • getFirstDayOfWeek

      public final DayOfWeek getFirstDayOfWeek()
      Returns the value of firstDayOfWeekProperty().
      Returns:
      the first day of week
      Since:
      1.1
    • setFirstDayOfWeek

      public final void setFirstDayOfWeek​(DayOfWeek day)
      Sets the value of firstDayOfWeekProperty().
      Parameters:
      day - the first day of week
      Since:
      1.1
    • zoneIdProperty

      public final ObjectProperty<ZoneId> zoneIdProperty()
      A property used to store the time zone that is currently shown by the dateline. In this framework the dateline and each row can have their own time zones.
      Since:
      1.0
      See Also:
      getZoneId(), setZoneId(ZoneId)
    • getZoneId

      public final ZoneId getZoneId()
      Returns the value of zoneIdProperty().
      Returns:
      the time zone ID
      Since:
      1.0
    • setZoneId

      public final void setZoneId​(ZoneId zoneId)
      Sets the value of zoneIdProperty().
      Parameters:
      zoneId - the time zone ID
      Since:
      1.0
    • primaryTemporalUnitProperty

      public final ReadOnlyObjectProperty<TemporalUnit> primaryTemporalUnitProperty()
      A read-only property used to store the "primary" temporal unit, which is the unit shown at the bottom of the dateline. Example: the dateline shows "Year / Month" at the top and "Days" at the bottom. In this case "Days" will be the primary temporal unit. The primary temporal unit is always passed to the activity repositories when querying for the activities inside the visible time range. This allows the repository to return more or less activities. Example: calendars can decide to not return weekend days if the user is currently looking at "Years".
      Since:
      1.0
      See Also:
      getPrimaryTemporalUnit()
    • getPrimaryTemporalUnit

      public final TemporalUnit getPrimaryTemporalUnit()
      Returns the value of primaryTemporalUnitProperty().
      Returns:
      the currently shown primary temporal unit
      Since:
      1.0
    • hoverTimeIntervalProperty

      public final ReadOnlyObjectProperty<TimeInterval> hoverTimeIntervalProperty()
      A read-only property that can be used to find out the time shown at the current mouse hover location.
      Since:
      1.0
      See Also:
      getHoverTimeInterval()
    • getHoverTimeInterval

      public final TimeInterval getHoverTimeInterval()
      Returns the value of hoverTimeIntervalProperty().
      Returns:
      the time at the current mouse location
      Since:
      1.0
    • getSelectedIntervals

      public final ObservableList<TimeInterval> getSelectedIntervals()
      An observable list of the currently selected time intervals. This list is the "selection model" of the dateline. The difference to the selectedTimeIntervalProperty() is that these selections are permanent while the single selected time interval is only used to highlight a section within the dateline for zoom in / out operations. This list of selected time intervals however represents days or weeks that the user clicked on while pressing the command key (on Mac) or the CTRL key (on Windows / Linux).
      Returns:
      the list of selected time intervals
      Since:
      1.0
    • selectionModeProperty

      public final ObjectProperty<SelectionMode> selectionModeProperty()
      A property used to store the selection mode applied by the dateline when the user adds time interval selections. The value of this property enables the application to switch between a single selection model and a multi selection model.
      Since:
      1.0
      See Also:
      getSelectionMode(), setSelectionMode(SelectionMode)
    • setSelectionMode

      public final void setSelectionMode​(SelectionMode mode)
      Sets the value of selectionModeProperty().
      Parameters:
      mode - the selection mode (single, multi)
      Since:
      1.0
    • getSelectionMode

      public final SelectionMode getSelectionMode()
      Returns the value of selectionModeProperty().
      Returns:
      the selection mode (single, multi)
      Since:
      1.0
    • getDatelineBuffer

      public double getDatelineBuffer()
      Gets the value of the property datelineBuffer.
      Property description:
    • datelineBufferProperty

      public DoubleProperty datelineBufferProperty()
      See Also:
      getDatelineBuffer(), setDatelineBuffer(double)
    • setDatelineBuffer

      public void setDatelineBuffer​(double datelineBuffer)
      Sets the value of the property datelineBuffer.
      Property description:
    • getCalendars

      public final ObservableList<Calendar<?>> getCalendars()
      An observable list of calendars associated with the dateline. Information provided by the calendars can be used by the dateline to visualize events directly inside of it (e.g. national holidays).
      Returns:
      the list of calendars attached to the dateline
      Since:
      1.0
    • getScaleResolutions

      public final ObservableList<Resolution<?>> getScaleResolutions()
      An observable list of the currently displayed resolutions within the various scales of the dateline. Example: when the dateline displays "Month" at the top, "Days" in the middle, and "Hours" at the bottom, then the list will have three entries, each entry representing the resolution of its scale.
      Returns:
      the list of currently showing resolutions
      Since:
      1.0
      See Also:
      DatelineModel.getResolutions()