|
Venice 0.751beta | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
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 | |
boolean |
dataAvailable(java.util.Vector xRange)
Return whether the graph has a price for range xRange Is trivially true for all graphs apart from the PointAndFigure graph as P&F is the only graph type where price data does not map one to one to date. |
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. |
int |
getSourceType()
Return the type 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 topLineValue,
double bottomLineValue,
java.util.List xRange,
boolean vertOrientation)
Draw the graph. |
void |
setSettings(java.util.HashMap settings)
Set the graph's user definable settings. |
| Field Detail |
public static final int TOOL_TIP_BUFFER
| Method Detail |
public void render(java.awt.Graphics g,
java.awt.Color colour,
int xoffset,
int yoffset,
double horizontalScale,
double verticalScale,
double topLineValue,
double bottomLineValue,
java.util.List xRange,
boolean vertOrientation)
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 ytopLineValue - the Y value of the lowest line in the graphbottomLineValue - the Y value of the lowest line in the graphxRange - a List of Comparable
that contain the X values to plotvertOrientation - true if increasing y values mean decreasing Y values
public java.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
public java.lang.Comparable getStartX()
public java.lang.Comparable getEndX()
public java.util.Set getXRange()
List of Comparable X valuespublic java.lang.String getYLabel(double value)
value - y value
public java.lang.String getName()
Simple Moving Average.
public java.lang.String getSourceName()
CBA.
public int getSourceType()
Portfolio.
public java.lang.Double getY(java.lang.Comparable xRange)
xRange - value
public double getHighestY(java.util.List xRange)
xRange - range of X values
public double getLowestY(java.util.List xRange)
xRange - range of X values
public double[] getAcceptableMajorDeltas()
--------------- $4.80
-----+==+------ $3.60
/ \
---+------+---- $2.40
/ \---
-+------------- $1.20
Here 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.
public double[] getAcceptableMinorDeltas()
getAcceptableMajorDeltas()public java.util.HashMap getSettings()
public void setSettings(java.util.HashMap settings)
settings - the new settingspublic GraphUI getUI(java.util.HashMap settings)
null here.
settings - initial settings
nullpublic boolean isPrimary()
true if the graph is a primary graphpublic boolean dataAvailable(java.util.Vector xRange)
xRange - Range of X values
|
Venice 0.751beta | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||