NetCharts Pro

netcharts.pro.charts.stock
Class NFStockSet

java.lang.Object
  extended by netcharts.pro.common.NFBaseClass
      extended by netcharts.pro.common.NFVector
          extended by netcharts.pro.common.NFBaseSet
              extended by netcharts.pro.common.NFSet
                  extended by netcharts.pro.common.rectangular.NFDataSet
                      extended by netcharts.pro.charts.stock.NFStockSet
All Implemented Interfaces:
java.lang.Cloneable

public class NFStockSet
extends NFDataSet

The NFStockSet object contains information for stock symbols. An example of its usage is shown here:


 NFStockchart sc = new NFStockchart();
 sc.setStockBarWidth(5);
 sc.setTicLength(5);
 sc.setSize(new Dimension(600,300));
 NFStockSet sset = new NFStockSet("Stock Set 1", Color.blue);
 // Add some values in the form: high, low, open, close
 sset.addElement(90,40,50,80);
 sset.addElement(89,55,80,77);
 sc.addStockSet(sset);
 ...
 


Constructor Summary
NFStockSet()
          Constructs a default stock set
NFStockSet(java.awt.Color stockColor)
          Constructs a stock set with the given stock symbol color.
NFStockSet(java.lang.String legendName, java.awt.Color stockColor)
          Constructs a stock set with the given stock symbol color and legend name
 
Method Summary
 void addElement(double high, double low, double open, double close)
          Adds a new stock symbol.
 java.lang.Object clone()
          Does a deep copy of this stockset object
 int getBarWidth()
          The barWidth attribute defines the width of the vertical bar (hi/lo) in pixels.
 java.lang.String getCDLAppearance()
          Generate the CDL that creates the appearance information.
 java.awt.Color getColor()
          The color attribute defines the bar color to be used for the vertical bar (hi/lo) and the horizontal ticks (open/close).
 NFColorTable getColorTable()
          Gets the colorTable for the bars in this set.
 NFFillPattern getFillPattern()
          The fillPattern attribute is used to provide either gradient fills, image fills, or pattern fills for this stock set.
 java.lang.String getLegendName()
          Get the name of the dataset
 boolean getModifiedAppearance()
          Returns if the appearance of this dataset has changed.
 int getTicLength()
          The ticLength attribute defines the length of the open/close tic marks in pixels.
 void setBarWidth(int barWidth)
          The barWidth attribute defines the width of the vertical bar (hi/lo) in pixels.
 void setCDLAppearance(java.lang.String cdl)
          Configures the appearance information from a CDL parameter representation.
 void setColor(java.awt.Color stockColor)
          The color attribute defines the bar color to be used for the vertical bar (hi/lo) and the horizontal ticks (open/close).
 void setColorTable(NFColorTable colorTable)
          Sets the individual color for each vertical bar (hi/lo) in this set.
 void setFillPattern(NFFillPattern fillPattern)
          The fillPattern attribute is used to provide either gradient fills, image fills, or pattern fills for this stock set.
 void setLegendName(java.lang.String legendName)
          Set the name of the dataset
 void setTicLength(int ticLength)
          The ticLength attribute defines the length of the open/close tic marks in pixels.
 
Methods inherited from class netcharts.pro.common.rectangular.NFDataSet
setXAxis, setYAxis
 
Methods inherited from class netcharts.pro.common.NFSet
getAxisMap, setAxisMap
 
Methods inherited from class netcharts.pro.common.NFBaseSet
addActiveLabel, getActiveLabels, getSetName, setActiveLabels, setSetName
 
Methods inherited from class netcharts.pro.common.NFVector
addElement, addElement, elementAt, elementAt, getCDL, getCDL, getCDL, getCDLHasTuples, getCDLKeyValues, getCDLKeyValuesHasPoints, getMaxDimensions, getQuoteStrings, getSize, isEmptyStringAsNull, loadDataModel, loadDataModel, loadDataModel, removeElementAt, reset, setCDL, setCDLHasTuples, setCDLNullString, setElementAt, setEmptyStringAsNull, setQuoteStrings, setSize, size, skipNulls, toArray, toString
 
Methods inherited from class netcharts.pro.common.NFBaseClass
getModified, getUserObject, setModified, setUserObject
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NFStockSet

public NFStockSet()
Constructs a default stock set


NFStockSet

public NFStockSet(java.awt.Color stockColor)
Constructs a stock set with the given stock symbol color.

Parameters:
stockColor - Color to use when displaying symbols in this stock set

NFStockSet

public NFStockSet(java.lang.String legendName,
                  java.awt.Color stockColor)
Constructs a stock set with the given stock symbol color and legend name

Parameters:
legendName - Text to use in the legend
stockColor - Color to use when displaying symbols in this stock set
Method Detail

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Does a deep copy of this stockset object

Overrides:
clone in class NFSet
Returns:
Object
Throws:
java.lang.CloneNotSupportedException

getModifiedAppearance

public boolean getModifiedAppearance()
Returns if the appearance of this dataset has changed.

Returns:
true if modified

setColor

public void setColor(java.awt.Color stockColor)
The color attribute defines the bar color to be used for the vertical bar (hi/lo) and the horizontal ticks (open/close). A default color is taken from the ColorTable if the color attribute is set to "null".

Parameters:
stockColor - Color of stock set.

setColorTable

public void setColorTable(NFColorTable colorTable)
Sets the individual color for each vertical bar (hi/lo) in this set. The corresponding horizontal ticks (open/close) are given the same color.

Parameters:
colorTable - the colors to use for the vertical bars and horizontal tics in the set

getColor

public java.awt.Color getColor()
The color attribute defines the bar color to be used for the vertical bar (hi/lo) and the horizontal ticks (open/close). A default color is taken from the ColorTable if the color attribute is set to "null".

Returns:
color of stockset or null if not defined.

getColorTable

public NFColorTable getColorTable()
Gets the colorTable for the bars in this set.

Returns:
the colorTable for this set's bars or null if not defined.

setBarWidth

public void setBarWidth(int barWidth)
The barWidth attribute defines the width of the vertical bar (hi/lo) in pixels. This pixel value overrides the NFStockchart settings for the barWidth. If either barWidth or the ticLength parameter is set to 0 then the NFStockchart values are used to determine the size of the bar and tics.

Parameters:
barWidth - Width of stock "bars".

getBarWidth

public int getBarWidth()
The barWidth attribute defines the width of the vertical bar (hi/lo) in pixels. This pixel value overrides the NFStockchart settings for the barWidth. If either barWidth or the ticLength parameter is set to 0 then the NFStockchart values are used to determine the size of the bar and tics.

Returns:
barWidth or 0 if not defined.

setTicLength

public void setTicLength(int ticLength)
The ticLength attribute defines the length of the open/close tic marks in pixels. This pixel value overrides the NFStockchart settings for ticLength. If either barWidth or the ticLength parameter is set to 0 then the NFStockchart values are used to determine the size of the bar and tics.

Parameters:
ticLength - Length of open/close tic marks in pixels.

getTicLength

public int getTicLength()
The ticLength attribute defines the length of the open/close tic marks in pixels. This pixel value overrides the NFStockchart settings for ticLength. If either barWidth or the ticLength parameter is set to 0 then the NFStockchart values are used to determine the size of the bar and tics.

Returns:
ticLength or zero if not defined.

setFillPattern

public void setFillPattern(NFFillPattern fillPattern)
The fillPattern attribute is used to provide either gradient fills, image fills, or pattern fills for this stock set.

Parameters:
fillPattern -

getFillPattern

public NFFillPattern getFillPattern()
The fillPattern attribute is used to provide either gradient fills, image fills, or pattern fills for this stock set.

Returns:
fillPattern or null if not defined.

addElement

public void addElement(double high,
                       double low,
                       double open,
                       double close)
Adds a new stock symbol. To insert a null value, simply call addElement(null); Note: An alternate method of providing data is to extend the NFDataModelStock class and then pass that object to this data set via the loadDataModel call.

Parameters:
high -
low -
open -
close -

setLegendName

public void setLegendName(java.lang.String legendName)
Set the name of the dataset

Parameters:
legendName - Name of the set to use in legend if not overridden by the legend object itself.

getLegendName

public java.lang.String getLegendName()
Get the name of the dataset

Parameters:
legendName - Name of the set to use in legend or null if not defined.

getCDLAppearance

public java.lang.String getCDLAppearance()
Generate the CDL that creates the appearance information.

Returns:
CDL in the form: ("legendName", stockColor, barWidth, ticLength)

setCDLAppearance

public void setCDLAppearance(java.lang.String cdl)
Configures the appearance information from a CDL parameter representation.

Parameters:
cdl - CDL in the form: ("legendName", stockColor, barWidth, ticLength)

NetCharts Pro


Visual Mining, Inc.
2099 Gaither Rd.
Suite 220
Rockville, MD 20850
800.308.0731
301.947.8293 FAX

Copyright © Visual Mining, Inc. 1996 - 2011
All Rights Reserved.

NetCharts Pro TM is a registered trademark of Visual Mining, Inc. Other brands and their products are trademarks of their respective holders.

Last Modified: Jun 28, 2011