Class AggregateEvent
- java.lang.Object
-
- com.metsci.glimpse.core.plot.timeline.event.Event
-
- com.metsci.glimpse.core.plot.timeline.event.AggregateEvent
-
public class AggregateEvent extends Event
When aStackedTimePlot2D
is zoomed out very far, Events can be squashed very close together in pixel space, making them hard to see.EventPlotInfo
can alleviate this problem by automatically creating combined Events which represent aggregations of many user created Events.- Author:
- ulman
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.metsci.glimpse.core.plot.timeline.event.Event
Event.OverlapRenderingMode, Event.TextRenderingMode
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
int
getEventCount()
Gets the number of aggregated events that make up this event.int
hashCode()
Iterator<Event>
iterator()
EventPlotInfo can automatically create synthetic groups of Events when the timeline is zoomed out far enough that a bunch of Events are crowded into the same space.void
setEditable(boolean isEditable)
Sets whether or not the Event start and end times are modifiable by the user via mouse interaction.void
setEndTime(TimeStamp endTime)
void
setEndTimeMoveable(boolean isEndTimeMoveable)
If true, the endTime of the Event cannot be adjusted by user mouse gestures.void
setFixedRow(int rowIndex)
This event will appear on the requested row index in the timeline regardless of whether that causes it to overlap with other Events.void
setFloatingRow()
The row this Event appears on will be managed by itsEventPlotInfo
parent.void
setMaxTimeSpan(double maxTimeSpan)
Sets the maximum time span between the start and end times.void
setMinTimeSpan(double minTimeSpan)
Sets the minimum (inclusive) span between the start and end times.void
setResizeable(boolean isResizeable)
If true, the time span of the Event (the amount of time between the start and end times) cannot be adjusted by user mouse gestures.void
setStartTime(TimeStamp startTime)
void
setStartTimeMoveable(boolean isStartTimeMoveable)
If true, the startTime of the Event cannot be adjusted by user mouse gestures.void
setTimes(TimeStamp startTime, TimeStamp endTime)
void
setTimes(TimeStamp startTime, TimeStamp endTime, boolean force)
Sets the start and end time for this Event.-
Methods inherited from class com.metsci.glimpse.core.plot.timeline.event.Event
addConstraint, contains, createDummyEvent, createDummyEvent, getBackgroundColor, getBorderColor, getBorderThickness, getDuration, getEndTime, getEndTimeComparator, getEventPainter, getEventPlotInfo, getIconId, getIconSize, getId, getLabel, getLabelColor, getMaxTimeSpan, getMinTimeSpan, getOverlapRenderingMode, getOverlapTime, getRow, getStartTime, getStartTimeComparator, getTextRenderingMode, getTimeSpan, getToolTipText, hasChildren, isEditable, isEndTimeMoveable, isFixedRow, isResizeable, isSelectable, isShowBackground, isShowBorder, isShowIcon, isShowLabel, isStartTimeMoveable, isUseDefaultBorderThickness, isUseDefaultIconSize, paint, removeConstraint, setBackgroundColor, setBorderColor, setBorderThickness, setEventPainter, setIconId, setIconSize, setLabel, setLabelColor, setOverlapMode, setSelectable, setShowBackground, setShowBorder, setShowIcon, setShowLabel, setTextRenderingMode, setTimes, setToolTipText, setUseDefaultBorderThickness, setUseDefaultIconSize, toString
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Method Detail
-
iterator
public Iterator<Event> iterator()
EventPlotInfo can automatically create synthetic groups of Events when the timeline is zoomed out far enough that a bunch of Events are crowded into the same space. The individual constituent Events can be accessed via this method. User created Events never have children.
-
getEventCount
public int getEventCount()
Description copied from class:Event
Gets the number of aggregated events that make up this event.- Overrides:
getEventCount
in classEvent
- See Also:
iterator()
-
setEditable
public void setEditable(boolean isEditable)
Description copied from class:Event
Sets whether or not the Event start and end times are modifiable by the user via mouse interaction. This does not prevent programmatically changing the mouse bounds. For finer control over what the user is allowed to do when modifying the start and end time of an Event (without disallowing it completely) seeEvent.setStartTimeMoveable(boolean)
,Event.setResizeable(boolean)
, andEvent.setMinTimeSpan(double)
.- Overrides:
setEditable
in classEvent
-
setEndTimeMoveable
public void setEndTimeMoveable(boolean isEndTimeMoveable)
Description copied from class:Event
If true, the endTime of the Event cannot be adjusted by user mouse gestures.- Overrides:
setEndTimeMoveable
in classEvent
-
setStartTimeMoveable
public void setStartTimeMoveable(boolean isStartTimeMoveable)
Description copied from class:Event
If true, the startTime of the Event cannot be adjusted by user mouse gestures.- Overrides:
setStartTimeMoveable
in classEvent
-
setResizeable
public void setResizeable(boolean isResizeable)
Description copied from class:Event
If true, the time span of the Event (the amount of time between the start and end times) cannot be adjusted by user mouse gestures. However, the Event may still be dragged.- Overrides:
setResizeable
in classEvent
-
setMaxTimeSpan
public void setMaxTimeSpan(double maxTimeSpan)
Description copied from class:Event
Sets the maximum time span between the start and end times. By default the maximum is Double.MAX_VALUE.- Overrides:
setMaxTimeSpan
in classEvent
-
setMinTimeSpan
public void setMinTimeSpan(double minTimeSpan)
Description copied from class:Event
Sets the minimum (inclusive) span between the start and end times. By default the minimum is 0.- Overrides:
setMinTimeSpan
in classEvent
-
setTimes
public void setTimes(TimeStamp startTime, TimeStamp endTime, boolean force)
Description copied from class:Event
Sets the start and end time for this Event.
If force is false, then the constraints (see
Event.addConstraint(EventConstraint)
) are taken into account and the final Event bounds might not be equal to the input arguments.
-
setFloatingRow
public void setFloatingRow()
Description copied from class:Event
The row this Event appears on will be managed by itsEventPlotInfo
parent. IfEventPlotInfo.setStackOverlappingEvents(boolean)
is set to true, then the row will be set to avoid overlaps with other events, otherwise the Event will be placed in the first row.- Overrides:
setFloatingRow
in classEvent
-
setFixedRow
public void setFixedRow(int rowIndex)
Description copied from class:Event
This event will appear on the requested row index in the timeline regardless of whether that causes it to overlap with other Events.- Overrides:
setFixedRow
in classEvent
-
setTimes
public void setTimes(TimeStamp startTime, TimeStamp endTime)
Description copied from class:Event
-
setStartTime
public void setStartTime(TimeStamp startTime)
- Overrides:
setStartTime
in classEvent
- See Also:
Event.setTimes(TimeStamp, TimeStamp, boolean)
-
setEndTime
public void setEndTime(TimeStamp endTime)
- Overrides:
setEndTime
in classEvent
- See Also:
Event.setTimes(TimeStamp, TimeStamp, boolean)
-
-