Venice 0.751beta

nz.org.venice.chart.graph
Class PointAndFigureGraphUI

java.lang.Object
  extended bynz.org.venice.chart.graph.PointAndFigureGraphUI
All Implemented Interfaces:
GraphUI

public class PointAndFigureGraphUI
extends java.lang.Object
implements GraphUI

The Point and Figure graph user interface.

Author:
Andrew Leppard
See Also:
PointAndFigureGraph

Field Summary
protected static java.lang.String BOX_PRICE_SCALE
           
protected static java.lang.String PRICE_REVERSAL_SCALE
           
 
Constructor Summary
PointAndFigureGraphUI(java.util.HashMap settings, double defaultPriceReversalScale, double defaultBoxPriceScale)
          Create a new Point and Figure user interface with the initial settings.
 
Method Summary
 java.lang.String checkSettings()
          Check the current settings displayed in the user interface.
 java.lang.String checkSettings(java.util.HashMap settings)
          Check previously set settings.
static double getBoxPriceScale(java.util.HashMap settings, double defaultBoxPrice)
          Retrieve the box price from the settings hashmap.
 javax.swing.JPanel getPanel()
          Return the user interface.
static double getPriceReversalScale(java.util.HashMap settings, double defaultPriceReversalScale)
          Retrieve the price scale from the settings hashmap.
 java.util.HashMap getSettings()
          Return the current settings displayed in the user interface.
 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

PRICE_REVERSAL_SCALE

protected static final java.lang.String PRICE_REVERSAL_SCALE
See Also:
Constant Field Values

BOX_PRICE_SCALE

protected static final java.lang.String BOX_PRICE_SCALE
See Also:
Constant Field Values
Constructor Detail

PointAndFigureGraphUI

public PointAndFigureGraphUI(java.util.HashMap settings,
                             double defaultPriceReversalScale,
                             double defaultBoxPriceScale)
Create a new Point and Figure user interface with the initial settings.

Parameters:
settings - the initial settings
defaultPriceReversalScale - default price scale based on data
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

checkSettings

public java.lang.String checkSettings(java.util.HashMap settings)
Description copied from interface: GraphUI
Check previously set settings. Return an error message if the settings are invalid.

Specified by:
checkSettings in interface GraphUI
Parameters:
settings - Previously saved settings
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

getPriceReversalScale

public static double getPriceReversalScale(java.util.HashMap settings,
                                           double defaultPriceReversalScale)
Retrieve the price scale from the settings hashmap. If the hashmap is empty, then return the default price scale.

Parameters:
settings - the settings
defaultPriceReversalScale - the default price scale
Returns:
the price scale

getBoxPriceScale

public static double getBoxPriceScale(java.util.HashMap settings,
                                      double defaultBoxPrice)
Retrieve the box price from the settings hashmap. If the hashmap is empty, then return the default box scale.

Parameters:
settings - the settings
defaultBoxPrice - the default price scale
Returns:
the box price

Venice 0.751beta