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 Details

    • ActivityRepositoryBase

      protected ActivityRepositoryBase()
      Constructs a new repository.
      Since:
      1.0
  • Method Details

    • 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 interface ActivityRepository<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 interface ActivityRepository<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 interface ActivityRepository<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 interface ActivityRepository<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 interface EventTarget
    • fireEvent

      protected void fireEvent​(RepositoryEvent evt)