org.ow2.jonas.webapp.jonasadmin.monitoring.graph.utils
Class GraphUtils
java.lang.Object
org.ow2.jonas.webapp.jonasadmin.monitoring.graph.utils.GraphUtils
public class GraphUtils
- extends Object
Method Summary |
static int |
cartesianXToGraphicsX(int x)
|
static int |
cartesianYToGraphicsY(int y,
int factor)
|
static void |
drawCurrentUsedPerTotal(Graphics g,
Long currentUsed,
Long total,
int xLength,
String usedLabel,
String unit,
boolean compareWithTotal,
int graphRank)
Draw a box on right of monitoring graph to show current used value
compared to total value |
static void |
drawGraph(Graphics g,
long k,
int xLength,
int width,
int pow,
int n,
int index,
Long[] data,
Long maxExpectedValue,
String graphTitle,
String meausreUnit,
int graphRank)
Draw main monitoring Graph |
static int |
getHeight()
|
static int |
getWidth(int length)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEF_SIZE_TABLE_MEASURES
public static final int DEF_SIZE_TABLE_MEASURES
- See Also:
- Constant Field Values
DEF_RANGE
public static final int DEF_RANGE
- See Also:
- Constant Field Values
DEF_NUM_MESURE
public static final int DEF_NUM_MESURE
- See Also:
- Constant Field Values
HEIGHT
public static final int HEIGHT
- See Also:
- Constant Field Values
TOP_MARGIN
public static final int TOP_MARGIN
- See Also:
- Constant Field Values
RIGHT_MARGIN
public static final int RIGHT_MARGIN
- See Also:
- Constant Field Values
BOTTOM_MARGIN
public static final int BOTTOM_MARGIN
- See Also:
- Constant Field Values
LEFT_MARGIN
public static final int LEFT_MARGIN
- See Also:
- Constant Field Values
HORIZONTAL_SPACE
public static final int HORIZONTAL_SPACE
- See Also:
- Constant Field Values
Y_LENGTH
public static final int Y_LENGTH
- See Also:
- Constant Field Values
GAUGE_WIDTH
public static final int GAUGE_WIDTH
- See Also:
- Constant Field Values
BG_COLOR
public static final Color BG_COLOR
FG_COLOR
public static final Color FG_COLOR
GRAPHICS_BG_COLOR
public static final Color GRAPHICS_BG_COLOR
GAUGE_FG_COLOR
public static final Color GAUGE_FG_COLOR
GRAPHICS_FG_COLOR
public static final Color GRAPHICS_FG_COLOR
AXIS_COLOR
public static final Color AXIS_COLOR
TEXT_COLOR
public static final Color TEXT_COLOR
HORIZONTAL_LINE_COLOR
public static final Color HORIZONTAL_LINE_COLOR
DEF_SPACE_BETWEEN_LINES
public static final int DEF_SPACE_BETWEEN_LINES
- See Also:
- Constant Field Values
GAUGE_TEXT_MAX_LENGTH
public static final int GAUGE_TEXT_MAX_LENGTH
- See Also:
- Constant Field Values
GRAPHIC_SEPARATOR
public static final int GRAPHIC_SEPARATOR
- See Also:
- Constant Field Values
GraphUtils
public GraphUtils()
getWidth
public static int getWidth(int length)
- Parameters:
length
- the data array size (data.length)
- Returns:
- the picture width when displaying an array of the specified size
getHeight
public static int getHeight()
- Returns:
- the picture height
cartesianXToGraphicsX
public static int cartesianXToGraphicsX(int x)
cartesianYToGraphicsY
public static int cartesianYToGraphicsY(int y,
int factor)
- Parameters:
y
- the value to convert into cartesianfactor
- represents the graph rank on the image stream
- Returns:
- cartesian value of first parameter.
drawGraph
public static void drawGraph(Graphics g,
long k,
int xLength,
int width,
int pow,
int n,
int index,
Long[] data,
Long maxExpectedValue,
String graphTitle,
String meausreUnit,
int graphRank)
- Draw main monitoring Graph
- Parameters:
g
- the graphic (contained in the servlet image)k
- used whenxLength
- 2*monitored data numberwidth
- Graph width, depends on xLengthpow
- = 10^nn
- data
- datas to drawmaxExpectedValue
- over this value, current measured value is considered critical
drawCurrentUsedPerTotal
public static void drawCurrentUsedPerTotal(Graphics g,
Long currentUsed,
Long total,
int xLength,
String usedLabel,
String unit,
boolean compareWithTotal,
int graphRank)
- Draw a box on right of monitoring graph to show current used value
compared to total value
- Parameters:
g
- The main graphic. The drawn box will be added in this graphiccurrentUsed
- current used value of a given measuretotal
- total used value of a measurexLength
- width of the boxusedLabel
- label to display for currentUsed valueunit
- measure unit (e.g MB for memory measure)compareWithTotal
- if true then the graph will display comparison betxeen current and total value
Copyright © 2010 OW2 Consortium. All Rights Reserved.