public class DefaultEventPainter extends Object implements EventPainter
Paints the default visualization for provided Event
objects. Paints
a box with configurable border and background color and an optional icon
and text description.
The appearance of a single Event can be customized via
Event#setEventPainter(EventPainter)
and the default appearance of all
Events can be customized via EventPlotInfo#setEventPainter(EventPainter)
.
Modifier and Type | Field and Description |
---|---|
static int |
ARROW_SIZE |
static int |
ARROW_TIP_BUFFER |
static float[] |
DEFAULT_COLOR |
static Object |
DEFAULT_ICON |
static Color |
DEFAULT_ICON_COLOR |
static int |
DEFAULT_ICON_SIZE |
static int |
DEFAULT_NUM_ICONS_ROWS |
Constructor and Description |
---|
DefaultEventPainter() |
Modifier and Type | Method and Description |
---|---|
Object |
getDefaultIconId() |
int |
getMaxIconRows() |
void |
paint(javax.media.opengl.GL2 gl,
Event event,
Event nextEvent,
EventPlotInfo info,
GlimpseBounds bounds,
int posMin,
int posMax)
Renders the provided Event (potentially displaying its icon, label, time extents, etc...).
|
void |
setDefaultIconId(Object id)
Sets the default icon which is used when no icon is set for an aggregate event.
|
void |
setMaxIconRows(int rows)
Sets the maximum number of rows used to display icons in aggregate groups.
|
public static final Object DEFAULT_ICON
public static final int DEFAULT_ICON_SIZE
public static final Color DEFAULT_ICON_COLOR
public static final int DEFAULT_NUM_ICONS_ROWS
public static final int ARROW_TIP_BUFFER
public static final int ARROW_SIZE
public static final float[] DEFAULT_COLOR
public void setDefaultIconId(Object id)
id
- public Object getDefaultIconId()
public void setMaxIconRows(int rows)
rows
- public int getMaxIconRows()
public void paint(javax.media.opengl.GL2 gl, Event event, Event nextEvent, EventPlotInfo info, GlimpseBounds bounds, int posMin, int posMax)
EventPainter
Renders the provided Event (potentially displaying its icon, label, time extents, etc...).
Both the Event to be painted and the next Event in the row (the event with the next largest start time) are provided. Only event should be rendered by this call. The nextEvent argument is provided only as context to allow the EventPainter to modify its rendering to ensure that it does not overlap with nextEvent.
paint
in interface EventPainter
gl
- OpenGL handlenextEvent
- the next Event to be painted (as ordered by start time)info
- parent EventPlotInfo of Event to be paintedbounds
- width, height, and position of GlimpseLayout containing EventPlotInfoposMin
- the min y (or x, depending on orientation) in pixel coordinates of the EventposMax
- the max y (or x, depending on orientation) in pixel coordinates of the EventCopyright © 2013 Metron, Inc.. All rights reserved.