|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectsk.baka.webvm.misc.DivGraph
public final class DivGraph
Draws stacked bars.
| Field Summary | |
|---|---|
static int |
MEMSTAT_BAR_HEIGHT
The height of a memory status bar. |
| Method Summary | |
|---|---|
static String |
drawMemoryStatus(MemoryUsage usage,
int width)
Converts a memory usage to a horizontal bar graph. |
static String |
drawStackedBar(GraphStyle style,
int[] values,
int max,
boolean floatLeft)
Draws a stacked bar graph. |
static void |
drawStackedBar(GraphStyle style,
int[] values,
int max,
boolean floatLeft,
StringBuilder sb)
Draws a stacked bar graph. |
(package private) static int[] |
toPixels(int[] values,
int max,
int maxPixels)
Converts given value array into pixel dimensions for each value. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int MEMSTAT_BAR_HEIGHT
| Method Detail |
|---|
public static String drawStackedBar(GraphStyle style,
int[] values,
int max,
boolean floatLeft)
style - the graph style, must be valid.values - the values to draw. The array must be sorted from least to highest. Negative values are not permitted.max - the maximum value. A transparent div will be added at the end if necessary.floatLeft - if true then a float:left style is added to ensure that next HTML content is positioned to the right of this bar.
public static void drawStackedBar(GraphStyle style,
int[] values,
int max,
boolean floatLeft,
StringBuilder sb)
style - the graph style, must be valid.values - the values to draw. The array must be sorted from least to highest. Negative values are not permitted.max - the maximum value. A transparent div will be added at the end if necessary.floatLeft - if true then a float:left style is added to ensure that next HTML content is positioned to the right of this bar.sb - puts the HTML code here.
static int[] toPixels(int[] values,
int max,
int maxPixels)
values - the values to convert. The array must be sorted from least to highest. Negative values are not permitted.max - the maximum value to draw.maxPixels - the desired pixel dimension.
IllegalArgumentException - if the values is empty, max is not a positive number or maxPixels is not a positive number
NullPointerException - if the values array is null
public static String drawMemoryStatus(MemoryUsage usage,
int width)
usage - the memory usage. Should be converted to megabytes as longs will be converted to integers.width - width of result in pixels.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||