public class Timeline extends FlexGanttFXControl
Dateline
and the
Eventline
. It is displayed above the GraphicsBase
and
provides several methods for scrolling and zooming, both of which can be done
in an animated way (default) or not.
GanttChartBase.getTimeline()
,
setMoveAnimated(boolean)
,
setZoomAnimated(boolean)
Modifier and Type | Class and Description |
---|---|
static class |
Timeline.ZoomMode
An enum used to control the way that zooming operations will happen.
|
Constructor and Description |
---|
Timeline()
Constructs a new timeline control that is using the
ChronoUnitTimelineModel . |
Modifier and Type | Method and Description |
---|---|
protected javafx.scene.control.Skin<?> |
createDefaultSkin() |
Dateline |
getDateline()
Returns the dateline contained within the timeline.
|
Eventline |
getEventline()
Returns the eventline contained within the timeline.
|
TimelineModel<?> |
getModel()
Returns the value of
modelProperty() . |
javafx.util.Duration |
getMoveDuration()
Returns the value of
moveDurationProperty() . |
double |
getOffset() |
String |
getUserAgentStylesheet() |
Duration |
getVisibleDuration()
Calculates and returns the duration of the visible time interval inside the
timeline.
|
Instant |
getVisibleEndTime()
Returns the value of
visibleEndTimeProperty() . |
Instant |
getVisibleStartTime()
Returns the value of
visibleStartTimeProperty() . |
TimeInterval |
getVisibleTimeInterval() |
javafx.util.Duration |
getZoomDuration()
Returns the value of
zoomDurationProperty() . |
double |
getZoomFactor()
Returns the value of the
zoomFactorProperty() . |
Timeline.ZoomMode |
getZoomMode()
Returns the value of
zoomModeProperty() . |
boolean |
isMoveAnimated()
Returns the value of
moveAnimatedProperty() . |
boolean |
isScrollDragEnabled()
Returns the value of
scrollDragEnabledProperty() . |
boolean |
isZoneIdVisible()
Returns the value of the
zoneIdVisibleProperty() . |
boolean |
isZoomAnimated()
Returns the value of
zoomAnimatedProperty() . |
javafx.beans.property.ObjectProperty<TimelineModel<?>> |
modelProperty()
Stores the timeline model to be used by the timeline.
|
javafx.beans.property.BooleanProperty |
moveAnimatedProperty()
A boolean property used to control whether moving from one time to another
will happen animated or not.
|
javafx.beans.property.ObjectProperty<javafx.util.Duration> |
moveDurationProperty()
An object property used to store the duration used for the animation of a
"move" inside the timeline.
|
javafx.beans.property.DoubleProperty |
offsetProperty()
Determines an optional offset added to time calculations and timeline layout that
might be required if for example the graphics area below the timeline does not align
properly with the timeline.
|
javafx.beans.property.BooleanProperty |
scrollDragEnabledProperty()
A property used to control whether the user is allowed to perform a horizontal scroll
by dragging the timeline.
|
void |
scrollLeft()
Performs a left scroll inside the timeline, meaning that earlier times will become visible.
|
void |
scrollLeftFast()
Performs a fast left scroll inside the timeline, meaning that earlier times will become visible.
|
void |
scrollRight()
Performs a right scroll inside the timeline, meaning that later times will become visible.
|
void |
scrollRightFast()
Performs a fast right scroll inside the timeline, meaning that later times will become visible.
|
void |
setModel(TimelineModel<?> model)
Sets the value of
modelProperty() . |
void |
setMoveAnimated(boolean animated)
Sets the value of
moveAnimatedProperty() . |
void |
setMoveDuration(javafx.util.Duration duration)
Sets the value of
moveDurationProperty() . |
void |
setOffset(double offset) |
void |
setScrollDragEnabled(boolean enabled)
Sets the value of
scrollDragEnabledProperty() . |
void |
setZoneIdVisible(boolean visible)
Sets the value of the
zoneIdVisibleProperty() . |
void |
setZoomAnimated(boolean animated)
Sets the value of
zoomAnimatedProperty() . |
void |
setZoomDuration(javafx.util.Duration duration)
Sets the value of
zoomDurationProperty() . |
void |
setZoomFactor(double zoomFactor)
Sets the value of the
zoomFactorProperty() . |
void |
setZoomMode(Timeline.ZoomMode mode)
Sets the value of
zoomModeProperty() . |
void |
showNow()
Makes the timeline scroll to the time point that is currently considered "now".
|
void |
showNow(boolean center)
Makes the timeline scroll to the time point that is currently considered "now".
|
void |
showRange(Instant startTime,
Duration duration)
Requests that the given time interval will be completely visible within the timeline.
|
boolean |
showRange(Instant startTime,
Instant endTime)
Requests that the given time interval will be completely visible within the timeline.
|
void |
showRange(TimeInterval interval)
Requests that the given time interval will be completely visible within the timeline.
|
void |
showTemporalUnit(TemporalUnit temporalUnit,
double width)
Submits a request to the timeline to show the given temporal unit
(e.g.
|
void |
showTime(Instant time)
Makes the timeline scroll to the time point passed to the method.
|
void |
showTime(Instant time,
boolean center)
Makes the timeline scroll to the time point passed to the method.
|
javafx.beans.property.ReadOnlyObjectProperty<Instant> |
visibleEndTimeProperty()
A read-only object property storing an
Instant that represents the last visible time
point (on the right edge) inside the timeline. |
javafx.beans.property.ReadOnlyObjectProperty<Instant> |
visibleStartTimeProperty()
A read-only object property storing an
Instant that represents the first visible time
point (on the left edge) inside the timeline. |
javafx.beans.property.ReadOnlyObjectProperty<TimeInterval> |
visibleTimeIntervalProperty()
Stores the currently visible time interval.
|
javafx.beans.property.BooleanProperty |
zoneIdVisibleProperty()
A property used to control the visibility of the time zone name.
|
void |
zoom(double factor,
boolean zoomIn,
Instant frozenTime)
Requests that the timeline performs a zoom operation.
|
javafx.beans.property.BooleanProperty |
zoomAnimatedProperty()
A property used to determine if any zoom operation should be done in an
animated fashion or not.
|
javafx.beans.property.ObjectProperty<javafx.util.Duration> |
zoomDurationProperty()
An object property used to store the duration used for the animation of a
"zoom" inside the timeline.
|
javafx.beans.property.DoubleProperty |
zoomFactorProperty()
A property used to store the zoom factor that will be applied every time the user
performs a zoom in or zoom out.
|
void |
zoomIn()
Requests that the timeline performs a zoom in operation.
|
javafx.beans.property.ObjectProperty<Timeline.ZoomMode> |
zoomModeProperty()
Stores the way a zoom in or out will be executed.
|
void |
zoomOut()
Requests that the timeline performs a zoom out operation.
|
getUserAgentStylesheet
computeMaxHeight, computeMaxWidth, computeMinHeight, computeMinWidth, computePrefHeight, computePrefWidth, contextMenuProperty, executeAccessibleAction, getBaselineOffset, getClassCssMetaData, getContextMenu, getControlCssMetaData, getCssMetaData, getSkin, getTooltip, impl_cssGetFocusTraversableInitialValue, impl_processCSS, isResizable, layoutChildren, queryAccessibleAttribute, setContextMenu, setSkin, setTooltip, skinClassNameProperty, skinProperty, tooltipProperty
backgroundProperty, borderProperty, cacheShapeProperty, centerShapeProperty, getBackground, getBorder, getHeight, getInsets, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getOpaqueInsets, getPadding, getPrefHeight, getPrefWidth, getShape, getWidth, heightProperty, impl_computeContains, impl_computeGeomBounds, impl_computeLayoutBounds, impl_createPeer, impl_notifyLayoutBoundsChanged, impl_pickNodeLocal, impl_updatePeer, 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, snapSize, snapSpace, snapToPixelProperty, widthProperty
getChildren, getChildrenUnmodifiable, getImpl_traversalEngine, getManagedChildren, getStylesheets, impl_getAllParentStylesheets, impl_processMXNode, impl_traversalEngineProperty, isNeedsLayout, layout, lookup, needsLayoutProperty, requestLayout, requestParentLayout, setImpl_traversalEngine, setNeedsLayout, updateBounds
accessibleHelpProperty, accessibleRoleDescriptionProperty, accessibleRoleProperty, accessibleTextProperty, addEventFilter, addEventHandler, applyCss, autosize, blendModeProperty, boundsInLocalProperty, boundsInParentProperty, buildEventDispatchChain, cacheHintProperty, cacheProperty, clipProperty, computeAreaInScreen, contains, contains, containsBounds, 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, 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, hasProperties, hoverProperty, idProperty, impl_clearDirty, impl_computeIntersects, impl_cssGetCursorInitialValue, impl_findStyles, impl_geomChanged, impl_getLeafTransform, impl_getMatchingStyles, impl_getPeer, impl_getPivotX, impl_getPivotY, impl_getPivotZ, impl_getStyleMap, impl_hasTransforms, impl_intersects, impl_intersectsBounds, impl_isDirty, impl_isDirtyEmpty, impl_isShowMnemonics, impl_isTreeVisible, impl_layoutBoundsChanged, impl_markDirty, impl_pickNode, impl_processCSS, impl_reapplyCSS, impl_setShowMnemonics, impl_setStyleMap, impl_showMnemonicsProperty, impl_syncPeer, impl_transformsChanged, impl_traverse, impl_treeVisibleProperty, 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, setVisible, snapshot, snapshot, startDragAndDrop, startFullDrag, styleProperty, toBack, toFront, toString, translateXProperty, translateYProperty, translateZProperty, usesMirroring, visibleProperty
public Timeline()
ChronoUnitTimelineModel
.protected javafx.scene.control.Skin<?> createDefaultSkin()
createDefaultSkin
in class javafx.scene.control.Control
public String getUserAgentStylesheet()
getUserAgentStylesheet
in class javafx.scene.layout.Region
public final javafx.beans.property.BooleanProperty zoneIdVisibleProperty()
Dateline
in its upper
right corner.public final boolean isZoneIdVisible()
zoneIdVisibleProperty()
.public final void setZoneIdVisible(boolean visible)
zoneIdVisibleProperty()
.visible
- true if the time zone ID shall be shown to the userpublic final javafx.beans.property.DoubleProperty offsetProperty()
public final double getOffset()
public final void setOffset(double offset)
public final Dateline getDateline()
public final Eventline getEventline()
public final javafx.beans.property.BooleanProperty scrollDragEnabledProperty()
public final boolean isScrollDragEnabled()
scrollDragEnabledProperty()
.public final void setScrollDragEnabled(boolean enabled)
scrollDragEnabledProperty()
.enabled
- if true the user can trigger horizontal scrolling by dragging the timelinepublic final javafx.beans.property.ReadOnlyObjectProperty<Instant> visibleStartTimeProperty()
Instant
that represents the first visible time
point (on the left edge) inside the timeline.public final Instant getVisibleStartTime()
visibleStartTimeProperty()
.public final javafx.beans.property.ReadOnlyObjectProperty<Instant> visibleEndTimeProperty()
Instant
that represents the last visible time
point (on the right edge) inside the timeline.public final Instant getVisibleEndTime()
visibleEndTimeProperty()
.public final Duration getVisibleDuration()
visibleStartTimeProperty()
and
the visibleEndTimeProperty()
.public final javafx.beans.property.ReadOnlyObjectProperty<TimeInterval> visibleTimeIntervalProperty()
public final TimeInterval getVisibleTimeInterval()
public final javafx.beans.property.ObjectProperty<javafx.util.Duration> moveDurationProperty()
showNow(boolean)
,
showTime(Instant)
,
showTime(Instant, boolean)
public final javafx.util.Duration getMoveDuration()
moveDurationProperty()
.public final void setMoveDuration(javafx.util.Duration duration)
moveDurationProperty()
.duration
- the time used for animating a move inside the timelinepublic final javafx.beans.property.BooleanProperty moveAnimatedProperty()
public final boolean isMoveAnimated()
moveAnimatedProperty()
.public final void setMoveAnimated(boolean animated)
moveAnimatedProperty()
.animated
- if true the change from one time to another will be animatedpublic final void showNow()
showNow(boolean)
,
showTime(Instant)
,
showTime(Instant, boolean)
public final void showNow(boolean center)
center
- determines if the time will be shown in the center or on the left-edge of the timelineshowNow()
,
showTime(Instant)
,
showTime(Instant, boolean)
public final void showTime(Instant time)
time
- the time to showshowNow()
,
showNow(boolean)
,
showTime(Instant, boolean)
public final void showTime(Instant time, boolean center)
time
- the time to showcenter
- if true the time will be centered within the timelineshowNow()
,
showNow(boolean)
,
showTime(Instant)
public final void showTemporalUnit(TemporalUnit temporalUnit, double width)
ChronoUnit.DAYS
at the given width (e.g. 50px).
This is a convenient way to make the Gantt chart show up with a good
initial zoom.temporalUnit
- the temporal unit to showwidth
- the number of pixels to use for each unit (e.g. for one day)public final javafx.beans.property.ObjectProperty<TimelineModel<?>> modelProperty()
ChronoUnitTimelineModel
,
SimpleUnitTimelineModel
public final TimelineModel<?> getModel()
modelProperty()
.public final void setModel(TimelineModel<?> model)
modelProperty()
.model
- the timeline modelpublic final javafx.beans.property.ObjectProperty<javafx.util.Duration> zoomDurationProperty()
zoomIn()
,
zoomOut()
,
showRange(Instant, java.time.Duration)
public final javafx.util.Duration getZoomDuration()
zoomDurationProperty()
.public final void setZoomDuration(javafx.util.Duration duration)
zoomDurationProperty()
.duration
- the duration of the zoom animationpublic final javafx.beans.property.BooleanProperty zoomAnimatedProperty()
public final boolean isZoomAnimated()
zoomAnimatedProperty()
.public final void setZoomAnimated(boolean animated)
zoomAnimatedProperty()
.animated
- if true the zoom in / out operations will be visualized in an animated waypublic final javafx.beans.property.ObjectProperty<Timeline.ZoomMode> zoomModeProperty()
public final Timeline.ZoomMode getZoomMode()
zoomModeProperty()
.public final void setZoomMode(Timeline.ZoomMode mode)
zoomModeProperty()
.mode
- the new zoom mode (center zoom, keep start time, keep end time)public final javafx.beans.property.DoubleProperty zoomFactorProperty()
public final double getZoomFactor()
zoomFactorProperty()
.public final void setZoomFactor(double zoomFactor)
zoomFactorProperty()
.zoomFactor
- the new zoom factorpublic final void zoomIn()
zoomOut()
,
zoom(double, boolean, Instant)
,
zoomFactorProperty()
,
zoomModeProperty()
public final void zoomOut()
zoomOut()
,
zoom(double, boolean, Instant)
,
zoomFactorProperty()
,
zoomModeProperty()
public final void zoom(double factor, boolean zoomIn, Instant frozenTime)
factor
- the zoom factor (default is .5)zoomIn
- if true the zoom will show less timefrozenTime
- the point in time that will stay where it was before (use case: pinch zoom)zoomIn()
,
zoomOut()
,
zoomFactorProperty()
,
zoomModeProperty()
public final void showRange(Instant startTime, Duration duration)
startTime
- the start time of the requested intervalduration
- the duration of the requested intervalshowRange(TimeInterval)
,
showRange(Instant, Instant)
public final void showRange(TimeInterval interval)
interval
- the requested intervalshowRange(Instant, java.time.Duration)
,
showRange(Instant, Instant)
public final boolean showRange(Instant startTime, Instant endTime)
startTime
- the start time of the requested intervalendTime
- the end time of the requested intervalshowRange(Instant, java.time.Duration)
,
showRange(TimeInterval)
public final void scrollRight()
scrollRightFast()
,
scrollLeft()
,
scrollLeftFast()
public final void scrollRightFast()
scrollRight()
,
scrollLeft()
,
scrollLeftFast()
public final void scrollLeft()
scrollLeftFast()
,
scrollRightFast()
,
scrollRight()
public final void scrollLeftFast()
scrollLeft()
,
scrollRightFast()
,
scrollRight()
Copyright © 2020 Dirk Lemmermann Software & Consulting. All rights reserved.