Class EventManager
- java.lang.Object
-
- com.metsci.glimpse.core.plot.timeline.event.EventManager
-
public class EventManager extends Object
Helper class which maintains sorted Event data structures forEventPlotInfo
.- Author:
- ulman
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
EventManager.Row
-
Constructor Summary
Constructors Constructor Description EventManager(EventPlotInfo info)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addEvent(Event event)
void
calculateVisibleEvents(Axis1D axis)
Event
getEvent(Object id)
EventBounds
getEventBounds(Object id)
Set<Event>
getEvents()
int
getMaxAggregatedEventGapSize()
int
getMaxAggregatedGroupSize()
EventSelection
getNearestEvent(GlimpseMouseEvent e)
EventSelection
getNearestEvent(Set<EventSelection> events, GlimpseMouseEvent e)
Set<EventSelection>
getNearestEvents(GlimpseMouseEvent e)
EventBounds
getOrCreateEventBounds(Object id)
boolean
getReverseStackingDirection()
int
getRow(Object eventId)
int
getRowCount()
List<EventManager.Row>
getRows()
boolean
isAggregateNearbyEvents()
boolean
isStackOverlappingEvents()
void
lock()
void
moveEvent(Event event, TimeStamp newStartTime, TimeStamp newEndTime)
void
removeAllEvents()
Event
removeEvent(Object id)
void
setAggregateNearbyEvents(boolean aggregate)
If true, nearby events in the same row will be combined into one event to reduce visual clutter.EventBounds
setEventBounds(Object id, EventBounds bounds)
void
setMaxAggregatedEventGapSize(int size)
Sets the maximum pixel distance between adjacent events above which events will not be aggregated into a single Event (in order to reduce visual clutter).void
setMaxAggregatedGroupSize(int size)
Sets the maximum pixel size above which an Event will not be aggregated with nearby Events (in order to reduce visual clutter).void
setReverseStackingDirection(boolean reverse)
If true, events will start at the top (or right) edge and stack downward (or leftward) -- the reverse of default behavior.void
setRow(Object eventId, int rowIndex)
void
setStackOverlappingEvents(boolean stack)
If true, Events will be automatically placed into rows in order to avoid overlap.void
unlock()
void
validate()
-
-
-
Constructor Detail
-
EventManager
public EventManager(EventPlotInfo info)
-
-
Method Detail
-
lock
public void lock()
-
unlock
public void unlock()
-
getRows
public List<EventManager.Row> getRows()
-
isStackOverlappingEvents
public boolean isStackOverlappingEvents()
- See Also:
setStackOverlappingEvents(boolean)
-
setStackOverlappingEvents
public void setStackOverlappingEvents(boolean stack)
If true, Events will be automatically placed into rows in order to avoid overlap. Any row requested byEvent.setFixedRow(int)
will be ignored.
-
getReverseStackingDirection
public boolean getReverseStackingDirection()
- See Also:
setReverseStackingDirection(boolean)
-
setReverseStackingDirection
public void setReverseStackingDirection(boolean reverse)
If true, events will start at the top (or right) edge and stack downward (or leftward) -- the reverse of default behavior.
-
getMaxAggregatedGroupSize
public int getMaxAggregatedGroupSize()
- See Also:
setMaxAggregatedGroupSize(int)
-
setMaxAggregatedGroupSize
public void setMaxAggregatedGroupSize(int size)
Sets the maximum pixel size above which an Event will not be aggregated with nearby Events (in order to reduce visual clutter).- See Also:
setAggregateNearbyEvents(boolean)
-
getMaxAggregatedEventGapSize
public int getMaxAggregatedEventGapSize()
-
setMaxAggregatedEventGapSize
public void setMaxAggregatedEventGapSize(int size)
Sets the maximum pixel distance between adjacent events above which events will not be aggregated into a single Event (in order to reduce visual clutter).- Parameters:
size
-
-
isAggregateNearbyEvents
public boolean isAggregateNearbyEvents()
- See Also:
setAggregateNearbyEvents(boolean)
-
setAggregateNearbyEvents
public void setAggregateNearbyEvents(boolean aggregate)
If true, nearby events in the same row will be combined into one event to reduce visual clutter.
-
validate
public void validate()
-
getRowCount
public int getRowCount()
-
setRow
public void setRow(Object eventId, int rowIndex)
-
getRow
public int getRow(Object eventId)
-
addEvent
public void addEvent(Event event)
-
removeAllEvents
public void removeAllEvents()
-
getOrCreateEventBounds
public EventBounds getOrCreateEventBounds(Object id)
-
getEventBounds
public EventBounds getEventBounds(Object id)
-
setEventBounds
public EventBounds setEventBounds(Object id, EventBounds bounds)
-
getNearestEvents
public Set<EventSelection> getNearestEvents(GlimpseMouseEvent e)
-
getNearestEvent
public EventSelection getNearestEvent(Set<EventSelection> events, GlimpseMouseEvent e)
-
getNearestEvent
public EventSelection getNearestEvent(GlimpseMouseEvent e)
-
calculateVisibleEvents
public void calculateVisibleEvents(Axis1D axis)
-
-