|
Venice 0.7beta | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.mov.chart.graph.AbstractGraph
org.mov.chart.graph.MomentumGraph
public class MomentumGraph
Momentum graph. This graph is used to show the direction that the stock price is moving. The momentum for a given day is calculated as the day close of today minus the day close of period days ago.
PeriodGraphUI| Field Summary |
|---|
| Fields inherited from interface org.mov.chart.graph.Graph |
|---|
TOOL_TIP_BUFFER |
| Constructor Summary | |
|---|---|
MomentumGraph(GraphSource source)
Create a new momentum graph. |
|
| Method Summary | |
|---|---|
static Graphable |
createMomentum(Graphable source,
int period)
Create a momentum graphable. |
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. |
double |
getHighestY(java.util.List x)
Return the highest Y value in the given X range. |
double |
getLowestY(java.util.List x)
Return the loweset Y value in the given X range. |
java.lang.String |
getName()
Return the name of this graph. |
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. |
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. |
| Methods inherited from class org.mov.chart.graph.AbstractGraph |
|---|
getEndX, getSettings, getSource, getSourceName, getStartX, getXRange, getY |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MomentumGraph(GraphSource source)
source - the source to create a momentum graph from| Method Detail |
|---|
public void render(java.awt.Graphics g,
java.awt.Color colour,
int xoffset,
int yoffset,
double horizontalScale,
double verticalScale,
double bottomLineValue,
java.util.List xRange)
Graph
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 plot
public java.lang.String getToolTipText(java.lang.Comparable x,
int y,
int yoffset,
double verticalScale,
double bottomLineValue)
AbstractGraph
getToolTipText in interface GraphgetToolTipText in class AbstractGraphx - 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
GraphSourcepublic double getHighestY(java.util.List x)
AbstractGraph
getHighestY in interface GraphgetHighestY in class AbstractGraphx - range of X values
GraphSourcepublic double getLowestY(java.util.List x)
AbstractGraph
getLowestY in interface GraphgetLowestY in class AbstractGraphx - range of X values
GraphSourcepublic double[] getAcceptableMajorDeltas()
AbstractGraph
getAcceptableMajorDeltas in interface GraphgetAcceptableMajorDeltas in class AbstractGraphGraphSourcepublic double[] getAcceptableMinorDeltas()
AbstractGraph
getAcceptableMinorDeltas in interface GraphgetAcceptableMinorDeltas in class AbstractGraphGraphSourceGraph.getAcceptableMajorDeltas()public java.lang.String getYLabel(double value)
AbstractGraph
getYLabel in interface GraphgetYLabel in class AbstractGraphvalue - y value
GraphSource
would display
public static Graphable createMomentum(Graphable source,
int period)
source - the input graph sourceperiod - the desired period of the momentum graph
public java.lang.String getName()
Momentumpublic boolean isPrimary()
Graph
true if the graph is a primary graphpublic void setSettings(java.util.HashMap settings)
AbstractGraph
setSettings in interface GraphsetSettings in class AbstractGraphsettings - the new settingspublic GraphUI getUI(java.util.HashMap settings)
getUI in interface GraphgetUI in class AbstractGraphsettings - the initial settings
|
Venice 0.7beta | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||