java.lang.Object
java.util.EventObject
javafx.event.Event
javafx.scene.input.InputEvent
com.flexganttfx.view.graphics.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 Summary
Fields Modifier and Type Field Description static EventType<ActivityEvent>
ACTIVITY_CHANGE
The parent event type of all other activity event types.static EventType<ActivityEvent>
ACTIVITY_CHANGE_FINISHED
The parent event type of all FINISHED activity event types.static EventType<ActivityEvent>
ACTIVITY_CHANGE_ONGOING
The parent event type of all ONGOING activity event types.static EventType<ActivityEvent>
ACTIVITY_CHANGE_STARTED
The parent event type of all STARTED activity event types.static EventType<ActivityEvent>
ACTIVITY_DELETED
An event type used when the user pressed the delete shortcut to delete an activity.static EventType<ActivityEvent>
CHART_HIGH_VALUE_CHANGE_FINISHED
An event type being used when the user has finished changing the chart high value of aMutableHighLowChartActivity
.static 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 aMutableHighLowChartActivity
.static EventType<ActivityEvent>
CHART_HIGH_VALUE_CHANGE_STARTED
An event type being used when the user has started changing the chart high value of aMutableHighLowChartActivity
.static EventType<ActivityEvent>
CHART_LOW_VALUE_CHANGE_FINISHED
An event type being used when the user has finished changing the chart low value of aMutableHighLowChartActivity
.static 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 aMutableHighLowChartActivity
.static EventType<ActivityEvent>
CHART_LOW_VALUE_CHANGE_STARTED
An event type being used when the user has started changing the chart low value of aMutableHighLowChartActivity
.static EventType<ActivityEvent>
CHART_VALUE_CHANGE_FINISHED
An event type being used when the user has finished changing the chart value of aMutableChartActivity
.static EventType<ActivityEvent>
CHART_VALUE_CHANGE_ONGOING
An event type being used when the user is in the process of changing the chart value of aMutableChartActivity
.static EventType<ActivityEvent>
CHART_VALUE_CHANGE_STARTED
An event type being used when the user has started changing the chart value of aMutableChartActivity
.static EventType<ActivityEvent>
DRAG_DONE
An event type being used when the user has finished dragging an activity.static 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).static 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).static 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).static EventType<ActivityEvent>
END_TIME_CHANGE_FINISHED
An event type used when the end time of an activity has finished changing.static EventType<ActivityEvent>
END_TIME_CHANGE_ONGOING
An event type used when the end time of an activity is currently being changed.static EventType<ActivityEvent>
END_TIME_CHANGE_STARTED
An event type used when the user starts changing the end time of an activity.static 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.static 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.static 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.static EventType<ActivityEvent>
PERCENTAGE_CHANGE_FINISHED
An event type being used when the user has finished changing the percentage complete value of aMutableCompletableActivity
.static EventType<ActivityEvent>
PERCENTAGE_CHANGE_ONGOING
An event type being used when the user is in the process of changing the percentage complete value of aMutableCompletableActivity
.static EventType<ActivityEvent>
PERCENTAGE_CHANGE_STARTED
An event type being used when the user has started changing the percentage complete value of aMutableCompletableActivity
.static EventType<ActivityEvent>
START_TIME_CHANGE_FINISHED
An event type used when the start time of an activity has finished changing.static EventType<ActivityEvent>
START_TIME_CHANGE_ONGOING
An event type used when the start time of an activity is currently being changed.static EventType<ActivityEvent>
START_TIME_CHANGE_STARTED
An event type used when the user is about to change the start time of an activity.static EventType<ActivityEvent>
VERTICAL_DRAG_DONE
An event type being used when the user has finished dragging an activity.static 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.static 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.static 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.Fields inherited from class javafx.scene.input.InputEvent
ANY
Fields inherited from class javafx.event.Event
consumed, eventType, NULL_SOURCE_TARGET, target
Fields inherited from class java.util.EventObject
source
-
Constructor Summary
Constructors Constructor Description ActivityEvent(ActivityRef<?> activity, EventTarget target, EventType<? extends ActivityEvent> eventType)
ActivityEvent(ActivityRef<?> activity, EventTarget target, EventType<? extends ActivityEvent> eventType, double oldValue)
ActivityEvent(ActivityRef<?> activity, EventTarget target, EventType<? extends ActivityEvent> eventType, Row<?,?,?> oldRow, Row<?,?,?> newRow, TimeInterval oldTimeInterval)
ActivityEvent(ActivityRef<?> activity, EventTarget target, EventType<? extends ActivityEvent> eventType, TimeInterval oldInterval)
ActivityEvent(ActivityRef<?> activity, EventTarget target, EventType<? extends ActivityEvent> eventType, Instant oldTime)
-
Method Summary
Modifier and Type Method Description ActivityRef<?>
getActivityRef()
TimeInterval
getAffectedTimeInterval()
Returns the entire affected time interval of the change.Row<?,?,?>
getNewRow()
Returns the parent row of an activity after the user performed a change on it (e.Row<?,?,?>
getOldRow()
Returns the parent row of an activity before the user performed a change on it (e.Instant
getOldTime()
Returns the end / start time of an activity before the user performed a change on it.TimeInterval
getOldTimeInterval()
Returns the time interval of an activity before the user performed a change on it.double
getOldValue()
Returns the value of an activity before the user performed a change on it.boolean
isPotentialEndTimeChange()
Determines if the event represents a change of the activity's end time.boolean
isPotentialStartTimeChange()
Determines if the event represents a change of the activity's start time.boolean
isPotentialTimeIntervalChange()
Determines if the event represents a change of the activity's time interval (start and / or end time).String
toString()
Methods inherited from class javafx.scene.input.InputEvent
getEventType
Methods inherited from class javafx.event.Event
clone, consume, copyFor, fireEvent, getTarget, isConsumed
Methods inherited from class java.util.EventObject
getSource
-
Field Details
-
ACTIVITY_CHANGE
The parent event type of all other activity event types. Gets fired whenever anything changes.- Since:
- 1.0
-
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
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
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
An event type used when the user pressed the delete shortcut to delete an activity.- Since:
- 1.0
-
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
An event type used when the start time of an activity has finished changing.- Since:
- 1.0
-
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
An event type used when the user starts changing the end time of an activity.- Since:
- 1.0
-
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
An event type used when the end time of an activity is currently being changed.- Since:
- 1.0
-
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
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
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
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
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
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
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
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
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
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
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
An event type being used when the user has started changing the percentage complete value of aMutableCompletableActivity
.- Since:
- 1.0
-
PERCENTAGE_CHANGE_FINISHED
An event type being used when the user has finished changing the percentage complete value of aMutableCompletableActivity
.- Since:
- 1.0
-
PERCENTAGE_CHANGE_ONGOING
An event type being used when the user is in the process of changing the percentage complete value of aMutableCompletableActivity
.- Since:
- 1.0
-
CHART_VALUE_CHANGE_STARTED
An event type being used when the user has started changing the chart value of aMutableChartActivity
.- Since:
- 1.0
-
CHART_VALUE_CHANGE_FINISHED
An event type being used when the user has finished changing the chart value of aMutableChartActivity
.- Since:
- 1.0
-
CHART_VALUE_CHANGE_ONGOING
An event type being used when the user is in the process of changing the chart value of aMutableChartActivity
.- Since:
- 1.0
-
CHART_HIGH_VALUE_CHANGE_STARTED
An event type being used when the user has started changing the chart high value of aMutableHighLowChartActivity
.- Since:
- 1.0
-
CHART_HIGH_VALUE_CHANGE_FINISHED
An event type being used when the user has finished changing the chart high value of aMutableHighLowChartActivity
.- Since:
- 1.0
-
CHART_HIGH_VALUE_CHANGE_ONGOING
An event type being used when the user is in the process of changing the chart high value of aMutableHighLowChartActivity
.- Since:
- 1.0
-
CHART_LOW_VALUE_CHANGE_STARTED
An event type being used when the user has started changing the chart low value of aMutableHighLowChartActivity
.- Since:
- 1.0
-
CHART_LOW_VALUE_CHANGE_FINISHED
An event type being used when the user has finished changing the chart low value of aMutableHighLowChartActivity
.- Since:
- 1.0
-
CHART_LOW_VALUE_CHANGE_ONGOING
An event type being used when the user is in the process of changing the chart low value of aMutableHighLowChartActivity
.- Since:
- 1.0
-
-
Constructor Details
-
ActivityEvent
public ActivityEvent(ActivityRef<?> activity, EventTarget target, EventType<? extends ActivityEvent> eventType) -
ActivityEvent
public ActivityEvent(ActivityRef<?> activity, EventTarget target, EventType<? extends ActivityEvent> eventType, Instant oldTime) -
ActivityEvent
public ActivityEvent(ActivityRef<?> activity, EventTarget target, EventType<? extends ActivityEvent> eventType, TimeInterval oldInterval) -
ActivityEvent
public ActivityEvent(ActivityRef<?> activity, EventTarget target, EventType<? extends ActivityEvent> eventType, Row<?,?,?> oldRow, Row<?,?,?> newRow, TimeInterval oldTimeInterval) -
ActivityEvent
public ActivityEvent(ActivityRef<?> activity, EventTarget target, EventType<? extends ActivityEvent> eventType, double oldValue)
-
-
Method Details
-
getActivityRef
-
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
Returns the time interval of an activity before the user performed a change on it.- Returns:
- the original time interval
- Since:
- 1.0
-
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
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
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 typesEND_TIME_CHANGE_STARTED
,END_TIME_CHANGE_ONGOING
, andEND_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 typesSTART_TIME_CHANGE_STARTED
,START_TIME_CHANGE_ONGOING
, andSTART_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 typesHORIZONTAL_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
- Overrides:
toString
in classEventObject
-