Module com.flexganttfx.model
Package com.flexganttfx.model.repository
Class ActivityRepositoryBase<A extends Activity>
java.lang.Object
com.flexganttfx.model.repository.ActivityRepositoryBase<A>
- Type Parameters:
A
- the type of the activities stored in this repository
- All Implemented Interfaces:
ActivityRepository<A>
,EventTarget
- Direct Known Subclasses:
CalendarBase
,MutableActivityRepositoryBase
public abstract class ActivityRepositoryBase<A extends Activity> extends Object implements ActivityRepository<A>
An abstract base implementation of
ActivityRepository
that provides support
for event handlers (adding, removing, firing events).- Since:
- 1.0
-
Constructor Summary
Constructors Modifier Constructor Description protected
ActivityRepositoryBase()
Constructs a new repository. -
Method Summary
Modifier and Type Method Description void
addEventHandler(EventHandler<RepositoryEvent> l)
Adds an event handler for receiving repository events.EventDispatchChain
buildEventDispatchChain(EventDispatchChain tail)
protected void
fireEvent(RepositoryEvent evt)
Instant
getEarliestTimeUsed()
Returns the earliest time used by the activities stored in this repository / on this row.Instant
getLatestTimeUsed()
Returns the latest time used by the activities stored in this repository / on this row.void
removeEventHandler(EventHandler<RepositoryEvent> l)
Removes the given event handler from the repository.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.flexganttfx.model.ActivityRepository
getActivities
-
Constructor Details
-
ActivityRepositoryBase
protected ActivityRepositoryBase()Constructs a new repository.- Since:
- 1.0
-
-
Method Details
-
addEventHandler
Description copied from interface:ActivityRepository
Adds an event handler for receiving repository events. A repository will fire events if its state changes (e.g. activities added / removed).- Specified by:
addEventHandler
in interfaceActivityRepository<A extends Activity>
- Parameters:
l
- the event handler that will be added to the repository
-
removeEventHandler
Description copied from interface:ActivityRepository
Removes the given event handler from the repository.- Specified by:
removeEventHandler
in interfaceActivityRepository<A extends Activity>
- Parameters:
l
- the event handler that will be removed from the repository
-
getEarliestTimeUsed
Description copied from interface:ActivityRepository
Returns the earliest time used by the activities stored in this repository / on this row. This method gets used for navigation (e.g. "scroll to earliest time used in the Gantt chart", "zoom out to show all activities").- Specified by:
getEarliestTimeUsed
in interfaceActivityRepository<A extends Activity>
- Returns:
- the earliest time used by the activities in this repository / row (null if no activities found)
-
getLatestTimeUsed
Description copied from interface:ActivityRepository
Returns the latest time used by the activities stored in this repository / on this row. This method gets used for navigation (e.g. "scroll to latest time used in the Gantt chart", "zoom out to show all activities").- Specified by:
getLatestTimeUsed
in interfaceActivityRepository<A extends Activity>
- Returns:
- the latest time used by the activities in this repository / row (null if no activities found)
-
buildEventDispatchChain
- Specified by:
buildEventDispatchChain
in interfaceEventTarget
-
fireEvent
-