Class ActivityEvent

All Implemented Interfaces:
Serializable, Cloneable

public class ActivityEvent
extends InputEvent
Activity events are being fired whenever the user makes a change to an activity in the graphics view. Event handlers for the event types listed in this class can be registered on the GraphicsBase control.

Code Example 1

 GanttChart gantt = new GanttChart();
 GraphicsView graphics = gantt.getGraphics();
 graphics.setOnActivityChanged(evt -> handleChange(evt));
 

Code Example 2

 GanttChart gantt = new GanttChart();
 GraphicsView graphics = gantt.getGraphics();
 graphics.addEventHandler(ActivityEvent.ACTIVITY_CHANGED,
                evt -> handleChange(evt));
 
Since:
1.0
See Also:
GraphicsBase.setOnActivityChange(javafx.event.EventHandler), Serialized Form
  • Field Details

    • ACTIVITY_CHANGE

      public static final EventType<ActivityEvent> ACTIVITY_CHANGE
      The parent event type of all other activity event types. Gets fired whenever anything changes.
      Since:
      1.0
    • ACTIVITY_CHANGE_STARTED

      public static final EventType<ActivityEvent> ACTIVITY_CHANGE_STARTED
      The parent event type of all STARTED activity event types. Gets fired whenever a change type is starting, e.g. DRAG_STARTED.
      Since:
      1.0
    • ACTIVITY_CHANGE_ONGOING

      public static final EventType<ActivityEvent> ACTIVITY_CHANGE_ONGOING
      The parent event type of all ONGOING activity event types. Gets fired whenever a change type is ongoing, e.g. DRAG_ONGOING.
      Since:
      1.0
    • ACTIVITY_CHANGE_FINISHED

      public static final EventType<ActivityEvent> ACTIVITY_CHANGE_FINISHED
      The parent event type of all FINISHED activity event types. Gets fired whenever a change type is finishing, e.g. DRAG_FINISHED.
      Since:
      1.0
    • ACTIVITY_DELETED

      public static final EventType<ActivityEvent> ACTIVITY_DELETED
      An event type used when the user pressed the delete shortcut to delete an activity.
      Since:
      1.0
    • START_TIME_CHANGE_STARTED

      public static final EventType<ActivityEvent> START_TIME_CHANGE_STARTED
      An event type used when the user is about to change the start time of an activity.
      Since:
      1.0
    • START_TIME_CHANGE_FINISHED

      public static final EventType<ActivityEvent> START_TIME_CHANGE_FINISHED
      An event type used when the start time of an activity has finished changing.
      Since:
      1.0
    • START_TIME_CHANGE_ONGOING

      public static final EventType<ActivityEvent> START_TIME_CHANGE_ONGOING
      An event type used when the start time of an activity is currently being changed.
      Since:
      1.0
    • END_TIME_CHANGE_STARTED

      public static final EventType<ActivityEvent> END_TIME_CHANGE_STARTED
      An event type used when the user starts changing the end time of an activity.
      Since:
      1.0
    • END_TIME_CHANGE_FINISHED

      public static final EventType<ActivityEvent> END_TIME_CHANGE_FINISHED
      An event type used when the end time of an activity has finished changing.
      Since:
      1.0
    • END_TIME_CHANGE_ONGOING

      public static final EventType<ActivityEvent> END_TIME_CHANGE_ONGOING
      An event type used when the end time of an activity is currently being changed.
      Since:
      1.0
    • HORIZONTAL_DRAG_STARTED

      public static final EventType<ActivityEvent> HORIZONTAL_DRAG_STARTED
      An event type being used when the user has started dragging an activity within its row, which means that the start and end time will both change at the same time.
      Since:
      1.0
    • HORIZONTAL_DRAG_ONGOING

      public static final EventType<ActivityEvent> HORIZONTAL_DRAG_ONGOING
      An event type that gets used when the user is in the process of dragging the activity within its row, changing the start and end time at the same time.
      Since:
      1.0
    • HORIZONTAL_DRAG_FINISHED

      public static final EventType<ActivityEvent> HORIZONTAL_DRAG_FINISHED
      An event type being used when the user has finished dragging an activity within its row, which means that the start and end time have both changed at the same time.
      Since:
      1.0
    • VERTICAL_DRAG_STARTED

      public static final EventType<ActivityEvent> VERTICAL_DRAG_STARTED
      An event type being used when the user has started dragging an activity from one row to another while preserving the start and end time of the activity.
      Since:
      1.0
    • VERTICAL_DRAG_ONGOING

      public static final EventType<ActivityEvent> VERTICAL_DRAG_ONGOING
      An event type that gets used when the user is in the process of dragging the activity from one row to another while preserving the start and end time of the activity.
      Since:
      1.0
    • VERTICAL_DRAG_FINISHED

      public static final EventType<ActivityEvent> VERTICAL_DRAG_FINISHED
      An event type being used when the user has finished dragging an activity from one row to another while preserving the start and end time of the activity.
      Since:
      1.0
    • VERTICAL_DRAG_DONE

      public static final EventType<ActivityEvent> VERTICAL_DRAG_DONE
      An event type being used when the user has finished dragging an activity. This event does not necessarily mean that the activity was dropped onto another row. The drop might have ended outside the Gantt chart control and maybe even outside of JavaFX / the JVM.
      Since:
      1.2
    • DRAG_STARTED

      public static final EventType<ActivityEvent> DRAG_STARTED
      An event type being used when the user has started dragging an activity from one row to another and changing its start time at the same time (diagonal drag).
      Since:
      1.0
    • DRAG_ONGOING

      public static final EventType<ActivityEvent> DRAG_ONGOING
      An event type being used when the user is in the process of dragging an activity from one row to another and changing its start time at the same time (diagonal drag).
      Since:
      1.0
    • DRAG_FINISHED

      public static final EventType<ActivityEvent> DRAG_FINISHED
      An event type being used when the user has finished dragging an activity from one row to another and changing its start time at the same time (diagonal drag).
      Since:
      1.0
    • DRAG_DONE

      public static final EventType<ActivityEvent> DRAG_DONE
      An event type being used when the user has finished dragging an activity. This event does not necessarily mean that the activity was dropped onto another row. The drop might have ended outside the Gantt chart control and maybe even outside of JavaFX / the JVM.
      Since:
      1.2
    • PERCENTAGE_CHANGE_STARTED

      public static final EventType<ActivityEvent> PERCENTAGE_CHANGE_STARTED
      An event type being used when the user has started changing the percentage complete value of a MutableCompletableActivity.
      Since:
      1.0
    • PERCENTAGE_CHANGE_FINISHED

      public static final EventType<ActivityEvent> PERCENTAGE_CHANGE_FINISHED
      An event type being used when the user has finished changing the percentage complete value of a MutableCompletableActivity.
      Since:
      1.0
    • PERCENTAGE_CHANGE_ONGOING

      public static final EventType<ActivityEvent> PERCENTAGE_CHANGE_ONGOING
      An event type being used when the user is in the process of changing the percentage complete value of a MutableCompletableActivity.
      Since:
      1.0
    • CHART_VALUE_CHANGE_STARTED

      public static final EventType<ActivityEvent> CHART_VALUE_CHANGE_STARTED
      An event type being used when the user has started changing the chart value of a MutableChartActivity.
      Since:
      1.0
    • CHART_VALUE_CHANGE_FINISHED

      public static final EventType<ActivityEvent> CHART_VALUE_CHANGE_FINISHED
      An event type being used when the user has finished changing the chart value of a MutableChartActivity.
      Since:
      1.0
    • CHART_VALUE_CHANGE_ONGOING

      public static final EventType<ActivityEvent> CHART_VALUE_CHANGE_ONGOING
      An event type being used when the user is in the process of changing the chart value of a MutableChartActivity.
      Since:
      1.0
    • CHART_HIGH_VALUE_CHANGE_STARTED

      public static final EventType<ActivityEvent> CHART_HIGH_VALUE_CHANGE_STARTED
      An event type being used when the user has started changing the chart high value of a MutableHighLowChartActivity.
      Since:
      1.0
    • CHART_HIGH_VALUE_CHANGE_FINISHED

      public static final EventType<ActivityEvent> CHART_HIGH_VALUE_CHANGE_FINISHED
      An event type being used when the user has finished changing the chart high value of a MutableHighLowChartActivity.
      Since:
      1.0
    • CHART_HIGH_VALUE_CHANGE_ONGOING

      public static final EventType<ActivityEvent> CHART_HIGH_VALUE_CHANGE_ONGOING
      An event type being used when the user is in the process of changing the chart high value of a MutableHighLowChartActivity.
      Since:
      1.0
    • CHART_LOW_VALUE_CHANGE_STARTED

      public static final EventType<ActivityEvent> CHART_LOW_VALUE_CHANGE_STARTED
      An event type being used when the user has started changing the chart low value of a MutableHighLowChartActivity.
      Since:
      1.0
    • CHART_LOW_VALUE_CHANGE_FINISHED

      public static final EventType<ActivityEvent> CHART_LOW_VALUE_CHANGE_FINISHED
      An event type being used when the user has finished changing the chart low value of a MutableHighLowChartActivity.
      Since:
      1.0
    • CHART_LOW_VALUE_CHANGE_ONGOING

      public static final EventType<ActivityEvent> CHART_LOW_VALUE_CHANGE_ONGOING
      An event type being used when the user is in the process of changing the chart low value of a MutableHighLowChartActivity.
      Since:
      1.0
  • Constructor Details

  • Method Details

    • getActivityRef

      public final ActivityRef<?> getActivityRef()
    • getOldTime

      public final Instant getOldTime()
      Returns the end / start time of an activity before the user performed a change on it.
      Returns:
      the original time (e.g. start or end time)
      Since:
      1.0
    • getOldTimeInterval

      public final TimeInterval getOldTimeInterval()
      Returns the time interval of an activity before the user performed a change on it.
      Returns:
      the original time interval
      Since:
      1.0
    • getNewRow

      public final Row<?,​?,​?> getNewRow()
      Returns the parent row of an activity after the user performed a change on it (e. g. a vertical drag).
      Returns:
      the new parent row
      Since:
      1.3
    • getOldRow

      public final Row<?,​?,​?> getOldRow()
      Returns the parent row of an activity before the user performed a change on it (e. g. a vertical drag).
      Returns:
      the original parent row
      Since:
      1.0
    • getOldValue

      public final double getOldValue()
      Returns the value of an activity before the user performed a change on it.
      Returns:
      the original value (e.g. a chart value or percentage complete)
      Since:
      1.0
    • getAffectedTimeInterval

      public final TimeInterval getAffectedTimeInterval()
      Returns the entire affected time interval of the change. The method calculates the time interval of the old location of the activity and the time interval of the new location of the activity. The result is the union of these two intervals. This method is useful if the application needs to recompute data for the "affected" region.
      Returns:
      the time interval affected by the event
      Since:
      1.3
    • isPotentialEndTimeChange

      public final boolean isPotentialEndTimeChange()
      Determines if the event represents a change of the activity's end time. This is the case for the event types END_TIME_CHANGE_STARTED, END_TIME_CHANGE_ONGOING, and END_TIME_CHANGE_FINISHED.
      Returns:
      true if the activity's end time might be affected by the event
      Since:
      1.3
    • isPotentialStartTimeChange

      public final boolean isPotentialStartTimeChange()
      Determines if the event represents a change of the activity's start time. This is the case for the event types START_TIME_CHANGE_STARTED, START_TIME_CHANGE_ONGOING, and START_TIME_CHANGE_FINISHED.
      Returns:
      true if the activity's start time might be affected by the event
      Since:
      1.3
    • isPotentialTimeIntervalChange

      public final boolean isPotentialTimeIntervalChange()
      Determines if the event represents a change of the activity's time interval (start and / or end time). This is the case for the event types HORIZONTAL_DRAG_STARTED, HORIZONTAL_DRAG_ONGOING, HORIZONTAL_DRAG_FINISHED, DRAG_STARTED, DRAG_ONGOING, DRAG_FINISHED.
      Returns:
      true if the activity's time interval might be affected by the event
      Since:
      1.3
    • toString

      public final String toString()
      Overrides:
      toString in class EventObject