- java.lang.Object
-
- javafx.scene.Node
-
- javafx.scene.Parent
-
- javafx.scene.layout.Region
-
- javafx.scene.control.Control
-
- com.flexganttfx.view.util.FlexGanttFXControl
-
- com.flexganttfx.view.timeline.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 (seesetZoneId(ZoneId)
), keeps track of currently selected time intervals (getSelectedIntervals()
) and fires events of typeDatelineScrollingEvent
whenever the visible time range changes (seesetOnVisibleRangeChanged(EventHandler)
). Furthermore the dateline control constantly updates thehoverTimeIntervalProperty()
whenever the mouse moves over it.- Since:
- 1.0
-
-
Field Summary
-
Fields inherited from class javafx.scene.layout.Region
USE_COMPUTED_SIZE, USE_PREF_SIZE
-
Fields inherited from class javafx.scene.Node
BASELINE_OFFSET_SAME_AS_HEIGHT
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Skin<?>
createDefaultSkin()
ObjectProperty<DayOfWeek>
firstDayOfWeekProperty()
A property used to store the weekday that is considered the "first day of the week".ObservableList<Calendar<?>>
getCalendars()
An observable list of calendars associated with the dateline.Callback<TemporalUnit,DatelineCell>
getCellFactory(Class<? extends TemporalUnit> temporalUnitType)
Returns the cell factory used for the given temporal unit type (e.g.DayOfWeek
getFirstDayOfWeek()
Returns the value offirstDayOfWeekProperty()
.TimeInterval
getHoverTimeInterval()
Returns the value ofhoverTimeIntervalProperty()
.DatelineModel<? extends TemporalUnit>
getModel()
Returns the value ofmodelProperty()
.EventHandler<DatelineScrollingEvent>
getOnVisibleRangeChanged()
Returns the value ofonVisibleRangeChangedProperty()
.TemporalUnit
getPrimaryTemporalUnit()
Returns the value ofprimaryTemporalUnitProperty()
.List<org.controlsfx.control.PropertySheet.Item>
getPropertySheetItems()
ObservableList<Resolution<?>>
getScaleResolutions()
An observable list of the currently displayed resolutions within the various scales of the dateline.ObservableList<TimeInterval>
getSelectedIntervals()
An observable list of the currently selected time intervals.TimeInterval
getSelectedTimeInterval()
Returns the value ofselectedTimeIntervalProperty()
.SelectionMode
getSelectionMode()
Returns the value ofselectionModeProperty()
.Timeline
getTimeline()
Returns the parent timeline container / node.String
getUserAgentStylesheet()
ZoneId
getZoneId()
Returns the value ofzoneIdProperty()
.ReadOnlyObjectProperty<TimeInterval>
hoverTimeIntervalProperty()
A read-only property that can be used to find out the time shown at the current mouse hover location.boolean
isZoneIdVisible()
Returns the value of thezoneIdVisibleProperty()
.boolean
isZoomLassoEnabled()
Returns the value ofzoomLassoEnabledProperty()
.ObjectProperty<DatelineModel<? extends TemporalUnit>>
modelProperty()
A property used to store the model of the dateline control.ObjectProperty<EventHandler<DatelineScrollingEvent>>
onVisibleRangeChangedProperty()
A property used to register an event handler that will be invoked whenever the currently visible time range is changing inside the dateline.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.ReadOnlyObjectProperty<TimeInterval>
selectedTimeIntervalProperty()
A read-only property used to store the currently selected time interval.ObjectProperty<SelectionMode>
selectionModeProperty()
A property used to store the selection mode applied by the dateline when the user adds time interval selections.<T extends TemporalUnit>
voidsetCellFactory(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.void
setFirstDayOfWeek(DayOfWeek day)
Sets the value offirstDayOfWeekProperty()
.void
setModel(DatelineModel<? extends TemporalUnit> model)
Sets the value ofmodelProperty()
.void
setOnVisibleRangeChanged(EventHandler<DatelineScrollingEvent> handler)
Sets the value ofonVisibleRangeChangedProperty()
.void
setSelectionMode(SelectionMode mode)
Sets the value ofselectionModeProperty()
.void
setZoneId(ZoneId zoneId)
Sets the value ofzoneIdProperty()
.void
setZoneIdVisible(boolean visible)
Sets the value of thezoneIdVisibleProperty()
.void
setZoomLassoEnabled(boolean enabled)
Sets the value ofzoomLassoEnabledProperty()
.ObjectProperty<ZoneId>
zoneIdProperty()
A property used to store the time zone that is currently shown by the dateline.BooleanProperty
zoneIdVisibleProperty()
A property used to control the visibility of the time zone name.BooleanProperty
zoomLassoEnabledProperty()
A property used to control whether the zoom lasso feature will be available to the user or not.-
Methods inherited from class com.flexganttfx.view.util.FlexGanttFXControl
getUserAgentStylesheet
-
Methods inherited from class javafx.scene.control.Control
computeMaxHeight, computeMaxWidth, computeMinHeight, computeMinWidth, computePrefHeight, computePrefWidth, contextMenuProperty, executeAccessibleAction, getBaselineOffset, getClassCssMetaData, getContextMenu, getControlCssMetaData, getCssMetaData, getInitialFocusTraversable, getSkin, getTooltip, isResizable, layoutChildren, queryAccessibleAttribute, setContextMenu, setSkin, setTooltip, skinProperty, tooltipProperty
-
Methods inherited from class javafx.scene.layout.Region
backgroundProperty, borderProperty, cacheShapeProperty, centerShapeProperty, getBackground, getBorder, getHeight, getInsets, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getOpaqueInsets, getPadding, getPrefHeight, getPrefWidth, getShape, getWidth, heightProperty, insetsProperty, isCacheShape, isCenterShape, isScaleShape, isSnapToPixel, layoutInArea, layoutInArea, layoutInArea, layoutInArea, maxHeight, maxHeightProperty, maxWidth, maxWidthProperty, minHeight, minHeightProperty, minWidth, minWidthProperty, opaqueInsetsProperty, paddingProperty, positionInArea, positionInArea, prefHeight, prefHeightProperty, prefWidth, prefWidthProperty, resize, scaleShapeProperty, setBackground, setBorder, setCacheShape, setCenterShape, setHeight, setMaxHeight, setMaxSize, setMaxWidth, setMinHeight, setMinSize, setMinWidth, setOpaqueInsets, setPadding, setPrefHeight, setPrefSize, setPrefWidth, setScaleShape, setShape, setSnapToPixel, setWidth, shapeProperty, snappedBottomInset, snappedLeftInset, snappedRightInset, snappedTopInset, snapPosition, snapPositionX, snapPositionY, snapSize, snapSizeX, snapSizeY, snapSpace, snapSpaceX, snapSpaceY, snapToPixelProperty, widthProperty
-
Methods inherited from class javafx.scene.Parent
getChildren, getChildrenUnmodifiable, getManagedChildren, getStylesheets, isNeedsLayout, layout, lookup, needsLayoutProperty, requestLayout, requestParentLayout, setNeedsLayout, updateBounds
-
Methods inherited from class javafx.scene.Node
accessibleHelpProperty, accessibleRoleDescriptionProperty, accessibleRoleProperty, accessibleTextProperty, addEventFilter, addEventHandler, applyCss, autosize, blendModeProperty, boundsInLocalProperty, boundsInParentProperty, buildEventDispatchChain, cacheHintProperty, cacheProperty, clipProperty, computeAreaInScreen, contains, contains, cursorProperty, depthTestProperty, disabledProperty, disableProperty, effectiveNodeOrientationProperty, effectProperty, eventDispatcherProperty, fireEvent, focusedProperty, focusTraversableProperty, getAccessibleHelp, getAccessibleRole, getAccessibleRoleDescription, getAccessibleText, getBlendMode, getBoundsInLocal, getBoundsInParent, getCacheHint, getClip, getContentBias, getCursor, getDepthTest, getEffect, getEffectiveNodeOrientation, getEventDispatcher, getId, getInitialCursor, getInputMethodRequests, getLayoutBounds, getLayoutX, getLayoutY, getLocalToParentTransform, getLocalToSceneTransform, getNodeOrientation, getOnContextMenuRequested, getOnDragDetected, getOnDragDone, getOnDragDropped, getOnDragEntered, getOnDragExited, getOnDragOver, getOnInputMethodTextChanged, getOnKeyPressed, getOnKeyReleased, getOnKeyTyped, getOnMouseClicked, getOnMouseDragEntered, getOnMouseDragExited, getOnMouseDragged, getOnMouseDragOver, getOnMouseDragReleased, getOnMouseEntered, getOnMouseExited, getOnMouseMoved, getOnMousePressed, getOnMouseReleased, getOnRotate, getOnRotationFinished, getOnRotationStarted, getOnScroll, getOnScrollFinished, getOnScrollStarted, getOnSwipeDown, getOnSwipeLeft, getOnSwipeRight, getOnSwipeUp, getOnTouchMoved, getOnTouchPressed, getOnTouchReleased, getOnTouchStationary, getOnZoom, getOnZoomFinished, getOnZoomStarted, getOpacity, getParent, getProperties, getPseudoClassStates, getRotate, getRotationAxis, getScaleX, getScaleY, getScaleZ, getScene, getStyle, getStyleableParent, getStyleClass, getTransforms, getTranslateX, getTranslateY, getTranslateZ, getTypeSelector, getUserData, getViewOrder, hasProperties, hoverProperty, idProperty, inputMethodRequestsProperty, intersects, intersects, isCache, isDisable, isDisabled, isFocused, isFocusTraversable, isHover, isManaged, isMouseTransparent, isPickOnBounds, isPressed, isVisible, layoutBoundsProperty, layoutXProperty, layoutYProperty, localToParent, localToParent, localToParent, localToParent, localToParent, localToParentTransformProperty, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToSceneTransformProperty, localToScreen, localToScreen, localToScreen, localToScreen, localToScreen, lookupAll, managedProperty, mouseTransparentProperty, nodeOrientationProperty, notifyAccessibleAttributeChanged, onContextMenuRequestedProperty, onDragDetectedProperty, onDragDoneProperty, onDragDroppedProperty, onDragEnteredProperty, onDragExitedProperty, onDragOverProperty, onInputMethodTextChangedProperty, onKeyPressedProperty, onKeyReleasedProperty, onKeyTypedProperty, onMouseClickedProperty, onMouseDragEnteredProperty, onMouseDragExitedProperty, onMouseDraggedProperty, onMouseDragOverProperty, onMouseDragReleasedProperty, onMouseEnteredProperty, onMouseExitedProperty, onMouseMovedProperty, onMousePressedProperty, onMouseReleasedProperty, onRotateProperty, onRotationFinishedProperty, onRotationStartedProperty, onScrollFinishedProperty, onScrollProperty, onScrollStartedProperty, onSwipeDownProperty, onSwipeLeftProperty, onSwipeRightProperty, onSwipeUpProperty, onTouchMovedProperty, onTouchPressedProperty, onTouchReleasedProperty, onTouchStationaryProperty, onZoomFinishedProperty, onZoomProperty, onZoomStartedProperty, opacityProperty, parentProperty, parentToLocal, parentToLocal, parentToLocal, parentToLocal, parentToLocal, pickOnBoundsProperty, pressedProperty, pseudoClassStateChanged, relocate, removeEventFilter, removeEventHandler, requestFocus, resizeRelocate, rotateProperty, rotationAxisProperty, scaleXProperty, scaleYProperty, scaleZProperty, sceneProperty, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, screenToLocal, screenToLocal, screenToLocal, setAccessibleHelp, setAccessibleRole, setAccessibleRoleDescription, setAccessibleText, setBlendMode, setCache, setCacheHint, setClip, setCursor, setDepthTest, setDisable, setDisabled, setEffect, setEventDispatcher, setEventHandler, setFocused, setFocusTraversable, setHover, setId, setInputMethodRequests, setLayoutX, setLayoutY, setManaged, setMouseTransparent, setNodeOrientation, setOnContextMenuRequested, setOnDragDetected, setOnDragDone, setOnDragDropped, setOnDragEntered, setOnDragExited, setOnDragOver, setOnInputMethodTextChanged, setOnKeyPressed, setOnKeyReleased, setOnKeyTyped, setOnMouseClicked, setOnMouseDragEntered, setOnMouseDragExited, setOnMouseDragged, setOnMouseDragOver, setOnMouseDragReleased, setOnMouseEntered, setOnMouseExited, setOnMouseMoved, setOnMousePressed, setOnMouseReleased, setOnRotate, setOnRotationFinished, setOnRotationStarted, setOnScroll, setOnScrollFinished, setOnScrollStarted, setOnSwipeDown, setOnSwipeLeft, setOnSwipeRight, setOnSwipeUp, setOnTouchMoved, setOnTouchPressed, setOnTouchReleased, setOnTouchStationary, setOnZoom, setOnZoomFinished, setOnZoomStarted, setOpacity, setPickOnBounds, setPressed, setRotate, setRotationAxis, setScaleX, setScaleY, setScaleZ, setStyle, setTranslateX, setTranslateY, setTranslateZ, setUserData, setViewOrder, setVisible, snapshot, snapshot, startDragAndDrop, startFullDrag, styleProperty, toBack, toFront, toString, translateXProperty, translateYProperty, translateZProperty, usesMirroring, viewOrderProperty, visibleProperty
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface javafx.css.Styleable
getStyleableNode
-
-
-
-
Constructor Detail
-
Dateline
protected Dateline(Timeline timeline)
Constructs a new dateline.- Parameters:
timeline
- the parent timeline- Since:
- 1.0
-
-
Method Detail
-
createDefaultSkin
protected Skin<?> createDefaultSkin()
- Overrides:
createDefaultSkin
in classControl
-
getUserAgentStylesheet
public String getUserAgentStylesheet()
- Overrides:
getUserAgentStylesheet
in classRegion
-
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.- Returns:
- the currently selected time interval
- Since:
- 1.0
-
getSelectedTimeInterval
public final TimeInterval getSelectedTimeInterval()
Returns the value ofselectedTimeIntervalProperty()
.- 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.- Returns:
- true if the zoom lasso is enabled
- Since:
- 1.0
-
isZoomLassoEnabled
public final boolean isZoomLassoEnabled()
Returns the value ofzoomLassoEnabledProperty()
.- Returns:
- true if the zoom lasso is enabled
- Since:
- 1.0
-
setZoomLassoEnabled
public final void setZoomLassoEnabled(boolean enabled)
Sets the value ofzoomLassoEnabledProperty()
.- 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
-
onVisibleRangeChangedProperty
public final ObjectProperty<EventHandler<DatelineScrollingEvent>> onVisibleRangeChangedProperty()
A property used to register an event handler that will be invoked whenever the currently visible time range is changing inside the dateline.- Returns:
- the event handler registered for range changes
- Since:
- 1.0
-
setOnVisibleRangeChanged
public final void setOnVisibleRangeChanged(EventHandler<DatelineScrollingEvent> handler)
Sets the value ofonVisibleRangeChangedProperty()
.- Parameters:
handler
- the event handler for time range changes- Since:
- 1.0
-
getOnVisibleRangeChanged
public final EventHandler<DatelineScrollingEvent> getOnVisibleRangeChanged()
Returns the value ofonVisibleRangeChangedProperty()
.- Returns:
- the event handler for time range changes
- 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.- Returns:
- the dateline model
- Since:
- 1.0
-
getModel
public final DatelineModel<? extends TemporalUnit> getModel()
Returns the value ofmodelProperty()
.- Returns:
- the dateline model
- Since:
- 1.0
-
setModel
public final void setModel(DatelineModel<? extends TemporalUnit> model)
Sets the value ofmodelProperty()
.- 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).- Returns:
- the first day of week
- Since:
- 1.1
-
getFirstDayOfWeek
public final DayOfWeek getFirstDayOfWeek()
Returns the value offirstDayOfWeekProperty()
.- Returns:
- the first day of week
- Since:
- 1.1
-
setFirstDayOfWeek
public final void setFirstDayOfWeek(DayOfWeek day)
Sets the value offirstDayOfWeekProperty()
.- 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.- Returns:
- the time zone ID
- Since:
- 1.0
-
getZoneId
public final ZoneId getZoneId()
Returns the value ofzoneIdProperty()
.- Returns:
- the time zone ID
- Since:
- 1.0
-
setZoneId
public final void setZoneId(ZoneId zoneId)
Sets the value ofzoneIdProperty()
.- Parameters:
zoneId
- the time zone ID- Since:
- 1.0
-
zoneIdVisibleProperty
public final BooleanProperty zoneIdVisibleProperty()
A property used to control the visibility of the time zone name. The dateline is capable of displaying the time zone that it represents in its upper right corner.- Returns:
- true if the time zone ID shall be visible
- Since:
- 1.0
-
isZoneIdVisible
public final boolean isZoneIdVisible()
Returns the value of thezoneIdVisibleProperty()
.- Returns:
- true if the time zone ID shall be shown to the user
- Since:
- 1.0
-
setZoneIdVisible
public final void setZoneIdVisible(boolean visible)
Sets the value of thezoneIdVisibleProperty()
.- Parameters:
visible
- true if the time zone ID shall be shown to the user- 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".- Returns:
- the currently shown primary temporal unit
- Since:
- 1.0
-
getPrimaryTemporalUnit
public final TemporalUnit getPrimaryTemporalUnit()
Returns the value ofprimaryTemporalUnitProperty()
.- 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.- Returns:
- the time point at the mouse cursor location
- Since:
- 1.0
-
getHoverTimeInterval
public final TimeInterval getHoverTimeInterval()
Returns the value ofhoverTimeIntervalProperty()
.- 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 theselectedTimeIntervalProperty()
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.- Returns:
- the current selection mode (single, multi)
- Since:
- 1.0
-
setSelectionMode
public final void setSelectionMode(SelectionMode mode)
Sets the value ofselectionModeProperty()
.- Parameters:
mode
- the selection mode (single, multi)- Since:
- 1.0
-
getSelectionMode
public final SelectionMode getSelectionMode()
Returns the value ofselectionModeProperty()
.- Returns:
- the selection mode (single, multi)
- Since:
- 1.0
-
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()
-
getPropertySheetItems
public final List<org.controlsfx.control.PropertySheet.Item> getPropertySheetItems()
-
-