Module com.flexganttfx.view
Package com.flexganttfx.view.graphics
Class GraphicsBase<R extends Row<?,?,?>>
- 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.graphics.GraphicsBase<R>
-
- Type Parameters:
R
- the type of the rows shown by the graphics
- All Implemented Interfaces:
Styleable
,EventTarget
,Skinnable
- Direct Known Subclasses:
ListViewGraphics
,SingleRowGraphics
,SplitPaneGraphics
,VBoxGraphics
public abstract class GraphicsBase<R extends Row<?,?,?>> extends FlexGanttFXControl
The graphics view control is responsible for the rendering of activities and system layers, the editing of activities, the event notifications, the hit detection, system layer management, and for context menu support.Rendering
The graphics view uses the canvas API of JavaFX. This is due to the complex nature of a Gantt chart and due to the large data volumes often observed in Gantt charts. Directly rendering large quantities of activities into a bitmap is much faster than constantly updating the scene graph and reapplying CSS styling. FlexGanttFX implements a pluggable renderer architecture where renderer instances can be mapped to activity types, very similar to the way Swing was doing it. The following code is an example of how to register a custom renderer for a given "Flight" activity type. Please note that the graphics view is capable of displaying activities in three different layouts, hence the layout type must also be passed to the method.setActivityRenderer(Flight.class, GanttLayout.class, new FlightRenderer());
System Layers
Activities are not the only thing that need to be rendered. There are also the current time ("now"), grid lines, inner lines, agenda / chart lines, etc... All of these things are rendered by so-called system layers (seeSystemLayer
). The graphics view manages two lists of these layers. One list for background layers (getBackgroundSystemLayers()
) and one list for foreground layers (getForegroundSystemLayers()
).
Background layers are drawn "behind" activities, foreground layers are drawn "in front of" activities. Each one of these lists are already pre-populated but can be changed by the application. For more information on the available system layers, please refer to their individual documentation.
System layers can be turned on and off directly via the API ofGraphicsBase
. There is a boolean property for each layer that ships with FlexGanttFX. The value of these properties can be set by calling the methods that follow the patternsetShowXYZLayer
. System layers that are controlled like this will appear and disappear with a fade in / fade out animation, while callingSystemLayer.setVisible(boolean)
directly will be without any animation.Editing Customization
Two different callbacks are used to control the editing behaviour of activities. The first maps a mouse event / mouse location to anGraphicsBase.EditMode
and can be registered by callingsetEditModeCallback(Class, Class, Callback)
. The second callback is used to determine whether a given editing mode / operation can be applied to an activity at all. This callback is registered by callingsetActivityEditingCallback(Class, Callback)
. Most applications will only need to work with the second callback and keep the defaults for the edit mode locations (for example: right edge used to change end time, left edge used to change start time).Notifications / Events
Events of typeActivityEvent
are sent whenever the user performs a change inside the graphics view. Applications that want to receive these events can either call any one of thesetOnActivityXYZEvent()
methods or by adding an event handler directly viaaddEventHandler(ActionEvent.ACTIVITY_XYZ, ...)
. Events are fired while the change is being performed and once it has been completed. For this theActivityEvent
class lists event types with the two different endings CHANGING and CHANGED.Filtering
The data displayed by the graphics control can be filtered in two ways: first by showing / hiding rows, second by showing / hiding activities. Row filtering is done by the parent GanttChart controls while activity filtering is done by the graphics control via an activity filter predicate:setActivityFilter(Predicate<Activity> filter);
Finding / Lookup / Hitpoint Detection
The graphics view provides support for finding out information about a given position. Activities can be found by callinggetActivityBoundsAt(double, double)
orgetActivityRefAt(double, double)
. The time at an x-coordinate can be looked up by callinggetTimeAt(double)
. The opposite direction is also available: a location can be found for a given time by callinggetLocation(Instant)
.Context Menu
Context menus can be set on any control in JavaFX but due to the complexitiy of the graphics view it does make sense to provide additional built-in support. By callingsetContextMenuCallback(Callback)
a context menu specific callback can be registered with the graphics control. This callback will be invoked when the user triggers the context menu. A callback parameter object (seeGraphicsBase.ContextMenuParameter
) will be passed to the callback already populated with the most important values that might be relevant for building a context menu.- Since:
- 1.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
GraphicsBase.ContextMenuParameter<R extends Row<?,?,?>>
A callback parameter class used for displaying a context menu.static class
GraphicsBase.DragAndDropFeedback
An enumerator used to define how to visuzalize the dragged activity during a drag and drop operation.static class
GraphicsBase.DragAndDropInfo
The drag and drop info class aggregates the various pieces of information that the application might be interested in while a drag and drop operation is in progress.static class
GraphicsBase.EditingCallbackParameter
A callback parameter object used for determining if the proposedGraphicsBase.EditMode
is currently allowed or not.static class
GraphicsBase.EditMode
An enumeration of possible editing states that the graphics view can be in.static class
GraphicsBase.EditModeCallbackParameter
A callback parameter object used by the edit mode callback that provides information about the context for which the edit mode will be determined.static class
GraphicsBase.LassoSelectionBehaviour
An enumerator used to control the selection behaviour of the lasso.static class
GraphicsBase.RowControlsParameter<R extends Row<?,?,?>>
A callback parameter object used to provide context for the row controls factory.static class
GraphicsBase.RowEditingMode
An enumerator used to define how many rows can show their row editors at the same time.static class
GraphicsBase.RowEditorParameter<R extends Row<?,?,?>>
A callback parameter object used to provide context for the row editor factory.static class
GraphicsBase.SelectionMode
An enumerator used to control the selection behaviour of the graphics view.
-
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
-
-
Constructor Summary
Constructors Constructor Description GraphicsBase()
Constructs a new graphics view and initializes the following: Virtual grid settings (1, 5, 10, 15, 30, 60 Minutes) Activity renderers for several of the default model classes. Edit mode callbacks for several of the default model classes. Activity editing callbacks. Background and foreground layers. Calendars (e.
-
Method Summary
-
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, createDefaultSkin, executeAccessibleAction, getBaselineOffset, getContextMenu, 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
-
GraphicsBase
public GraphicsBase()
Constructs a new graphics view and initializes the following:- Virtual grid settings (1, 5, 10, 15, 30, 60 Minutes)
- Activity renderers for several of the default model classes.
- Edit mode callbacks for several of the default model classes.
- Activity editing callbacks.
- Background and foreground layers.
- Calendars (e. g. weekend calendar).
- Since:
- 1.0
-
-
Method Detail
-
getUserAgentStylesheet
public String getUserAgentStylesheet()
- Overrides:
getUserAgentStylesheet
in classRegion
-
rowFilterProperty
public final ObjectProperty<Predicate<R>> rowFilterProperty()
A predicate used to filter the rows.- Returns:
- the filter predicate
-
setRowFilter
public final void setRowFilter(Predicate<R> predicate)
Sets the value ofrowFilterProperty()
.- Parameters:
predicate
- the filter predicate
-
getRowFilter
public final Predicate getRowFilter()
Returns the value ofrowFilterProperty()
.- Returns:
- the filter predicate
-
activityFilterProperty
public final ObjectProperty<Predicate<Activity>> activityFilterProperty()
A property used to store a filter function, which determines if an activity will be rendered or not. An activity will be drawn if the function returns "true".- Returns:
- the predicate / the filter function for activities
- Since:
- 1.6
-
getActivityFilter
public final Predicate<Activity> getActivityFilter()
Returns the value ofactivityFilterProperty()
.- Returns:
- the predicate / the filter function for activities
- Since:
- 1.6
-
setActivityFilter
public final void setActivityFilter(Predicate<Activity> filter)
Sets the value ofactivityFilterProperty()
.- Parameters:
filter
- the filter function- Since:
- 1.6
-
lassoEnabledProperty
public final BooleanProperty lassoEnabledProperty()
A property used to control whether the user can use the lasso for selecting multiple activities at once.- Returns:
- the lasso enabled property
- Since:
- 1.6
-
setLassoEnabled
public final void setLassoEnabled(boolean enabled)
Sets the value oflassoEnabledProperty()
.- Parameters:
enabled
- if true the lasso will be usable by the user- Since:
- 1.6
-
isLassoEnabled
public final boolean isLassoEnabled()
Returns the value oflassoEnabledProperty()
.- Returns:
- true if the user can use the lasso
- Since:
- 1.6
-
automaticRedrawProperty
public final ReadOnlyBooleanProperty automaticRedrawProperty()
A property used to determine if the graphics will be redrawn whenever the data in any of the activity repository changes. The default value is true. Applications can use this property to disable the redrawing when they know that they have to add a lot of activities but do not want the chart to perform a lot of redraws. The graphics will be redrawn right away when the value of this property changes from true to false or vice versa.- Returns:
- the automatic redraw property
- Since:
- 1.5
-
isAutomaticRedraw
public final boolean isAutomaticRedraw()
Returns the value ofautomaticRedrawProperty()
.- Returns:
- true if automatic redrawing will be performed (default)
- Since:
- 1.5
-
setAutomaticRedraw
public final void setAutomaticRedraw(boolean automatic)
Sets the value ofautomaticRedrawProperty()
.- Parameters:
automatic
- if true then the graphics redraw after every repository change event- Since:
- 1.5
-
updatePropertySheet
public void updatePropertySheet()
-
lassoActiveProperty
public final ReadOnlyBooleanProperty lassoActiveProperty()
A boolean property used to indicate whether the lasso selection tool is currently in use or not.- Returns:
- true if the user is currently performing a lasso selection operation
- Since:
- 1.0
-
isLassoActive
public final boolean isLassoActive()
Returns the value oflassoActiveProperty()
.- Returns:
- true if the user is currently performing a lasso selection operation.
- Since:
- 1.0
-
lassoSnapsToGridProperty
public final BooleanProperty lassoSnapsToGridProperty()
A boolean property used to indicate whether the lasso selection tool is using the currently active grid settings.- Returns:
- the lasso snaps property
- Since:
- 1.1
-
isLassoSnapsToGrid
public final boolean isLassoSnapsToGrid()
Returns the value oflassoSnapsToGridProperty()
.- Returns:
- true if the lasso is obeying the current virtual grid settings
- Since:
- 1.1
-
setLassoSnapsToGrid
public final void setLassoSnapsToGrid(boolean snaps)
Sets the value oflassoSnapsToGridProperty()
.- Parameters:
snaps
- if true the lasso will obey the grid- Since:
- 1.1
-
getLinks
public final ObservableList<ActivityLink<?>> getLinks()
Returns the list that is used to store all activity links of the model.- Returns:
- a list of activity links
- Since:
- 1.0
-
getLayers
public final ObservableList<Layer> getLayers()
Returns the list that is used to store all layers of the model.- Returns:
- a list of layers
- Since:
- 1.0
-
rowsProperty
public final ListProperty<R> rowsProperty()
Returns the property used to store the list of rows.- Returns:
- the list of rows
- Since:
- 1.6
-
setRows
public final void setRows(ObservableList<R> rows)
Sets the value of therowsProperty()
.- Parameters:
rows
- the new rows to display- Since:
- 1.6
-
getRows
public final ObservableList<R> getRows()
Returns the list that is used to store all rows of the model.- Returns:
- a list of rows
- Since:
- 1.6
-
timelineProperty
public final ObjectProperty<Timeline> timelineProperty()
A property used to store a reference to the timeline control above the graphics.- Returns:
- the property used to store the timeline reference
- Since:
- 1.0
-
setTimeline
public final void setTimeline(Timeline timeline)
Sets the value oftimelineProperty()
.- Parameters:
timeline
- the timeline control above the graphics- Since:
- 1.0
-
getTimeline
public final Timeline getTimeline()
Returns the value oftimelineProperty()
.- Returns:
- the timeline control above the graphics
- Since:
- 1.0
-
fixedCellSizeProperty
public final DoubleProperty fixedCellSizeProperty()
A property used to store a fixed cell size for controls that are based on the virtual flow control. This value is not used by all subclasses of this class. Using a fixed cell size can result in a performance gain.- Returns:
- the property used to store a fixed cell size
- Since:
- 1.0
- See Also:
ListViewGraphics
-
getFixedCellSize
public final double getFixedCellSize()
Returns the value offixedCellSizeProperty()
.- Returns:
- the fixed cell size (default is -1)
- Since:
- 1.0
-
setFixedCellSize
public final void setFixedCellSize(double size)
Sets the value offixedCellSizeProperty()
.- Parameters:
size
- the fixed cell size, -1 to disable fixed cell size- Since:
- 1.0
-
getLocation
public final double getLocation(Instant time)
Returns the x coordinate for the given time.- Parameters:
time
- the time for which to lookup a coordinate- Returns:
- the x coordinate for the given time
- Since:
- 1.0
- See Also:
getTimeAt(double)
,TimelineModel.calculateLocationForTime(Instant)
-
getTimeAt
public final Instant getTimeAt(double location)
Returns the time at the given location.- Parameters:
location
- the x-coordinate for which to retrieve the time- Returns:
- the time at the given location
- Since:
- 1.0
-
getLocalTimeAt
public final LocalTime getLocalTimeAt(double y)
Returns the local time at the given location. This method will only return a valid value if theAgendaLayout
is being used at the given location (in graphics view coordinate space).- Parameters:
y
- the y-coordinate in the coordinate space of the graphics view- Returns:
- the local time at the given location or null if location not
managed by an
AgendaLayout
- Since:
- 1.0
-
getRowAt
public final R getRowAt(double y)
Finds the row at the given y-coordinate.- Parameters:
y
- the y-coordinate in the coordinate space of the graphics view for which to return a row model object- Returns:
- the row model object at the given y-coordinate
- Since:
- 1.0
-
getLayoutAt
public final Layout getLayoutAt(double y)
Finds the layout that is being used at the given y-coordinate.- Parameters:
y
- the y-coordinate in the coordinate space of the graphics view for which to return the layout- Returns:
- the layout used at the given location
- Since:
- 1.0
-
getActivityBoundsAt
public final ActivityBounds getActivityBoundsAt(double x, double y)
Finds the activity bounds at the given location. Returns the bounds of the activity drawn last if several activities can be found at the given location.- Parameters:
x
- the x-coordinate in the coordinate space of the graphics viewy
- the y-coordinate in the coordinate space of the graphics view- Returns:
- the bounds of the activity found at the given location or null if no activity can be found
- Since:
- 1.0
-
getActivityRefAt
public final ActivityRef<?> getActivityRefAt(double x, double y)
Finds the activity reference at the given location. Returns the reference of the activity drawn last if several activities can be found at the given location.- Parameters:
x
- the x-coordinate in the coordinate space of the graphics viewy
- the y-coordinate in the coordinate space of the graphics view- Returns:
- the reference of the activity found at the given location or null if no activity can be found
- Since:
- 1.0
-
getAllActivityBoundsAt
public final List<ActivityBounds> getAllActivityBoundsAt(double x, double y)
Returns the bounds of all activities found at the given location. Activities can be drawn on top of each other, hence several bounds can exist at the same location.- Parameters:
x
- the x-coordinate in the coordinate space of the graphics viewy
- the y-coordinate in the coordinate space of the graphics view- Returns:
- the bounds of the activities found at the given location or null if no activities can be found
- Since:
- 1.0
-
getAllActivityRefsAt
public final List<ActivityRef<?>> getAllActivityRefsAt(double x, double y)
Returns the references to all activities found at the given location. Activities can be drawn on top of each other, hence several references can exist at the same location.- Parameters:
x
- the x-coordinate in the coordinate space of the graphics viewy
- the y-coordinate in the coordinate space of the graphics view- Returns:
- the references of all activities found at the given location or null if no activities can be found
- Since:
- 1.0
-
getAllCalendarActivitiesAt
public final List<CalendarActivity> getAllCalendarActivitiesAt(double x, double y)
Finds all calendar activities at the given location.- Parameters:
x
- the x-coordinate in the coordinate space of the graphics viewy
- the y-coordinate in the coordinate space of the graphics view- Returns:
- all calendar activities at the given location
- Since:
- 1.1
-
moveLayerToFront
public final void moveLayerToFront(Layer layer)
Moves the given layer to the front so that the activities located on it will be drawn on top of all other activities.- Parameters:
layer
- the layer to move- Since:
- 1.0
- See Also:
getLayers()
-
moveLayerToBack
public final void moveLayerToBack(Layer layer)
Moves the given layer to the back so that the activities located on it will be drawn first and all other activities on other layers will be drawn on top of them.- Parameters:
layer
- the layer to move- Since:
- 1.0
- See Also:
getLayers()
-
moveLayerForward
public final void moveLayerForward(Layer layer)
Moves the given layer forward within the stack of layers.- Parameters:
layer
- the layer to move- Since:
- 1.0
- See Also:
getLayers()
-
moveLayerBackward
public final void moveLayerBackward(Layer layer)
Moves the given layer backward within the stack of layers.- Parameters:
layer
- the layer to move- Since:
- 1.0
- See Also:
getLayers()
-
onActivityDeletedProperty
public final ObjectProperty<EventHandler<ActivityEvent>> onActivityDeletedProperty()
-
setOnActivityDeleted
public final void setOnActivityDeleted(EventHandler<ActivityEvent> value)
-
getOnActivityDeleted
public final EventHandler<ActivityEvent> getOnActivityDeleted()
-
onActivityChangeProperty
public final ObjectProperty<EventHandler<ActivityEvent>> onActivityChangeProperty()
-
setOnActivityChange
public final void setOnActivityChange(EventHandler<ActivityEvent> value)
-
getOnActivityChange
public final EventHandler<ActivityEvent> getOnActivityChange()
-
onActivityChangeStartedProperty
public final ObjectProperty<EventHandler<ActivityEvent>> onActivityChangeStartedProperty()
-
setOnActivityChangeStarted
public final void setOnActivityChangeStarted(EventHandler<ActivityEvent> value)
-
getOnActivityChangeStarted
public final EventHandler<ActivityEvent> getOnActivityChangeStarted()
-
onActivityChangeOngoingProperty
public final ObjectProperty<EventHandler<ActivityEvent>> onActivityChangeOngoingProperty()
-
setOnActivityChangeOngoing
public final void setOnActivityChangeOngoing(EventHandler<ActivityEvent> value)
-
getOnActivityChangeOngoing
public final EventHandler<ActivityEvent> getOnActivityChangeOngoing()
-
onActivityChangeFinishedProperty
public final ObjectProperty<EventHandler<ActivityEvent>> onActivityChangeFinishedProperty()
-
setOnActivityChangeFinished
public final void setOnActivityChangeFinished(EventHandler<ActivityEvent> value)
-
getOnActivityChangeFinished
public final EventHandler<ActivityEvent> getOnActivityChangeFinished()
-
onActivityDragStartedProperty
public final ObjectProperty<EventHandler<ActivityEvent>> onActivityDragStartedProperty()
-
setOnActivityDragStarted
public final void setOnActivityDragStarted(EventHandler<ActivityEvent> value)
-
getOnActivityDragStarted
public final EventHandler<ActivityEvent> getOnActivityDragStarted()
-
onActivityDragOngoingProperty
public final ObjectProperty<EventHandler<ActivityEvent>> onActivityDragOngoingProperty()
-
setOnActivityDragOngoing
public final void setOnActivityDragOngoing(EventHandler<ActivityEvent> value)
-
getOnActivityDragOngoing
public final EventHandler<ActivityEvent> getOnActivityDragOngoing()
-
onActivityDragFinishedProperty
public final ObjectProperty<EventHandler<ActivityEvent>> onActivityDragFinishedProperty()
-
setOnActivityDragFinished
public final void setOnActivityDragFinished(EventHandler<ActivityEvent> value)
-
getOnActivityDragFinished
public final EventHandler<ActivityEvent> getOnActivityDragFinished()
-
onActivityDragDoneProperty
public final ObjectProperty<EventHandler<ActivityEvent>> onActivityDragDoneProperty()
-
setOnActivityDragDone
public final void setOnActivityDragDone(EventHandler<ActivityEvent> value)
-
getOnActivityDragDone
public final EventHandler<ActivityEvent> getOnActivityDragDone()
-
onActivityChartValueChangeStartedProperty
public final ObjectProperty<EventHandler<ActivityEvent>> onActivityChartValueChangeStartedProperty()
-
setOnActivityChartValueChangeStarted
public final void setOnActivityChartValueChangeStarted(EventHandler<ActivityEvent> value)
-
getOnActivityChartValueChangeStarted
public final EventHandler<ActivityEvent> getOnActivityChartValueChangeStarted()
-
onActivityChartValueChangeOngoingProperty
public final ObjectProperty<EventHandler<ActivityEvent>> onActivityChartValueChangeOngoingProperty()
-
setOnActivityChartValueChangeOngoing
public final void setOnActivityChartValueChangeOngoing(EventHandler<ActivityEvent> value)
-
getOnActivityChartValueChangeOngoing
public final EventHandler<ActivityEvent> getOnActivityChartValueChangeOngoing()
-
onActivityChartValueChangeFinishedProperty
public final ObjectProperty<EventHandler<ActivityEvent>> onActivityChartValueChangeFinishedProperty()
-
setOnActivityChartValueChangeFinished
public final void setOnActivityChartValueChangeFinished(EventHandler<ActivityEvent> value)
-
getOnActivityChartValueChangeFinished
public final EventHandler<ActivityEvent> getOnActivityChartValueChangeFinished()
-
onActivityChartHighValueChangeStartedProperty
public final ObjectProperty<EventHandler<ActivityEvent>> onActivityChartHighValueChangeStartedProperty()
-
setOnActivityChartHighValueChangeStarted
public final void setOnActivityChartHighValueChangeStarted(EventHandler<ActivityEvent> value)
-
getOnActivityChartHighValueChangeStarted
public final EventHandler<ActivityEvent> getOnActivityChartHighValueChangeStarted()
-
onActivityChartHighValueChangeOngoingProperty
public final ObjectProperty<EventHandler<ActivityEvent>> onActivityChartHighValueChangeOngoingProperty()
-
setOnActivityChartHighValueChangeOngoing
public final void setOnActivityChartHighValueChangeOngoing(EventHandler<ActivityEvent> value)
-
getOnActivityChartHighValueChangeOngoing
public final EventHandler<ActivityEvent> getOnActivityChartHighValueChangeOngoing()
-
onActivityChartHighValueChangeFinishedProperty
public final ObjectProperty<EventHandler<ActivityEvent>> onActivityChartHighValueChangeFinishedProperty()
-
setOnActivityChartHighValueChangeFinished
public final void setOnActivityChartHighValueChangeFinished(EventHandler<ActivityEvent> value)
-
getOnActivityChartHighValueChangeFinished
public final EventHandler<ActivityEvent> getOnActivityChartHighValueChangeFinished()
-
onActivityChartLowValueChangeStartedProperty
public final ObjectProperty<EventHandler<ActivityEvent>> onActivityChartLowValueChangeStartedProperty()
-
setOnActivityChartLowValueChangeStarted
public final void setOnActivityChartLowValueChangeStarted(EventHandler<ActivityEvent> value)
-
getOnActivityChartLowValueChangeStarted
public final EventHandler<ActivityEvent> getOnActivityChartLowValueChangeStarted()
-
onActivityChartLowValueChangeOngoingProperty
public final ObjectProperty<EventHandler<ActivityEvent>> onActivityChartLowValueChangeOngoingProperty()
-
setOnActivityChartLowValueChangeOngoing
public final void setOnActivityChartLowValueChangeOngoing(EventHandler<ActivityEvent> value)
-
getOnActivityChartLowValueChangeOngoing
public final EventHandler<ActivityEvent> getOnActivityChartLowValueChangeOngoing()
-
onActivityChartLowValueChangeFinishedProperty
public final ObjectProperty<EventHandler<ActivityEvent>> onActivityChartLowValueChangeFinishedProperty()
-
setOnActivityChartLowValueChangeFinished
public final void setOnActivityChartLowValueChangeFinished(EventHandler<ActivityEvent> value)
-
getOnActivityChartLowValueChangeFinished
public final EventHandler<ActivityEvent> getOnActivityChartLowValueChangeFinished()
-
onActivityHorizontalDragStartedProperty
public final ObjectProperty<EventHandler<ActivityEvent>> onActivityHorizontalDragStartedProperty()
-
setOnActivityHorizontalDragStarted
public final void setOnActivityHorizontalDragStarted(EventHandler<ActivityEvent> value)
-
getOnActivityHorizontalDragStarted
public final EventHandler<ActivityEvent> getOnActivityHorizontalDragStarted()
-
onActivityHorizontalDragOngoingProperty
public final ObjectProperty<EventHandler<ActivityEvent>> onActivityHorizontalDragOngoingProperty()
-
setOnActivityHorizontalDragOngoing
public final void setOnActivityHorizontalDragOngoing(EventHandler<ActivityEvent> value)
-
getOnActivityHorizontalDragOngoing
public final EventHandler<ActivityEvent> getOnActivityHorizontalDragOngoing()
-
onActivityHorizontalDragFinishedProperty
public final ObjectProperty<EventHandler<ActivityEvent>> onActivityHorizontalDragFinishedProperty()
-
setOnActivityHorizontalDragFinished
public final void setOnActivityHorizontalDragFinished(EventHandler<ActivityEvent> value)
-
getOnActivityHorizontalDragFinished
public final EventHandler<ActivityEvent> getOnActivityHorizontalDragFinished()
-
onActivityVerticalDragStartedProperty
public final ObjectProperty<EventHandler<ActivityEvent>> onActivityVerticalDragStartedProperty()
-
setOnActivityVerticalDragStarted
public final void setOnActivityVerticalDragStarted(EventHandler<ActivityEvent> value)
-
getOnActivityVerticalDragStarted
public final EventHandler<ActivityEvent> getOnActivityVerticalDragStarted()
-
onActivityVerticalDragOngoingProperty
public final ObjectProperty<EventHandler<ActivityEvent>> onActivityVerticalDragOngoingProperty()
-
setOnActivityVerticalDragOngoing
public final void setOnActivityVerticalDragOngoing(EventHandler<ActivityEvent> value)
-
getOnActivityVerticalDragOngoing
public final EventHandler<ActivityEvent> getOnActivityVerticalDragOngoing()
-
onActivityVerticalDragFinishedProperty
public final ObjectProperty<EventHandler<ActivityEvent>> onActivityVerticalDragFinishedProperty()
-
setOnActivityVerticalDragFinished
public final void setOnActivityVerticalDragFinished(EventHandler<ActivityEvent> value)
-
getOnActivityVerticalDragFinished
public final EventHandler<ActivityEvent> getOnActivityVerticalDragFinished()
-
onActivityVerticalDragDoneProperty
public final ObjectProperty<EventHandler<ActivityEvent>> onActivityVerticalDragDoneProperty()
-
setOnActivityVerticalDragDone
public final void setOnActivityVerticalDragDone(EventHandler<ActivityEvent> value)
-
getOnActivityVerticalDragDone
public final EventHandler<ActivityEvent> getOnActivityVerticalDragDone()
-
onActivityEndTimeChangeStartedProperty
public final ObjectProperty<EventHandler<ActivityEvent>> onActivityEndTimeChangeStartedProperty()
-
setOnActivityEndTimeChangeStarted
public final void setOnActivityEndTimeChangeStarted(EventHandler<ActivityEvent> value)
-
getOnActivityEndTimeChangeStarted
public final EventHandler<ActivityEvent> getOnActivityEndTimeChangeStarted()
-
onActivityEndTimeChangeOngoingProperty
public final ObjectProperty<EventHandler<ActivityEvent>> onActivityEndTimeChangeOngoingProperty()
-
setOnActivityEndTimeChangeOngoing
public final void setOnActivityEndTimeChangeOngoing(EventHandler<ActivityEvent> value)
-
getOnActivityEndTimeChangeOngoing
public final EventHandler<ActivityEvent> getOnActivityEndTimeChangeOngoing()
-
onActivityEndTimeChangeFinishedProperty
public final ObjectProperty<EventHandler<ActivityEvent>> onActivityEndTimeChangeFinishedProperty()
-
setOnActivityEndTimeChangeFinished
public final void setOnActivityEndTimeChangeFinished(EventHandler<ActivityEvent> value)
-
getOnActivityEndTimeChangeFinished
public final EventHandler<ActivityEvent> getOnActivityEndTimeChangeFinished()
-
onActivityPercentageChangeStartedProperty
public final ObjectProperty<EventHandler<ActivityEvent>> onActivityPercentageChangeStartedProperty()
-
setOnActivityPercentageChangeStarted
public final void setOnActivityPercentageChangeStarted(EventHandler<ActivityEvent> value)
-
getOnActivityPercentageChangeStarted
public final EventHandler<ActivityEvent> getOnActivityPercentageChangeStarted()
-
onActivityPercentageChangeOngoingProperty
public final ObjectProperty<EventHandler<ActivityEvent>> onActivityPercentageChangeOngoingProperty()
-
setOnActivityPercentageChangeOngoing
public final void setOnActivityPercentageChangeOngoing(EventHandler<ActivityEvent> value)
-
getOnActivityPercentageChangeOngoing
public final EventHandler<ActivityEvent> getOnActivityPercentageChangeOngoing()
-
onActivityPercentageChangeFinishedProperty
public final ObjectProperty<EventHandler<ActivityEvent>> onActivityPercentageChangeFinishedProperty()
-
setOnActivityPercentageChangeFinished
public final void setOnActivityPercentageChangeFinished(EventHandler<ActivityEvent> value)
-
getOnActivityPercentageChangeFinished
public final EventHandler<ActivityEvent> getOnActivityPercentageChangeFinished()
-
onActivityStartTimeChangeStartedProperty
public final ObjectProperty<EventHandler<ActivityEvent>> onActivityStartTimeChangeStartedProperty()
-
setOnActivityStartTimeChangeStarted
public final void setOnActivityStartTimeChangeStarted(EventHandler<ActivityEvent> value)
-
getOnActivityStartTimeChangeStarted
public final EventHandler<ActivityEvent> getOnActivityStartTimeChangeStarted()
-
onActivityStartTimeChangeOngoingProperty
public final ObjectProperty<EventHandler<ActivityEvent>> onActivityStartTimeChangeOngoingProperty()
-
setOnActivityStartTimeChangeOngoing
public final void setOnActivityStartTimeChangeOngoing(EventHandler<ActivityEvent> value)
-
getOnActivityStartTimeChangeOngoing
public final EventHandler<ActivityEvent> getOnActivityStartTimeChangeOngoing()
-
onActivityStartTimeChangeFinishedProperty
public final ObjectProperty<EventHandler<ActivityEvent>> onActivityStartTimeChangeFinishedProperty()
-
setOnActivityStartTimeChangeFinished
public final void setOnActivityStartTimeChangeFinished(EventHandler<ActivityEvent> value)
-
getOnActivityStartTimeChangeFinished
public final EventHandler<ActivityEvent> getOnActivityStartTimeChangeFinished()
-
onLassoSelectionProperty
public final ObjectProperty<EventHandler<LassoEvent>> onLassoSelectionProperty()
-
setOnLassoSelection
public final void setOnLassoSelection(EventHandler<LassoEvent> value)
-
getOnLassoSelection
public final EventHandler<LassoEvent> getOnLassoSelection()
-
onLassoSelectionStartedProperty
public final ObjectProperty<EventHandler<LassoEvent>> onLassoSelectionStartedProperty()
-
setOnLassoSelectionStarted
public final void setOnLassoSelectionStarted(EventHandler<LassoEvent> value)
-
getOnLassoSelectionStarted
public final EventHandler<LassoEvent> getOnLassoSelectionStarted()
-
onLassoSelectionOngoingProperty
public final ObjectProperty<EventHandler<LassoEvent>> onLassoSelectionOngoingProperty()
-
setOnLassoSelectionOngoing
public final void setOnLassoSelectionOngoing(EventHandler<LassoEvent> value)
-
getOnLassoSelectionOngoing
public final EventHandler<LassoEvent> getOnLassoSelectionOngoing()
-
onLassoSelectionFinishedProperty
public final ObjectProperty<EventHandler<LassoEvent>> onLassoSelectionFinishedProperty()
-
setOnLassoSelectionFinished
public final void setOnLassoSelectionFinished(EventHandler<LassoEvent> value)
-
getOnLassoSelectionFinished
public final EventHandler<LassoEvent> getOnLassoSelectionFinished()
-
editModeProperty
public final ReadOnlyObjectProperty<GraphicsBase.EditMode> editModeProperty()
A property used to store the currently active editing mode, e.g. "changing start time", "changing end time", "dragging horizontally", "dragging vertically", etc...
The property is read-only as it can not be set from the outside. It is being updated when the user moves the mouse cursor on top of an activity. The edit mode depends on the location of the cursor (left or right edge, center). SeesetActivityEditingCallback(Class, Callback)
for mapping mouse events to editing operations.- Returns:
- the currently active edit mode
- Since:
- 1.0
-
getEditMode
public final GraphicsBase.EditMode getEditMode()
Returns the value ofeditModeProperty()
.- Returns:
- the currently active edit mode
- Since:
- 1.0
-
getHighlightedRows
public final ObservableSet<Row<?,?,?>> getHighlightedRows()
Returns a set that is used to store the currently highlighted rows. A row added to this set will start blinking and draw the attention of the user to it.- Returns:
- the set of highlighted rows
- Since:
- 1.0
- See Also:
setHighlightDelay(long)
-
getHighlightedActivities
public final ObservableSet<ActivityRef<?>> getHighlightedActivities()
Returns a set that is used to store the currently highighted activities. An activity added to this set will start blinking and draw the attention of the user to it.- Returns:
- the set of highlighted activities
- Since:
- 1.0
- See Also:
setHighlightDelay(long)
-
highlightDelayProperty
public final LongProperty highlightDelayProperty()
A property used to store the delay between two "blinks" of highlighted rows or activities.- Returns:
- the property used for the delay (in milliseconds)
- Since:
- 1.0
-
setHighlightDelay
public final void setHighlightDelay(long delay)
Sets the value ofhighlightDelayProperty()
.- Parameters:
delay
- the highlight delay in milliseconds- Since:
- 1.0
-
getHighlightDelay
public final long getHighlightDelay()
Returns the value ofhighlightDelayProperty()
.- Returns:
- the highlight delay in milliseconds
- Since:
- 1.0
-
highlightedProperty
public final ReadOnlyBooleanProperty highlightedProperty()
A read-only property used to control the highlighting effect. The value of this property gets frequently toggled between true and false so that is triggers a redraw of the graphics and a blink effect.- Returns:
- a read-only property that signals if the highlight is on or off (causes blinking)
- Since:
- 1.0
-
isHighlighted
public final boolean isHighlighted()
Returns the value ofhighlightedProperty()
.- Returns:
- a flag value used to toggle the highlighting effect
- Since:
- 1.0
-
contextMenuCallbackProperty
public final ObjectProperty<Callback<GraphicsBase.ContextMenuParameter<R>,ContextMenu>> contextMenuCallbackProperty()
A property used to store a callback which is used for creating a context menu. Context menus can also be used by simply callingControl.setContextMenu(ContextMenu)
but using this callback saves you from collecting all the information and objects that can be found at the location of the context menu trigger event.- Returns:
- a callback for creating a context menu
- Since:
- 1.0
-
setContextMenuCallback
public final void setContextMenuCallback(Callback<GraphicsBase.ContextMenuParameter<R>,ContextMenu> callback)
Sets the value ofcontextMenuCallbackProperty()
.- Parameters:
callback
- a callback for creating a parameterized context menu- Since:
- 1.0
-
getContextMenuCallback
public final Callback<GraphicsBase.ContextMenuParameter<R>,ContextMenu> getContextMenuCallback()
Returns the value ofcontextMenuCallbackProperty()
.- Returns:
- the callback for creating a parameterized context menu
- Since:
- 1.0
-
extraPixelsProperty
public final IntegerProperty extraPixelsProperty()
A property used to instruct the graphics view to query the activity repositories also for activities that are ending right in front of the visible area or starting right after the visible area. Querying the extra pixels is important for activities that have negative bounds (e.g. milestones: they would only become visible if their time is inside the visible area, but their diamond shape might actually already reach into the area).- Returns:
- the property used to store the number of extra pixels added to the visible area
- Since:
- 1.0
-
getExtraPixels
public final int getExtraPixels()
Returns the value ofextraPixelsProperty()
.- Returns:
- the number of extra pixels added to the visible area
- Since:
- 1.0
-
setExtraPixels
public final void setExtraPixels(int pixels)
Sets the value ofextraPixelsProperty()
.- Parameters:
pixels
- the number of extra pixels added to the visible area- Since:
- 1.0
-
autoMarkedTimeIntervalProperty
public final BooleanProperty autoMarkedTimeIntervalProperty()
Controls whether the marked time interval property of theEventline
will be automatically set when the user performs certain editing operations (e.g. move an activity horizontally). The default is "true".- Returns:
- the auto marked time interval property
- See Also:
Eventline.markedTimeIntervalProperty()
-
isAutoMarkedTimeInterval
public final boolean isAutoMarkedTimeInterval()
Returns the value ofautoMarkedTimeIntervalProperty()
.- Returns:
- true if the marked time interval gets updated automatically
-
setAutoMarkedTimeInterval
public final void setAutoMarkedTimeInterval(boolean auto)
Sets the value ofautoMarkedTimeIntervalProperty()
.- Parameters:
auto
- if true the marked time interval will be updated automatically
-
maxGridLevelProperty
public final IntegerProperty maxGridLevelProperty()
A property used to store the number of grid levels that the user wants to see in the graphics view. The value of this property must be between 1 and 5. The grid level depends on the number of scales shown by the dateline (seeDateline.getScaleResolutions()
). If the dateline is currently showing two scales (e.g. days and weeks) then the graphics view and theGridLinesLayer
can also display two different grid lines, for example a light gray one for days and a dark gray one for weeks.- Returns:
- the maximum number of grid levels
- Since:
- 1.0
-
getMaxGridLevel
public final int getMaxGridLevel()
Returns the value ofmaxGridLevelProperty()
.- Returns:
- the maximum number of grid levels
- Since:
- 1.0
-
setMaxGridLevel
public final void setMaxGridLevel(int max)
Sets the value ofmaxGridLevelProperty()
.- Parameters:
max
- the maximum number of grid levels, a value between 1 and 5- Since:
- 1.0
-
showVerticalCursorProperty
public final BooleanProperty showVerticalCursorProperty()
A property used to control wether a vertical cursor line will be shown by the graphics view. The line will always follow the location of the mouse cursor.- Returns:
- a property used for controlling the visibility of a vertical cursor line
- Since:
- 1.0
-
isShowVerticalCursor
public final boolean isShowVerticalCursor()
Returns the value ofshowVerticalCursorProperty()
.- Returns:
- true if the cursor will be shown
- Since:
- 1.0
-
setShowVerticalCursor
public final void setShowVerticalCursor(boolean show)
Sets the value ofshowVerticalCursorProperty()
.- Parameters:
show
- if true a vertical cursor line will be shown- Since:
- 1.0
-
showHorizontalCursorProperty
public final BooleanProperty showHorizontalCursorProperty()
A property used to control wether a horizontal cursor line will be shown by the graphics view. The line will always follow the location of the mouse cursor.- Returns:
- a property used for controlling the visibility of a horizontal cursor line
- Since:
- 1.0
-
isShowHorizontalCursor
public final boolean isShowHorizontalCursor()
Returns the value ofshowHorizontalCursorProperty()
.- Returns:
- true if the cursor will be shown
- Since:
- 1.0
-
setShowHorizontalCursor
public final void setShowHorizontalCursor(boolean show)
Sets the value ofshowHorizontalCursorProperty()
.- Parameters:
show
- if true a horizontal cursor line will be shown- Since:
- 1.0
-
showMarkedTimeIntervalProperty
public final BooleanProperty showMarkedTimeIntervalProperty()
A property used to control whether vertical lines will be shown for a marked time interval (e.g. while dragging the marked interval will display the new location of the dragged activity).- Returns:
- a property used for controlling the visibility of a horizontal cursor line
- Since:
- 1.1
- See Also:
Eventline.markedTimeIntervalProperty()
-
isShowMarkedTimeInterval
public final boolean isShowMarkedTimeInterval()
Returns the value ofshowMarkedTimeIntervalProperty()
.- Returns:
- true if the marker lines will be shown
- Since:
- 1.1
- See Also:
Eventline.markedTimeIntervalProperty()
-
setShowMarkedTimeInterval
public final void setShowMarkedTimeInterval(boolean show)
Sets the value ofshowMarkedTimeIntervalProperty()
.- Parameters:
show
- if true marker lines will be drawn for the currently marked time interval- Since:
- 1.1
- See Also:
Eventline.markedTimeIntervalProperty()
-
debugModeProperty
public final BooleanProperty debugModeProperty()
A property used to enable / disable the debug mode. The debug mode will cause the object bounds of activities to be rendered in the graphics view and also the bounds of the lasso selection tool. Other information might get added in the future.- Returns:
- a property used to enable / disable the debug mode
- Since:
- 1.0
-
isDebugMode
public final boolean isDebugMode()
Returns the value ofdebugModeProperty()
.- Returns:
- true if the debug mode is enabled
- Since:
- 1.0
-
setDebugMode
public final void setDebugMode(boolean debug)
Sets the value ofdebugModeProperty()
.- Parameters:
debug
- if true the debug mode is enabled- Since:
- 1.0
-
autoGridEnabledProperty
public final BooleanProperty autoGridEnabledProperty()
A property used to enable / disable the autogrid mode. The autogrid mode will cause activities to snap to times based on the currently shown granularity of the dateline. If the dateline is showing "days" then the activities will snap to the beginning and / or end of a day. If the dateline is showing hours then the activities will snap to full hours.- Returns:
- a property used to enable / disable the debug mode
- Since:
- 1.1
-
isAutoGridEnabled
public final boolean isAutoGridEnabled()
Returns the value ofautoGridEnabledProperty()
.- Returns:
- true if the autogrid mode is enabled
- Since:
- 1.1
-
setAutoGridEnabled
public final void setAutoGridEnabled(boolean auto)
Sets the value ofautoGridEnabledProperty()
.- Parameters:
auto
- if true the autogrid mode is enabled- Since:
- 1.1
-
gridEnabledProperty
public final ReadOnlyBooleanProperty gridEnabledProperty()
A convenience read-only property to check whether any kind of grid is active, either the automatic grid or a virtual grid.- Returns:
- true if the graphics is using a grid for its editing operations
- Since:
- 1.2
- See Also:
autoGridEnabledProperty()
,getVirtualGrid()
-
isGridEnabled
public final boolean isGridEnabled()
Returns the value ofgridEnabledProperty()
.- Returns:
- true if any kind of grid support is enabled
- Since:
- 1.2
-
selectionModeProperty
public final ObjectProperty<GraphicsBase.SelectionMode> selectionModeProperty()
A property used to store the currently supported selection mode. The graphics view supports single, multiple, and none.- Returns:
- the property used to store the selection mode
- Since:
- 1.0
-
getSelectionMode
public final GraphicsBase.SelectionMode getSelectionMode()
Returns the value ofselectionModeProperty()
.- Returns:
- the currently used selection mode (single, all, none)
- Since:
- 1.0
-
setSelectionMode
public final void setSelectionMode(GraphicsBase.SelectionMode mode)
Sets the value ofselectionModeProperty()
.- Parameters:
mode
- the new selection mode- Since:
- 1.0
-
getSelectedActivities
public final ObservableList<ActivityRef<?>> getSelectedActivities()
Returns the list of currently selected activities.- Returns:
- the list of selected activities
- Since:
- 1.0
-
lassoSelectionBehaviourProperty
public final ObjectProperty<GraphicsBase.LassoSelectionBehaviour> lassoSelectionBehaviourProperty()
A property used to store the currently used lasso selection behaviour. This value of this property controls when an activity is actually considered selected by the lasso: does it need to be completely inside the lasso bounds or is it enough when it gets touched by the lasso?- Returns:
- the property used to store the lasso selection behaviour
- Since:
- 1.0
-
setLassoSelectionBehaviour
public final void setLassoSelectionBehaviour(GraphicsBase.LassoSelectionBehaviour behaviour)
Sets the value oflassoSelectionBehaviourProperty()
.- Parameters:
behaviour
- the lasso selection behaviour to use- Since:
- 1.0
-
getLassoSelectionBehaviour
public final GraphicsBase.LassoSelectionBehaviour getLassoSelectionBehaviour()
Returns the value of thelassoSelectionBehaviourProperty()
.- Returns:
- the currently used lasso selection behaviour
- Since:
- 1.0
-
getCalendars
public final ObservableList<Calendar<? extends CalendarActivity>> getCalendars()
Returns the list of calendars that are registered with the graphics view. Calendars are used to render static information in the background of each row. One example are the days that are considered weekend days (e.g. saturday and sunday). They will be drawn with a gray background.- Returns:
- the calendars drawn by the graphics view
- Since:
- 1.0
- See Also:
CalendarLayer.setCalendarActivityRenderer(Class, com.flexganttfx.view.graphics.renderer.CalendarActivityRenderer)
-
showEarliestActivities
public final void showEarliestActivities()
Makes theTimeline
start with the earliest time used by the currently loaded rows.- Since:
- 1.0
- See Also:
getEarliestTimeUsed()
,Timeline.showTime(Instant, boolean)
,ActivityRepository.getEarliestTimeUsed()
-
showLatestActivities
public final void showLatestActivities()
Makes theTimeline
show the latest time used by the currently loaded rows.- Since:
- 1.0
- See Also:
getLatestTimeUsed()
,Timeline.showTime(Instant, boolean)
,ActivityRepository.getLatestTimeUsed()
-
showAllActivities
public final void showAllActivities()
Makes theTimeline
show a time range starting with the earliest time used and ending with the latest time used by all currently loaded rows.
-
getEarliestTimeUsed
public final Instant getEarliestTimeUsed()
Calculates and returns the earliest time used by all rows in the model.- Returns:
- the earliest time used by the graphics view
- Since:
- 1.0
- See Also:
Row.getEarliestTimeUsed()
,ActivityRepository.getEarliestTimeUsed()
-
getLatestTimeUsed
public final Instant getLatestTimeUsed()
Calculates and returns the latest time used by all rows in the model.- Returns:
- the latest time used by the graphics view
- Since:
- 1.0
- See Also:
Row.getLatestTimeUsed()
,ActivityRepository.getLatestTimeUsed()
-
hoverActivityProperty
public final ReadOnlyObjectProperty<ActivityRef<?>> hoverActivityProperty()
-
getHoverActivity
public final ActivityRef<?> getHoverActivity()
-
hoverRowProperty
public final ReadOnlyObjectProperty<R> hoverRowProperty()
-
getHoverRow
public final R getHoverRow()
-
hoverLayoutProperty
public final ReadOnlyObjectProperty<Layout> hoverLayoutProperty()
-
getHoverLayout
public final Layout getHoverLayout()
-
editedActivityProperty
public final ReadOnlyObjectProperty<ActivityRef<?>> editedActivityProperty()
-
getEditedActivity
public final ActivityRef<?> getEditedActivity()
-
pressedActivityProperty
public final ReadOnlyObjectProperty<ActivityRef<?>> pressedActivityProperty()
-
getPressedActivity
public final ActivityRef<?> getPressedActivity()
-
virtualGridProperty
public final ObjectProperty<VirtualGrid<?>> virtualGridProperty()
-
getVirtualGrid
public final VirtualGrid<?> getVirtualGrid()
-
setVirtualGrid
public final void setVirtualGrid(VirtualGrid<?> grid)
-
getVirtualGrids
public final ObservableList<VirtualGrid<?>> getVirtualGrids()
-
placeholderProperty
public final ObjectProperty<Node> placeholderProperty()
-
getPlaceholder
public final Node getPlaceholder()
-
setPlaceholder
public final void setPlaceholder(Node node)
-
getRowPanes
public final ObservableList<RowPane<R>> getRowPanes()
-
redraw
public void redraw()
Performs a redraw of the displayed activities. Also lays out the links shown by theLinksPane
.
-
layoutLinks
public void layoutLinks()
-
getAllActivityRenderers
public final List<ActivityRenderer<?>> getAllActivityRenderers()
Returns a list of all currently registered activity renderers.- Returns:
- all activity renderers
- Since:
- 8.9.0
-
setActivityRenderer
public final <A extends Activity> void setActivityRenderer(Class<? extends A> activityType, Class<? extends Layout> layoutType, ActivityRenderer<? extends A> renderer)
Registers a renderer for the given activity and layout type. The renderer will be used to "draw" any activity of the given type when the activity is laid out via the given layout.- Type Parameters:
A
- the type of the activity- Parameters:
activityType
- the type of the activitylayoutType
- the type of the layoutrenderer
- the renderer instance
-
getActivityRenderer
public final <A extends Activity> ActivityRenderer<? extends A> getActivityRenderer(Class<? extends A> activityType, Class<? extends Layout> layoutType)
-
setActivityEditingCallback
public final void setActivityEditingCallback(Class<? extends MutableActivity> activityType, Callback<GraphicsBase.EditingCallbackParameter,Boolean> callback)
Registers a callback used to determine if a given editing operation can be used for a given activity.- Parameters:
activityType
- the type of the activity for which to use the callbackcallback
- the callback- Since:
- 1.0
-
getActivityEditingCallback
public final <A extends Activity> Callback<GraphicsBase.EditingCallbackParameter,Boolean> getActivityEditingCallback(Class<A> activityType)
-
setRowDragAndDropCallback
public final void setRowDragAndDropCallback(Class<? extends Row> rowType, Callback<GraphicsBase.DragAndDropInfo,Boolean> callback)
Specifies a callback that will be invoked when the user drags an activity over a row of the given type. The callback implementation then determines if a drop would be accepted in the given row.- Parameters:
rowType
- the type of the row for which the callback gets registeredcallback
- the callback implementation- Since:
- 1.0
-
getRowDragAndDropCallback
public final Callback<GraphicsBase.DragAndDropInfo,Boolean> getRowDragAndDropCallback(Class<? extends Row> rowType)
Returns a callback that will be invoked when the user drags an activity over a row of the given type. The callback implementation then determines if a drop would be accepted in the given row.- Parameters:
rowType
- the type of the row for which the callback gets registered- Returns:
- the callback implementation
- Since:
- 1.0
-
dragAndDropInfoProperty
public final ReadOnlyObjectProperty<GraphicsBase.DragAndDropInfo> dragAndDropInfoProperty()
A property used to store the current drag and drop information. This object stores data relevant to the current drag and drop operation.- Returns:
- the property used to store the current drag and drop information
- Since:
- 1.0
-
getDragAndDropInfo
public final GraphicsBase.DragAndDropInfo getDragAndDropInfo()
Returns the value ofdragAndDropInfoProperty()
.- Returns:
- the current drag and drop information
- Since:
- 1.0
-
dragImageProviderProperty
public final ObjectProperty<Callback<ActivityRef<?>,Image>> dragImageProviderProperty()
-
setDragImageProvider
public final void setDragImageProvider(Callback<ActivityRef<?>,Image> provider)
-
getDragImageProvider
public final Callback<ActivityRef<?>,Image> getDragImageProvider()
-
getBackgroundSystemLayer
public final <SL extends SystemLayer<R>> SL getBackgroundSystemLayer(Class<SL> layerType)
-
getForegroundSystemLayer
public final <SL extends SystemLayer<R>> SL getForegroundSystemLayer(Class<SL> layerType)
-
getSystemLayer
public final <SL extends SystemLayer<R>> SL getSystemLayer(Class<SL> layerType)
-
getBackgroundSystemLayers
public final ObservableList<SystemLayer<R>> getBackgroundSystemLayers()
-
getForegroundSystemLayers
public final ObservableList<SystemLayer<R>> getForegroundSystemLayers()
-
showAgendaLinesLayerProperty
public final BooleanProperty showAgendaLinesLayerProperty()
-
setShowAgendaLinesLayer
public final void setShowAgendaLinesLayer(boolean show)
-
isShowAgendaLinesLayer
public final boolean isShowAgendaLinesLayer()
-
showCalendarLayerProperty
public final BooleanProperty showCalendarLayerProperty()
-
setShowCalendarLayer
public final void setShowCalendarLayer(boolean show)
-
isShowCalendarLayer
public final boolean isShowCalendarLayer()
-
showLayoutLayerProperty
public final BooleanProperty showLayoutLayerProperty()
-
setShowLayoutLayer
public final void setShowLayoutLayer(boolean show)
-
isShowLayoutLayer
public final boolean isShowLayoutLayer()
-
showChartLinesLayerProperty
public final BooleanProperty showChartLinesLayerProperty()
-
setShowChartLinesLayer
public final void setShowChartLinesLayer(boolean show)
-
isShowChartLinesLayer
public final boolean isShowChartLinesLayer()
-
showGridLineLayerProperty
public final BooleanProperty showGridLineLayerProperty()
-
setShowGridLineLayer
public final void setShowGridLineLayer(boolean show)
-
isShowGridLineLayer
public final boolean isShowGridLineLayer()
-
showHoverTimeIntervalLayerProperty
public final BooleanProperty showHoverTimeIntervalLayerProperty()
-
setShowHoverTimeIntervalLayer
public final void setShowHoverTimeIntervalLayer(boolean show)
-
isShowHoverTimeIntervalLayer
public final boolean isShowHoverTimeIntervalLayer()
-
showInnerLinesLayerProperty
public final BooleanProperty showInnerLinesLayerProperty()
-
setShowInnerLinesLayer
public final void setShowInnerLinesLayer(boolean show)
-
isShowInnerLinesLayer
public final boolean isShowInnerLinesLayer()
-
showNowLineLayerProperty
public final BooleanProperty showNowLineLayerProperty()
-
setShowNowLineLayer
public final void setShowNowLineLayer(boolean show)
-
isShowNowLineLayer
public final boolean isShowNowLineLayer()
-
showDSTLineLayerProperty
public final BooleanProperty showDSTLineLayerProperty()
-
setShowDSTLineLayer
public final void setShowDSTLineLayer(boolean show)
-
isShowDSTLineLayer
public final boolean isShowDSTLineLayer()
-
showRowLayerProperty
public final BooleanProperty showRowLayerProperty()
-
setShowRowLayer
public final void setShowRowLayer(boolean show)
-
isShowRowLayer
public final boolean isShowRowLayer()
-
showScaleLayerProperty
public final BooleanProperty showScaleLayerProperty()
-
setShowScaleLayer
public final void setShowScaleLayer(boolean show)
-
isShowScaleLayer
public final boolean isShowScaleLayer()
-
showSelectedTimeIntervalsLayerProperty
public final BooleanProperty showSelectedTimeIntervalsLayerProperty()
-
setShowSelectedTimeIntervalsLayer
public final void setShowSelectedTimeIntervalsLayer(boolean show)
-
isShowSelectedTimeIntervalsLayer
public final boolean isShowSelectedTimeIntervalsLayer()
-
showZoomTimeIntervalLayerProperty
public final BooleanProperty showZoomTimeIntervalLayerProperty()
-
setShowZoomTimeIntervalLayer
public final void setShowZoomTimeIntervalLayer(boolean show)
-
isShowZoomTimeIntervalLayer
public final boolean isShowZoomTimeIntervalLayer()
-
showZoneIdProperty
public final BooleanProperty showZoneIdProperty()
-
setShowZoneId
public final void setShowZoneId(boolean show)
-
isShowZoneId
public final boolean isShowZoneId()
-
fadeInOutVisibilityChangesProperty
public final BooleanProperty fadeInOutVisibilityChangesProperty()
-
isFadeInOutVisibilityChanges
public final boolean isFadeInOutVisibilityChanges()
-
setFadeInOutVisibilityChanges
public final void setFadeInOutVisibilityChanges(boolean show)
-
fadeInOutVisibilityChangesDurationProperty
public final DoubleProperty fadeInOutVisibilityChangesDurationProperty()
-
getFadeInOutVisibilityChangesDuration
public final double getFadeInOutVisibilityChangesDuration()
-
setFadeInOutVisibilityChangesDuration
public final void setFadeInOutVisibilityChangesDuration(double duration)
-
dragAndDropFeedbackProperty
public final ObjectProperty<GraphicsBase.DragAndDropFeedback> dragAndDropFeedbackProperty()
-
setDragAndDropFeedback
public final void setDragAndDropFeedback(GraphicsBase.DragAndDropFeedback feedback)
-
getDragAndDropFeedback
public final GraphicsBase.DragAndDropFeedback getDragAndDropFeedback()
-
rowControlsFactoryProperty
public final ObjectProperty<Callback<GraphicsBase.RowControlsParameter<R>,Node>> rowControlsFactoryProperty()
-
setRowControlsFactory
public final void setRowControlsFactory(Callback<GraphicsBase.RowControlsParameter<R>,Node> factory)
-
getRowControlsFactory
public final Callback<GraphicsBase.RowControlsParameter<R>,Node> getRowControlsFactory()
-
rowEditorFactoryProperty
public final ObjectProperty<Callback<GraphicsBase.RowEditorParameter<R>,Node>> rowEditorFactoryProperty()
-
setRowEditorFactory
public final void setRowEditorFactory(Callback<GraphicsBase.RowEditorParameter<R>,Node> factory)
-
getRowEditorFactory
public final Callback<GraphicsBase.RowEditorParameter<R>,Node> getRowEditorFactory()
-
rowEditingModeProperty
public final ObjectProperty<GraphicsBase.RowEditingMode> rowEditingModeProperty()
-
setRowEditingMode
public final void setRowEditingMode(GraphicsBase.RowEditingMode mode)
-
getRowEditingMode
public final GraphicsBase.RowEditingMode getRowEditingMode()
-
getRowsEditing
public final ObservableList<R> getRowsEditing()
-
stopRowEditing
public final void stopRowEditing()
-
stopRowEditing
public final void stopRowEditing(R row)
-
startRowEditing
public final void startRowEditing(R row)
-
animateRowEditorProperty
public final BooleanProperty animateRowEditorProperty()
-
setAnimateRowEditor
public final void setAnimateRowEditor(boolean animate)
-
isAnimateRowEditor
public final boolean isAnimateRowEditor()
-
setEditModeCallback
public final void setEditModeCallback(Class<? extends MutableActivity> activityType, Class<? extends Layout> layoutType, Callback<GraphicsBase.EditModeCallbackParameter,GraphicsBase.EditMode> callback)
-
getEditModeCallback
public final Callback<GraphicsBase.EditModeCallbackParameter,GraphicsBase.EditMode> getEditModeCallback(Class<? extends MutableActivity> activityType, Class<? extends Layout> layoutType)
-
dropLayerProviderProperty
public final ObjectProperty<Callback<GraphicsBase.DragAndDropInfo,Layer>> dropLayerProviderProperty()
A property used to store a callback that will return the layer on which a dragged activity will be placed once the drop operation has finished. The default provider returns the layer on which the activity is currently shown.- Returns:
- a property used to store the drop layer provider
- Since:
- 1.2
-
getDropLayerProvider
public final Callback<GraphicsBase.DragAndDropInfo,Layer> getDropLayerProvider()
Returns the value ofdropLayerProviderProperty()
.- Returns:
- the drop layer provider used for DnD operations
- Since:
- 1.2
-
setDropLayerProvider
public final void setDropLayerProvider(Callback<GraphicsBase.DragAndDropInfo,Layer> provider)
Sets the value ofdropLayerProviderProperty()
.- Parameters:
provider
- the drop layer provider used for DnD operations- Since:
- 1.2
-
horizontalDragEnabledProperty
public final BooleanProperty horizontalDragEnabledProperty()
Determines whether the user can perform a horizontal drag with a mouse drag.- Returns:
- true if the visible time range can be changed via a mouse drag
- Since:
- 1.3
-
setHorizontalDragEnabled
public final void setHorizontalDragEnabled(boolean enabled)
Sets the value ofhorizontalDragEnabledProperty()
.- Parameters:
enabled
- if true the user can perform horizontal scrolling
-
isHorizontalDragEnabled
public final boolean isHorizontalDragEnabled()
Returns the value ofhorizontalDragEnabledProperty()
.- Returns:
- true if the user can perform horizontal scrolling
-
safeRenderingProperty
public final BooleanProperty safeRenderingProperty()
Returns the property that specifies whether the various canvas API-based rendering parts inside this framework will always callGraphicsContext.save()
to save the current state of the context before changing its state (followed byGraphicsContext.restore()
to restore the old state).Using save / restore will ensure that the pluggable system layers and activity renderers will not have any side effects on each other. Setting this property to true has an impact on performance. The default value of this property is false.
Example
The following code shows how the property is used within the framework.GraphicsContext gc = canvas.getGraphicsContext2D(); if (graphics.isSafeRendering()) { gc.save(); } gc.setTransform(...); gc.strokeLine(...); if (graphics.isSafeRendering()) { gc.restore(); }
- Returns:
- the property to control safe rendering
-
setSafeRendering
public final void setSafeRendering(boolean safe)
Sets the value ofsafeRenderingProperty()
.- Parameters:
safe
- if true the safe rendering mode will be used (the graphics context state will be saved before invoking renderers or drawing system layers).
-
isSafeRendering
public final boolean isSafeRendering()
Returns the value ofsafeRenderingProperty()
.- Returns:
- "true" if the safe rendering mode will be used (the graphics context state will be saved before invoking renderers or drawing system layers).
-
gridLineColor1Property
public final StyleableObjectProperty<Paint> gridLineColor1Property()
-
getGridLineColor1
public final Paint getGridLineColor1()
-
setGridLineColor1
public void setGridLineColor1(Paint color)
-
gridLineColor2Property
public final StyleableObjectProperty<Paint> gridLineColor2Property()
-
getGridLineColor2
public final Paint getGridLineColor2()
-
setGridLineColor2
public void setGridLineColor2(Paint color)
-
gridLineColor3Property
public final StyleableObjectProperty<Paint> gridLineColor3Property()
-
getGridLineColor3
public final Paint getGridLineColor3()
-
setGridLineColor3
public void setGridLineColor3(Paint color)
-
weekendColorProperty
public final StyleableObjectProperty<Paint> weekendColorProperty()
-
getWeekendColor
public final Paint getWeekendColor()
-
setWeekendColor
public void setWeekendColor(Paint color)
-
timeNowColorProperty
public final StyleableObjectProperty<Paint> timeNowColorProperty()
-
getTimeNowColor
public final Paint getTimeNowColor()
-
setTimeNowColor
public void setTimeNowColor(Paint color)
-
innerLinesColorProperty
public final StyleableObjectProperty<Paint> innerLinesColorProperty()
-
getInnerLinesColor
public final Paint getInnerLinesColor()
-
setInnerLinesColor
public void setInnerLinesColor(Paint color)
-
getClassCssMetaData
public static List<CssMetaData<? extends Styleable,?>> getClassCssMetaData()
-
getControlCssMetaData
public final List<CssMetaData<? extends Styleable,?>> getControlCssMetaData()
- Overrides:
getControlCssMetaData
in classControl
-
-