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 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 |
---|---|
static String |
calculateDisplayText(com.jogamp.opengl.util.awt.TextRenderer textRenderer,
String fullText,
double availableSpace) |
static float[] |
getBackgroundColor(Event event,
EventPlotInfo info,
boolean isSelected) |
static float[] |
getBorderColor(Event event,
EventPlotInfo info,
boolean isSelected) |
static float |
getBorderThickness(Event event,
EventPlotInfo info,
boolean isSelected) |
static int |
getIconSizePerpPixels(Event event,
EventPlotInfo info,
int sizePerpPixels) |
int |
getMaxIconRows() |
static double |
getTextAvailableSpace(int size,
int buffer,
double remainingSpaceX,
int pixelX,
int nextStartPixel,
Event.OverlapRenderingMode mode) |
static boolean |
isIconOverlapping(int size,
int buffer,
double remainingSpaceX,
int pixelX,
int nextStartPixel,
Event.OverlapRenderingMode mode) |
static boolean |
isTextIntersecting(int size,
int buffer,
double remainingSpaceX,
int pixelX,
int nextStartPixel,
Rectangle2D bounds,
Event.OverlapRenderingMode mode) |
static boolean |
isTextOverfull(int size,
int buffer,
double remainingSpaceX,
int pixelX,
int nextStartPixel,
Rectangle2D bounds,
Event.OverlapRenderingMode mode) |
void |
paint(javax.media.opengl.GL2 gl,
Event event,
Event nextEvent,
EventPlotInfo info,
GlimpseBounds bounds,
Axis1D timeAxis,
int posMin,
int posMax)
Renders the provided Event (potentially displaying its icon, label, time extents, etc...).
|
void |
setMaxIconRows(int rows)
Sets the maximum number of rows used to display icons in aggregate groups.
|
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 setMaxIconRows(int rows)
rows
- public int getMaxIconRows()
public void paint(javax.media.opengl.GL2 gl, Event event, Event nextEvent, EventPlotInfo info, GlimpseBounds bounds, Axis1D timeAxis, 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 EventPlotInfotimeAxis
- the plot time axisposMin
- 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 Eventpublic static int getIconSizePerpPixels(Event event, EventPlotInfo info, int sizePerpPixels)
public static boolean isTextOverfull(int size, int buffer, double remainingSpaceX, int pixelX, int nextStartPixel, Rectangle2D bounds, Event.OverlapRenderingMode mode)
public static boolean isTextIntersecting(int size, int buffer, double remainingSpaceX, int pixelX, int nextStartPixel, Rectangle2D bounds, Event.OverlapRenderingMode mode)
public static boolean isIconOverlapping(int size, int buffer, double remainingSpaceX, int pixelX, int nextStartPixel, Event.OverlapRenderingMode mode)
public static double getTextAvailableSpace(int size, int buffer, double remainingSpaceX, int pixelX, int nextStartPixel, Event.OverlapRenderingMode mode)
public static String calculateDisplayText(com.jogamp.opengl.util.awt.TextRenderer textRenderer, String fullText, double availableSpace)
public static float[] getBackgroundColor(Event event, EventPlotInfo info, boolean isSelected)
public static float[] getBorderColor(Event event, EventPlotInfo info, boolean isSelected)
public static float getBorderThickness(Event event, EventPlotInfo info, boolean isSelected)
Copyright © 2016 Metron, Inc.. All rights reserved.