Rio Project 4.2 API Documentation



org.rioproject.watch
Class DefaultCalculableView

java.lang.Object
  extended by org.rioproject.watch.DefaultCalculableView
All Implemented Interfaces:
CalculableViewable
Direct Known Subclasses:
CalculableCPUView, CalculableDiskSpaceView, CalculableMemoryPoolView, CalculableMemoryView, CalculableSystemMemoryView, CounterCalculableView, ResponseTimeCalculableView, ThresholdCalculableView

public class DefaultCalculableView
extends Object
implements CalculableViewable

Default attributes for viewing a collection of Calculables


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.rioproject.watch.CalculableViewable
CalculableViewable.PlottedCalculable
 
Field Summary
protected  Accumulator accum
           
protected static Color avgColor
           
protected static int BOTTOM_AXIS_MARGIN
           
protected static int BOTTOM_GRAPH_MARGIN
           
protected  double bottomLineValue
           
protected  CalculableDisplayAttributes calcDisplayAttrs
           
protected  int currentSize
           
protected  Calculable[] data
           
protected static CalculableDisplayAttributes defaultDisplayAttributes
           
static Font defaultFont
           
static DecimalFormat defaultFormater
           
protected static Color devColor
           
protected  double drawHeight
           
protected  double drawWidth
           
protected  double highThreshold
           
protected static int HORIZONTAL__MIN_GRID_WIDTH
           
protected static int LEFT_AXIS_MARGIN
           
protected static int LEFT_GRAPH_MARGIN
           
protected  double lowThreshold
           
protected  double max
           
protected  double maxY
           
protected  double mean
           
protected  double min
           
protected  double minY
           
protected  double nbrHGrids
           
protected  double rangeSize
           
protected static int RIGHT_AXIS_MARGIN
           
protected static int RIGHT_GRAPH_MARGIN
           
protected  double startValue
           
protected  double stdDev
           
protected  double stopValue
           
protected  String title
           
protected  Font titleFont
           
protected static int TOP_AXIS_MARGIN
           
protected static int TOP_GRAPH_MARGIN
           
protected  double topLineValue
           
protected static int TOTAL_H_GRAPH_MARGIN
           
protected static int TOTAL_V_GRAPH_MARGIN
           
protected  double valuesRange
           
protected static int VERTICAL__MIN_GRID_HEIGHT
           
protected static int VERTICAL_GRAPH_OFFSET
           
protected  double vStep
           
protected  double vStepMultiplier
           
protected  WatchDataSource watchDataSource
           
protected  NumberFormat xFormat
           
protected  String xLegend
           
protected  Font xLegendFont
           
protected  double xScale
           
protected  NumberFormat yFormat
           
protected  String yLegend
           
protected  Font yLegendFont
           
protected  double yScale
           
 
Constructor Summary
DefaultCalculableView()
          Creates new DefaultCalculableView
DefaultCalculableView(CalculableDisplayAttributes calcDisplayAttrs)
          Creates new DefaultCalculableView
 
Method Summary
protected  double getBottomLineValue()
           
 CalculableViewable.PlottedCalculable getCalcForPoint(Point point)
          Get the Calculable value for a corresponding point
protected  int getLength()
           
protected  double getTopLineValue()
           
protected  void initValues()
          Initialize the graph values from the WatchDataSource
 void paint(Graphics g, Dimension size)
          Paints the view to the graphics context
protected  void resetValues()
          Reset the graph values to default values
 void setCalculableDisplayAttributes(CalculableDisplayAttributes calcDisplayAttrs)
          Sets the Calculable Display Attributes used to format the graph
 void setWatchDataSource(WatchDataSource watchDataSource)
          Sets the watch data source for this view
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TOP_AXIS_MARGIN

protected static final int TOP_AXIS_MARGIN
See Also:
Constant Field Values

BOTTOM_AXIS_MARGIN

protected static final int BOTTOM_AXIS_MARGIN
See Also:
Constant Field Values

LEFT_AXIS_MARGIN

protected static final int LEFT_AXIS_MARGIN
See Also:
Constant Field Values

RIGHT_AXIS_MARGIN

protected static final int RIGHT_AXIS_MARGIN
See Also:
Constant Field Values

TOP_GRAPH_MARGIN

protected static final int TOP_GRAPH_MARGIN
See Also:
Constant Field Values

BOTTOM_GRAPH_MARGIN

protected static final int BOTTOM_GRAPH_MARGIN
See Also:
Constant Field Values

LEFT_GRAPH_MARGIN

protected static final int LEFT_GRAPH_MARGIN
See Also:
Constant Field Values

RIGHT_GRAPH_MARGIN

protected static final int RIGHT_GRAPH_MARGIN
See Also:
Constant Field Values

VERTICAL_GRAPH_OFFSET

protected static final int VERTICAL_GRAPH_OFFSET
See Also:
Constant Field Values

TOTAL_H_GRAPH_MARGIN

protected static final int TOTAL_H_GRAPH_MARGIN
See Also:
Constant Field Values

TOTAL_V_GRAPH_MARGIN

protected static final int TOTAL_V_GRAPH_MARGIN
See Also:
Constant Field Values

VERTICAL__MIN_GRID_HEIGHT

protected static final int VERTICAL__MIN_GRID_HEIGHT
See Also:
Constant Field Values

HORIZONTAL__MIN_GRID_WIDTH

protected static final int HORIZONTAL__MIN_GRID_WIDTH
See Also:
Constant Field Values

devColor

protected static final Color devColor

avgColor

protected static final Color avgColor

defaultFormater

public static final DecimalFormat defaultFormater

defaultFont

public static final Font defaultFont

defaultDisplayAttributes

protected static final CalculableDisplayAttributes defaultDisplayAttributes

watchDataSource

protected WatchDataSource watchDataSource

accum

protected Accumulator accum

data

protected Calculable[] data

highThreshold

protected double highThreshold

lowThreshold

protected double lowThreshold

startValue

protected double startValue

stopValue

protected double stopValue

min

protected double min

max

protected double max

mean

protected double mean

stdDev

protected double stdDev

yLegend

protected String yLegend

yLegendFont

protected Font yLegendFont

yScale

protected double yScale

yFormat

protected NumberFormat yFormat

xLegend

protected String xLegend

xLegendFont

protected Font xLegendFont

xScale

protected double xScale

xFormat

protected NumberFormat xFormat

title

protected String title

titleFont

protected Font titleFont

calcDisplayAttrs

protected CalculableDisplayAttributes calcDisplayAttrs

currentSize

protected int currentSize

drawWidth

protected double drawWidth

rangeSize

protected double rangeSize

drawHeight

protected double drawHeight

topLineValue

protected double topLineValue

bottomLineValue

protected double bottomLineValue

valuesRange

protected double valuesRange

vStep

protected double vStep

vStepMultiplier

protected double vStepMultiplier

nbrHGrids

protected double nbrHGrids

maxY

protected double maxY

minY

protected double minY
Constructor Detail

DefaultCalculableView

public DefaultCalculableView()
Creates new DefaultCalculableView


DefaultCalculableView

public DefaultCalculableView(CalculableDisplayAttributes calcDisplayAttrs)
Creates new DefaultCalculableView

Parameters:
calcDisplayAttrs - The Calculable Display Attributes used to format the graph
Method Detail

setCalculableDisplayAttributes

public void setCalculableDisplayAttributes(CalculableDisplayAttributes calcDisplayAttrs)
Sets the Calculable Display Attributes used to format the graph

Parameters:
calcDisplayAttrs - The Calculable Display Attributes used to format the graph

setWatchDataSource

public void setWatchDataSource(WatchDataSource watchDataSource)
Sets the watch data source for this view

Specified by:
setWatchDataSource in interface CalculableViewable
Parameters:
watchDataSource - The WatchDataSource

resetValues

protected void resetValues()
Reset the graph values to default values


initValues

protected void initValues()
Initialize the graph values from the WatchDataSource


paint

public void paint(Graphics g,
                  Dimension size)
Paints the view to the graphics context

Specified by:
paint in interface CalculableViewable
Parameters:
g - The Graphics context
size - The Dimension to paint

getCalcForPoint

public CalculableViewable.PlottedCalculable getCalcForPoint(Point point)
Description copied from interface: CalculableViewable
Get the Calculable value for a corresponding point

Specified by:
getCalcForPoint in interface CalculableViewable
Parameters:
point - The point
Returns:
If the plotted Calculable point's X value is equal to the input point's X value return the PlottedCalculable. Otherwise return null

getLength

protected int getLength()
Returns:
Get the length property

getTopLineValue

protected double getTopLineValue()
Returns:
The value for the top Y axis

getBottomLineValue

protected double getBottomLineValue()
Returns:
The value for the bottom Y axis

Copyright © Rio Project.

Copyright © 2006-2011 Rio Project. All Rights Reserved.