|
Venice 0.7beta | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Graph
Provides a common interface to allow the charting module to support a variety of graphs. Classes that implement this interface will be able to render the graph onto the chart and provide axes information. Each graph can have its own user interface to allow the user to set user-definable parameters.
AbstractGraph
,
GraphUI
,
GraphSource
Field Summary | |
---|---|
static int |
TOOL_TIP_BUFFER
Maximum distance between the mouse pointer and the graph which will still make the tooltip come up |
Method Summary | |
---|---|
double[] |
getAcceptableMajorDeltas()
Return an array of acceptable major deltas for the vertical axis. |
double[] |
getAcceptableMinorDeltas()
Return an array of acceptable minor deltas for the vertical axis. |
java.lang.Comparable |
getEndX()
Get the last X value that this graph will draw. |
double |
getHighestY(java.util.List xRange)
Return the highest Y value in the given X range. |
double |
getLowestY(java.util.List xRange)
Return the loweset Y value in the given X range. |
java.lang.String |
getName()
Return the name of the graph we are graphing, e.g. |
java.util.HashMap |
getSettings()
Return the graph's current settings. |
java.lang.String |
getSourceName()
Return the name of the source data that we are graphing, e.g. |
java.lang.Comparable |
getStartX()
Get the first X value that this graph will draw. |
java.lang.String |
getToolTipText(java.lang.Comparable x,
int y,
int yoffset,
double verticalScale,
double bottomLineValue)
Get the tool tip text for the given X value and y coordinate. |
GraphUI |
getUI(java.util.HashMap settings)
Return the graph's user interface to allow the user to modify its settings. |
java.util.Set |
getXRange()
Get all X values that this graph will draw. |
java.lang.Double |
getY(java.lang.Comparable xRange)
Return the Y value for the given X value. |
java.lang.String |
getYLabel(double value)
Convert the Y value to a label to be displayed in the vertical axis. |
boolean |
isPrimary()
Return whether the graph is a primary graph. |
void |
render(java.awt.Graphics g,
java.awt.Color colour,
int xoffset,
int yoffset,
double horizontalScale,
double verticalScale,
double bottomLineValue,
java.util.List xRange)
Draw the graph. |
void |
setSettings(java.util.HashMap settings)
Set the graph's user definable settings. |
Field Detail |
---|
static final int TOOL_TIP_BUFFER
Method Detail |
---|
void render(java.awt.Graphics g, java.awt.Color colour, int xoffset, int yoffset, double horizontalScale, double verticalScale, double bottomLineValue, java.util.List xRange)
g
- the Graphics object to render tocolour
- the colour the graph should be rendered in; override
this if the graph should be drawn in
a certain colour - such as a Moving Average graphxoffset
- the x offset in the graphics object where the graph
startsyoffset
- the y offset in the graphics object where the graph
startshorizontalScale
- horizontal scale factor; use this to convert
between X value in the xRange
to a
cartesian coordinate xverticalScale
- vertical scale factor; use this to convert
between Y value to a cartesian coordinate ybottomLineValue
- the Y value of the lowest line in the graphxRange
- a List
of Comparable
that contain the X values to plotjava.lang.String getToolTipText(java.lang.Comparable x, int y, int yoffset, double verticalScale, double bottomLineValue)
x
- the X valuey
- the y coordinateyoffset
- y offset from top of graphverticalScale
- vertical scale factorbottomLineValue
- the Y value of the lowest line in the graph
java.lang.Comparable getStartX()
java.lang.Comparable getEndX()
java.util.Set getXRange()
List
of Comparable
X valuesjava.lang.String getYLabel(double value)
value
- y value
java.lang.String getName()
Simple Moving Average
.
java.lang.String getSourceName()
CBA
.
java.lang.Double getY(java.lang.Comparable xRange)
xRange
- value
double getHighestY(java.util.List xRange)
xRange
- range of X values
double getLowestY(java.util.List xRange)
xRange
- range of X values
double[] getAcceptableMajorDeltas()
--------------- $4.80 -----+==+------ $3.60 / \ ---+------+---- $2.40 / \--- -+------------- $1.20Here the values of the horizontal lines are $1.20, $2.40, $3.60 & $4.80. These are sensible values, values such as $1.36, $2.72, $4.08 & $5.44 are not as sensible. All the allowable values are calculated by the cross product of Major Deltas x Minor Deltas.
double[] getAcceptableMinorDeltas()
getAcceptableMajorDeltas()
java.util.HashMap getSettings()
void setSettings(java.util.HashMap settings)
settings
- the new settingsGraphUI getUI(java.util.HashMap settings)
null
here.
settings
- initial settings
null
boolean isPrimary()
true
if the graph is a primary graph
|
Venice 0.7beta | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |