public class TimelineModel<E,G> extends Object implements Serializable
Constructor and Description |
---|
TimelineModel() |
TimelineModel(List<TimelineEvent<E>> events) |
TimelineModel(List<TimelineEvent<E>> events,
List<TimelineGroup<G>> groups) |
Modifier and Type | Method and Description |
---|---|
void |
add(TimelineEvent<E> event)
Adds a given event to the model without UI update.
|
void |
add(TimelineEvent<E> event,
TimelineUpdater timelineUpdater)
Adds a given event to the model with UI update.
|
void |
addAll(Collection<TimelineEvent<E>> events)
Adds all given event to the model without UI update.
|
void |
addAll(Collection<TimelineEvent<E>> events,
TimelineUpdater timelineUpdater)
Adds all given events to the model with UI update.
|
void |
addAllGroups(Collection<TimelineGroup<G>> groups)
Adds all given groups to the model.
|
void |
addGroup(TimelineGroup<G> group)
Adds a given group to the model.
|
void |
clear()
Clears the timeline model without UI update (no events are available after that)
|
void |
clear(TimelineUpdater timelineUpdater)
Clears the timeline model with UI update (no events are available after that)
|
void |
delete(TimelineEvent<E> event)
Deletes a given event in the model without UI update.
|
void |
delete(TimelineEvent<E> event,
TimelineUpdater timelineUpdater)
Deletes a given event in the model with UI update.
|
void |
deleteAll(Collection<TimelineEvent<E>> events)
Deletes all given events in the model without UI update.
|
void |
deleteAll(Collection<TimelineEvent<E>> events,
TimelineUpdater timelineUpdater)
Deletes all given events in the model with UI update.
|
TimelineEvent<E> |
getEvent(int index)
Deprecated.
get event by id using
getEvent(java.lang.String) instead. |
TimelineEvent<E> |
getEvent(String id)
Gets event by its id property.
|
List<TimelineEvent<E>> |
getEvents()
Gets all events in this model
|
List<TimelineGroup<G>> |
getGroups()
Gets all groups in this model
|
int |
getIndex(TimelineEvent<E> event)
Deprecated.
The index property is no longer necessary with the addition of
TimelineEvent.getId() property.
This method could be changed to private in next releases.
See issue 5143 for more information. |
Set<TimelineEvent<E>> |
getOverlappedEvents(TimelineEvent<E> event)
Gets all overlapped events to the given one.
|
boolean |
hasEvent(TimelineEvent<E> event)
Check if current model has the event passed as parameter.
|
TimelineEvent<E> |
merge(TimelineEvent<E> event,
Collection<TimelineEvent<E>> events)
Merge the given one event with the given collection of events without UI update.
|
TimelineEvent<E> |
merge(TimelineEvent<E> event,
Collection<TimelineEvent<E>> events,
TimelineUpdater timelineUpdater)
Merge the given one event with the given collection of events with UI update.
|
void |
select(TimelineEvent<E> event,
TimelineUpdater timelineUpdater)
Selects a given event in UI visually.
|
void |
setEvents(List<TimelineEvent<E>> events)
Sets events into this model
|
void |
setGroups(List<TimelineGroup<G>> groups)
Sets groups into this model
|
void |
update(TimelineEvent<E> event)
Updates a given event in the model without UI update.
|
void |
update(TimelineEvent<E> event,
TimelineUpdater timelineUpdater)
Updates a given event in the model with UI update.
|
void |
updateAll(Collection<TimelineEvent<E>> events)
Updates all given events in the model without UI update.
|
void |
updateAll(Collection<TimelineEvent<E>> events,
TimelineUpdater timelineUpdater)
Updates all given events in the model with UI update.
|
public TimelineModel()
public TimelineModel(List<TimelineEvent<E>> events)
public TimelineModel(List<TimelineEvent<E>> events, List<TimelineGroup<G>> groups)
public void add(TimelineEvent<E> event)
event
- event to be addedpublic void addGroup(TimelineGroup<G> group)
group
- group to be addedpublic void add(TimelineEvent<E> event, TimelineUpdater timelineUpdater)
event
- event to be addedtimelineUpdater
- TimelineUpdater instance to add the event in UIpublic void addAll(Collection<TimelineEvent<E>> events)
events
- collection of events to be addedpublic void addAllGroups(Collection<TimelineGroup<G>> groups)
groups
- collection of groups to be addedpublic void addAll(Collection<TimelineEvent<E>> events, TimelineUpdater timelineUpdater)
events
- collection of events to be addedtimelineUpdater
- TimelineUpdater instance to add the events in UIpublic void update(TimelineEvent<E> event)
event
- event to be updatedpublic void update(TimelineEvent<E> event, TimelineUpdater timelineUpdater)
event
- event to be addedtimelineUpdater
- TimelineUpdater instance to update the event in UIpublic void updateAll(Collection<TimelineEvent<E>> events)
events
- collection of events to be updatedpublic void updateAll(Collection<TimelineEvent<E>> events, TimelineUpdater timelineUpdater)
events
- collection of events to be updatedtimelineUpdater
- TimelineUpdater instance to update the events in UIpublic void delete(TimelineEvent<E> event)
event
- event to be deletedpublic void delete(TimelineEvent<E> event, TimelineUpdater timelineUpdater)
event
- event to be deletedtimelineUpdater
- TimelineUpdater instance to delete the event in UIpublic void deleteAll(Collection<TimelineEvent<E>> events)
events
- collection of events to be deletedpublic void deleteAll(Collection<TimelineEvent<E>> events, TimelineUpdater timelineUpdater)
events
- collection of events to be deletedtimelineUpdater
- TimelineUpdater instance to delete the events in UIpublic void select(TimelineEvent<E> event, TimelineUpdater timelineUpdater)
event
- event to be selectedtimelineUpdater
- TimelineUpdater instance to select the event in UIpublic void clear()
public void clear(TimelineUpdater timelineUpdater)
timelineUpdater
- TimelineUpdater instance to clear the timeline in UIpublic Set<TimelineEvent<E>> getOverlappedEvents(TimelineEvent<E> event)
event
- given eventpublic TimelineEvent<E> merge(TimelineEvent<E> event, Collection<TimelineEvent<E>> events)
event
- given event to be merged with collection of eventsevents
- collection of eventsIllegalStateException
- thrown if not all events are within the same grouppublic TimelineEvent<E> merge(TimelineEvent<E> event, Collection<TimelineEvent<E>> events, TimelineUpdater timelineUpdater)
event
- given event to be merged with collection of eventsevents
- collection of eventstimelineUpdater
- TimelineUpdater instance to update the merged events in UIIllegalStateException
- thrown if not all events are within the same grouppublic List<TimelineEvent<E>> getEvents()
public void setEvents(List<TimelineEvent<E>> events)
events
- List<TimelineEvent<E>> list of eventspublic List<TimelineGroup<G>> getGroups()
public void setGroups(List<TimelineGroup<G>> groups)
groups
- List<TimelineGroup<G>> list of groupspublic TimelineEvent<E> getEvent(String id)
id
- id property of the eventpublic boolean hasEvent(TimelineEvent<E> event)
event
- @Deprecated public TimelineEvent<E> getEvent(int index)
getEvent(java.lang.String)
instead.index
- index@Deprecated public int getIndex(TimelineEvent<E> event)
TimelineEvent.getId()
property.
This method could be changed to private in next releases.
See issue 5143 for more information.event
- given eventCopyright © 2020. All rights reserved.