NetCharts Pro

netcharts.pro.charts.stock
Class NFStockSet

java.lang.Object
  |
  +--netcharts.pro.common.NFBaseClass
        |
        +--netcharts.pro.common.NFVector
              |
              +--netcharts.pro.common.NFSet
                    |
                    +--netcharts.pro.common.rectangular.NFDataSet
                          |
                          +--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.setSize(new Dimension(600,300));
 Object oa[][] = (Object[][])datavec.elementAt(0);

 // set up the stock data model - pulls data from
 // the appropriate area in the data
 NFDataModelStock dms = new NFDataModelStock(oa){

 		public Object getOpen(int row){
 			Object oo[][] = (Object[][])dataObject;
 			return oo[row][OPEN_INDEX];
 		}
 		public Object getClose(int row){
 			Object oo[][] = (Object[][])dataObject;
 			return oo[row][CLOSE_INDEX];
 		}
 		public Object getHigh(int row){
 			Object oo[][] = (Object[][])dataObject;
 			return oo[row][HIGH_INDEX];
 		}
 		public Object getLow(int row){
 			Object oo[][] = (Object[][])dataObject;
 			return oo[row][LOW_INDEX];
 		}
 		public int getNumPoints(){
 			Object oo[][] = (Object[][])dataObject;
 			return oo.length;
 		}

 };
 NFStockSet sset = new NFStockSet("Stock", (Color)null);
 sset.loadDataModel(dms);
 sset.setYAxis(priceAxis);
 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).
 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 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
addActiveLabel, getActiveLabels, getAxisMap, getSetName, setActiveLabels, setAxisMap, setSetName
 
Methods inherited from class netcharts.pro.common.NFVector
addElement, addElement, elementAt, elementAt, getCDL, getCDL, getCDL, getCDLHasTuples, getCDLKeyValues, getMaxDimensions, getQuoteStrings, getSize, loadDataModel, loadDataModel, loadDataModel, removeElementAt, reset, setCDL, setCDLHasTuples, setCDLNullString, setElementAt, 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

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.

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.

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.
15825 Shady Grove Rd.
Suite 20
Rockville, MD 20850
800.308.0731
301.947.8293 FAX

Copyright © Visual Mining, Inc. 1996 - 2004
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: Apr 1, 2004