|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.boylesoftware.cb2.util.StatsGraph
Works with EventHistory
objects and generates nice
images with event statistics.
Nested Class Summary | |
protected static class |
StatsGraph.ScaleDescriptor
Descriptor of a horizontal scale. |
Field Summary | |
static java.lang.String |
DATA_BG_COLOR
|
static java.lang.String |
DATA_BORDER_COLOR
|
static java.lang.String |
DATA_COLOR
|
static java.lang.String |
DATA_STROKE
|
static java.lang.String |
GRID_COLOR
|
static java.lang.String |
GRID_STROKE
|
static java.lang.String |
LEVEL_AVG_COLOR
|
static java.lang.String |
LEVEL_AVG_STROKE
|
static java.lang.String |
LEVEL_MAX_COLOR
|
static java.lang.String |
LEVEL_MAX_STROKE
|
static java.lang.String |
LEVEL_MIN_COLOR
|
static java.lang.String |
LEVEL_MIN_STROKE
|
static java.lang.String |
MAIN_BG_COLOR
|
protected static int |
MAIN_MARGIN_BOTTOM
Width of the field at the bottom of the "data" area. |
protected static int |
MAIN_MARGIN_LEFT
Width of the field to the left of the "data" area. |
protected static int |
MAIN_MARGIN_RIGHT
Width of the field to the right of the "data" area. |
protected static int |
MAIN_MARGIN_TOP
Width of the field at the top of the "data" area. |
protected static int |
MIN_STEPX
Minimum allowed distance in pixels between two vertical net-lines. |
static java.lang.String |
SCALE_LABEL_COLOR
|
static java.lang.String |
SCALE_LABEL_FONT
|
protected static StatsGraph.ScaleDescriptor[] |
SCALES
Scales. |
Constructor Summary | |
StatsGraph()
|
Method Summary | |
static java.awt.image.BufferedImage |
generateImage(EventHistory eventHistory,
int width,
int height)
Calls generateImage with default decoration. |
static java.awt.image.BufferedImage |
generateImage(EventHistory eventHistory,
int width,
int height,
java.util.Map decor)
Generates a graph image from the samples in the specified EventHistory object. |
static java.awt.image.BufferedImage |
generateTinyImage(EventHistory eventHistory,
int width,
int height,
long maxSample)
Calls generateTinyImage with default decoration. |
static java.awt.image.BufferedImage |
generateTinyImage(EventHistory eventHistory,
int width,
int height,
long maxSample,
java.util.Map decor)
Analogue of the generateImage method, but the output
image contains only the samples data and no scales, fields and
other decorations. |
protected static java.lang.Object |
getDecorElement(java.lang.String name,
java.util.Map elements)
Returns the named decoration element. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static final int MAIN_MARGIN_LEFT
protected static final int MAIN_MARGIN_RIGHT
protected static final int MAIN_MARGIN_TOP
protected static final int MAIN_MARGIN_BOTTOM
protected static final int MIN_STEPX
public static final java.lang.String MAIN_BG_COLOR
public static final java.lang.String DATA_BG_COLOR
public static final java.lang.String DATA_BORDER_COLOR
public static final java.lang.String DATA_STROKE
public static final java.lang.String DATA_COLOR
public static final java.lang.String GRID_STROKE
public static final java.lang.String GRID_COLOR
public static final java.lang.String SCALE_LABEL_FONT
public static final java.lang.String SCALE_LABEL_COLOR
public static final java.lang.String LEVEL_MAX_COLOR
public static final java.lang.String LEVEL_MAX_STROKE
public static final java.lang.String LEVEL_MIN_COLOR
public static final java.lang.String LEVEL_MIN_STROKE
public static final java.lang.String LEVEL_AVG_COLOR
public static final java.lang.String LEVEL_AVG_STROKE
protected static final StatsGraph.ScaleDescriptor[] SCALES
Constructor Detail |
public StatsGraph()
Method Detail |
public static java.awt.image.BufferedImage generateImage(EventHistory eventHistory, int width, int height)
generateImage
with default decoration.
public static java.awt.image.BufferedImage generateImage(EventHistory eventHistory, int width, int height, java.util.Map decor)
EventHistory
object.
eventHistory
- the samples data.width
- width in pixels of the data field of the generated image.
The overall width of the generated image will be greater, because
we add special fields around the graph itself with various information.height
- height in pixels of the data field of the generated image.
The overall height of the generated image will be greater, because
we add special fields around the graph itself with various information.decor
- collection of decoration elements that override the
default ones. Keys in the map are names of the elements and values
are decoration elements.
public static java.awt.image.BufferedImage generateTinyImage(EventHistory eventHistory, int width, int height, long maxSample)
generateTinyImage
with default decoration.
public static java.awt.image.BufferedImage generateTinyImage(EventHistory eventHistory, int width, int height, long maxSample, java.util.Map decor)
generateImage
method, but the output
image contains only the samples data and no scales, fields and
other decorations.
eventHistory
- the samples data.width
- the output image width.height
- the output image height.maxSample
- assumed value of maximum sample. If this parameter
is less than zero the "real" maximum is taken from the event history
data.decor
- collection of decoration elements that override the
default ones. Keys in the map are names of the elements and values
are decoration elements.
protected static final java.lang.Object getDecorElement(java.lang.String name, java.util.Map elements)
name
- name of the element requested.elements
- collection of elements, may be null
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |