Venice 0.7beta

org.mov.chart.graph
Class MACDGraphUI

java.lang.Object
  extended by org.mov.chart.graph.MACDGraphUI
All Implemented Interfaces:
GraphUI

public class MACDGraphUI
extends java.lang.Object
implements GraphUI

The MACD graph user interface.

Author:
Andrew Leppard
See Also:
MACDGraph

Field Summary
static java.lang.String EMA
           
static java.lang.String SMA
           
 
Constructor Summary
MACDGraphUI(java.util.HashMap settings)
          Create a new MACD user interface with the initial settings.
 
Method Summary
 java.lang.String checkSettings()
          Check the current settings displayed in the user interface.
static java.lang.String getAverageType(java.util.HashMap settings)
          Retrieve the average type (EMA or SMA) from the settings hashmap.
 javax.swing.JPanel getPanel()
          Return the user interface.
static int getPeriodFirstAverage(java.util.HashMap settings)
          Retrieve the period of the first average from the settings hashmap.
static int getPeriodSecondAverage(java.util.HashMap settings)
          Retrieve the period of the second average from the settings hashmap.
 java.util.HashMap getSettings()
          Return the current settings displayed in the user interface.
static double getSmoothingConstantFirstAverage(java.util.HashMap settings)
          Retrieve the smoothing constant of the first average from the settings hashmap.
static double getSmoothingConstantSecondAverage(java.util.HashMap settings)
          Retrieve the smoothing constant of the second average from the settings hashmap.
 void setSettings(java.util.HashMap settings)
          Display the given settings in the user interface.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SMA

public static final java.lang.String SMA
See Also:
Constant Field Values

EMA

public static final java.lang.String EMA
See Also:
Constant Field Values
Constructor Detail

MACDGraphUI

public MACDGraphUI(java.util.HashMap settings)
Create a new MACD user interface with the initial settings.

Parameters:
settings - the initial settings
Method Detail

checkSettings

public java.lang.String checkSettings()
Description copied from interface: GraphUI
Check the current settings displayed in the user interface. Return an error message if the settings are invalid.

Specified by:
checkSettings in interface GraphUI
Returns:
the error message or null if the settings are valid

getSettings

public java.util.HashMap getSettings()
Description copied from interface: GraphUI
Return the current settings displayed in the user interface.

Specified by:
getSettings in interface GraphUI
Returns:
current settings

setSettings

public void setSettings(java.util.HashMap settings)
Description copied from interface: GraphUI
Display the given settings in the user interface.

Specified by:
setSettings in interface GraphUI
Parameters:
settings - the new settings

getPanel

public javax.swing.JPanel getPanel()
Description copied from interface: GraphUI
Return the user interface.

Specified by:
getPanel in interface GraphUI
Returns:
the user interface

getAverageType

public static java.lang.String getAverageType(java.util.HashMap settings)
Retrieve the average type (EMA or SMA) from the settings hashmap. If the hashmap is empty, then return the default average type (i.e. EMA).

Parameters:
settings - the settings
Returns:
the average type

getPeriodFirstAverage

public static int getPeriodFirstAverage(java.util.HashMap settings)
Retrieve the period of the first average from the settings hashmap. If the hashmap is empty, then return the default.

Parameters:
settings - the settings
Returns:
the period

getSmoothingConstantFirstAverage

public static double getSmoothingConstantFirstAverage(java.util.HashMap settings)
Retrieve the smoothing constant of the first average from the settings hashmap. If the hashmap is empty, then return the default smoothing constant.

Parameters:
settings - the settings
Returns:
the smoothign constant

getPeriodSecondAverage

public static int getPeriodSecondAverage(java.util.HashMap settings)
Retrieve the period of the second average from the settings hashmap. If the hashmap is empty, then return the default.

Parameters:
settings - the settings
Returns:
the period

getSmoothingConstantSecondAverage

public static double getSmoothingConstantSecondAverage(java.util.HashMap settings)
Retrieve the smoothing constant of the second average from the settings hashmap. If the hashmap is empty, then return the default smoothing constant.

Parameters:
settings - the settings
Returns:
the smoothign constant

Venice 0.7beta