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 ofActivityRepository
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
All Methods Instance Methods Concrete Methods 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
-
-
-
-
Method Detail
-
addEventHandler
public void addEventHandler(EventHandler<RepositoryEvent> l)
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
public void removeEventHandler(EventHandler<RepositoryEvent> l)
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
public Instant 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
public Instant 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
public EventDispatchChain buildEventDispatchChain(EventDispatchChain tail)
- Specified by:
buildEventDispatchChain
in interfaceEventTarget
-
fireEvent
protected void fireEvent(RepositoryEvent evt)
-
-