Class GraphicsBase<R extends Row<?,​?,​?>>

  • 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 (see SystemLayer). 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 of GraphicsBase. 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 pattern setShowXYZLayer. System layers that are controlled like this will appear and disappear with a fade in / fade out animation, while calling SystemLayer.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 an GraphicsBase.EditMode and can be registered by calling setEditModeCallback(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 calling setActivityEditingCallback(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 type ActivityEvent 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 the setOnActivityXYZEvent() methods or by adding an event handler directly via addEventHandler(ActionEvent.ACTIVITY_XYZ, ...). Events are fired while the change is being performed and once it has been completed. For this the ActivityEvent 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 calling getActivityBoundsAt(double, double) or getActivityRefAt(double, double). The time at an x-coordinate can be looked up by calling getTimeAt(double). The opposite direction is also available: a location can be found for a given time by calling getLocation(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 calling setContextMenuCallback(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 (see GraphicsBase.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
    • 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

      • 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 of rowFilterProperty().
        Parameters:
        predicate - 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
      • 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 of lassoEnabledProperty().
        Parameters:
        enabled - if true the lasso will be usable by the user
        Since:
        1.6
      • isLassoEnabled

        public final boolean isLassoEnabled()
        Returns the value of lassoEnabledProperty().
        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 of automaticRedrawProperty().
        Returns:
        true if automatic redrawing will be performed (default)
        Since:
        1.5
      • setAutomaticRedraw

        public final void setAutomaticRedraw​(boolean automatic)
        Sets the value of automaticRedrawProperty().
        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 of lassoActiveProperty().
        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 of lassoSnapsToGridProperty().
        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 of lassoSnapsToGridProperty().
        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 the rowsProperty().
        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 of timelineProperty().
        Parameters:
        timeline - the timeline control above the graphics
        Since:
        1.0
      • getTimeline

        public final Timeline getTimeline()
        Returns the value of timelineProperty().
        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 of fixedCellSizeProperty().
        Returns:
        the fixed cell size (default is -1)
        Since:
        1.0
      • setFixedCellSize

        public final void setFixedCellSize​(double size)
        Sets the value of fixedCellSizeProperty().
        Parameters:
        size - the fixed cell size, -1 to disable fixed cell size
        Since:
        1.0
      • 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 the AgendaLayout 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 view
        y - 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 view
        y - 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 view
        y - 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 view
        y - 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 view
        y - 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()
      • setOnActivityChartValueChangeStarted

        public final void setOnActivityChartValueChangeStarted​(EventHandler<ActivityEvent> value)
      • setOnActivityChartValueChangeOngoing

        public final void setOnActivityChartValueChangeOngoing​(EventHandler<ActivityEvent> value)
      • setOnActivityChartValueChangeFinished

        public final void setOnActivityChartValueChangeFinished​(EventHandler<ActivityEvent> value)
      • setOnActivityChartHighValueChangeStarted

        public final void setOnActivityChartHighValueChangeStarted​(EventHandler<ActivityEvent> value)
      • getOnActivityChartHighValueChangeStarted

        public final EventHandler<ActivityEvent> getOnActivityChartHighValueChangeStarted()
      • setOnActivityChartHighValueChangeOngoing

        public final void setOnActivityChartHighValueChangeOngoing​(EventHandler<ActivityEvent> value)
      • getOnActivityChartHighValueChangeOngoing

        public final EventHandler<ActivityEvent> getOnActivityChartHighValueChangeOngoing()
      • setOnActivityChartHighValueChangeFinished

        public final void setOnActivityChartHighValueChangeFinished​(EventHandler<ActivityEvent> value)
      • getOnActivityChartHighValueChangeFinished

        public final EventHandler<ActivityEvent> getOnActivityChartHighValueChangeFinished()
      • setOnActivityChartLowValueChangeStarted

        public final void setOnActivityChartLowValueChangeStarted​(EventHandler<ActivityEvent> value)
      • getOnActivityChartLowValueChangeStarted

        public final EventHandler<ActivityEvent> getOnActivityChartLowValueChangeStarted()
      • setOnActivityChartLowValueChangeOngoing

        public final void setOnActivityChartLowValueChangeOngoing​(EventHandler<ActivityEvent> value)
      • getOnActivityChartLowValueChangeOngoing

        public final EventHandler<ActivityEvent> getOnActivityChartLowValueChangeOngoing()
      • setOnActivityChartLowValueChangeFinished

        public final void setOnActivityChartLowValueChangeFinished​(EventHandler<ActivityEvent> value)
      • getOnActivityChartLowValueChangeFinished

        public final EventHandler<ActivityEvent> getOnActivityChartLowValueChangeFinished()
      • setOnActivityHorizontalDragStarted

        public final void setOnActivityHorizontalDragStarted​(EventHandler<ActivityEvent> value)
      • setOnActivityHorizontalDragOngoing

        public final void setOnActivityHorizontalDragOngoing​(EventHandler<ActivityEvent> value)
      • setOnActivityHorizontalDragFinished

        public final void setOnActivityHorizontalDragFinished​(EventHandler<ActivityEvent> value)
      • setOnActivityVerticalDragStarted

        public final void setOnActivityVerticalDragStarted​(EventHandler<ActivityEvent> value)
      • setOnActivityVerticalDragOngoing

        public final void setOnActivityVerticalDragOngoing​(EventHandler<ActivityEvent> value)
      • setOnActivityVerticalDragFinished

        public final void setOnActivityVerticalDragFinished​(EventHandler<ActivityEvent> value)
      • setOnActivityEndTimeChangeStarted

        public final void setOnActivityEndTimeChangeStarted​(EventHandler<ActivityEvent> value)
      • setOnActivityEndTimeChangeOngoing

        public final void setOnActivityEndTimeChangeOngoing​(EventHandler<ActivityEvent> value)
      • setOnActivityEndTimeChangeFinished

        public final void setOnActivityEndTimeChangeFinished​(EventHandler<ActivityEvent> value)
      • setOnActivityPercentageChangeStarted

        public final void setOnActivityPercentageChangeStarted​(EventHandler<ActivityEvent> value)
      • setOnActivityPercentageChangeOngoing

        public final void setOnActivityPercentageChangeOngoing​(EventHandler<ActivityEvent> value)
      • setOnActivityPercentageChangeFinished

        public final void setOnActivityPercentageChangeFinished​(EventHandler<ActivityEvent> value)
      • setOnActivityStartTimeChangeStarted

        public final void setOnActivityStartTimeChangeStarted​(EventHandler<ActivityEvent> value)
      • setOnActivityStartTimeChangeOngoing

        public final void setOnActivityStartTimeChangeOngoing​(EventHandler<ActivityEvent> value)
      • setOnActivityStartTimeChangeFinished

        public final void setOnActivityStartTimeChangeFinished​(EventHandler<ActivityEvent> value)
      • setOnLassoSelectionStarted

        public final void setOnLassoSelectionStarted​(EventHandler<LassoEvent> value)
      • setOnLassoSelectionOngoing

        public final void setOnLassoSelectionOngoing​(EventHandler<LassoEvent> value)
      • setOnLassoSelectionFinished

        public final void setOnLassoSelectionFinished​(EventHandler<LassoEvent> value)
      • 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). See setActivityEditingCallback(Class, Callback) for mapping mouse events to editing operations.
        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 of highlightDelayProperty().
        Parameters:
        delay - the highlight delay in milliseconds
        Since:
        1.0
      • getHighlightDelay

        public final long getHighlightDelay()
        Returns the value of highlightDelayProperty().
        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 of highlightedProperty().
        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 calling Control.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
      • 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 of extraPixelsProperty().
        Returns:
        the number of extra pixels added to the visible area
        Since:
        1.0
      • setExtraPixels

        public final void setExtraPixels​(int pixels)
        Sets the value of extraPixelsProperty().
        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 the Eventline 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 of autoMarkedTimeIntervalProperty().
        Returns:
        true if the marked time interval gets updated automatically
      • setAutoMarkedTimeInterval

        public final void setAutoMarkedTimeInterval​(boolean auto)
        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 (see Dateline.getScaleResolutions()). If the dateline is currently showing two scales (e.g. days and weeks) then the graphics view and the GridLinesLayer 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 of maxGridLevelProperty().
        Returns:
        the maximum number of grid levels
        Since:
        1.0
      • setMaxGridLevel

        public final void setMaxGridLevel​(int max)
        Sets the value of maxGridLevelProperty().
        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 of showVerticalCursorProperty().
        Returns:
        true if the cursor will be shown
        Since:
        1.0
      • setShowVerticalCursor

        public final void setShowVerticalCursor​(boolean show)
        Sets the value of showVerticalCursorProperty().
        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 of showHorizontalCursorProperty().
        Returns:
        true if the cursor will be shown
        Since:
        1.0
      • setShowHorizontalCursor

        public final void setShowHorizontalCursor​(boolean show)
        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()
      • 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 of debugModeProperty().
        Returns:
        true if the debug mode is enabled
        Since:
        1.0
      • setDebugMode

        public final void setDebugMode​(boolean debug)
        Sets the value of debugModeProperty().
        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 of autoGridEnabledProperty().
        Returns:
        true if the autogrid mode is enabled
        Since:
        1.1
      • setAutoGridEnabled

        public final void setAutoGridEnabled​(boolean auto)
        Sets the value of autoGridEnabledProperty().
        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 of gridEnabledProperty().
        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
      • 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
      • getHoverActivity

        public final ActivityRef<?> getHoverActivity()
      • getHoverRow

        public final R getHoverRow()
      • getHoverLayout

        public final Layout getHoverLayout()
      • getEditedActivity

        public final ActivityRef<?> getEditedActivity()
      • getPressedActivity

        public final ActivityRef<?> getPressedActivity()
      • getVirtualGrid

        public final VirtualGrid<?> getVirtualGrid()
      • setVirtualGrid

        public final void setVirtualGrid​(VirtualGrid<?> grid)
      • getPlaceholder

        public final Node getPlaceholder()
      • setPlaceholder

        public final void setPlaceholder​(Node node)
      • redraw

        public void redraw()
        Performs a redraw of the displayed activities. Also lays out the links shown by the LinksPane.
      • 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 activity
        layoutType - the type of the layout
        renderer - the renderer instance
      • 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 callback
        callback - the callback
        Since:
        1.0
      • 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 registered
        callback - 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
      • 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)
      • 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()
      • 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)
      • 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()
      • 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
      • 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)
        Parameters:
        enabled - if true the user can perform horizontal scrolling
      • isHorizontalDragEnabled

        public final boolean isHorizontalDragEnabled()
        Returns the value of horizontalDragEnabledProperty().
        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 call GraphicsContext.save() to save the current state of the context before changing its state (followed by GraphicsContext.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 of safeRenderingProperty().
        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 of safeRenderingProperty().
        Returns:
        "true" if the safe rendering mode will be used (the graphics context state will be saved before invoking renderers or drawing system layers).
      • getGridLineColor1

        public final Paint getGridLineColor1()
      • setGridLineColor1

        public void setGridLineColor1​(Paint color)
      • getGridLineColor2

        public final Paint getGridLineColor2()
      • setGridLineColor2

        public void setGridLineColor2​(Paint color)
      • getGridLineColor3

        public final Paint getGridLineColor3()
      • setGridLineColor3

        public void setGridLineColor3​(Paint color)
      • getWeekendColor

        public final Paint getWeekendColor()
      • setWeekendColor

        public void setWeekendColor​(Paint color)
      • getTimeNowColor

        public final Paint getTimeNowColor()
      • setTimeNowColor

        public void setTimeNowColor​(Paint color)
      • getInnerLinesColor

        public final Paint getInnerLinesColor()
      • setInnerLinesColor

        public void setInnerLinesColor​(Paint color)