NetCharts Pro

netcharts.pro.common.lineset
Class NFLineSet

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.common.lineset.NFLineSet
All Implemented Interfaces:
java.lang.Cloneable, NFValueLabelConstants
Direct Known Subclasses:
NFBubbleSet

public class NFLineSet
extends NFDataSet
implements NFValueLabelConstants

The NFLineSet object contains information for lines, symbols, or both. This object is used widely in a number of different chart styles. An example of using a lineset for a one dimensional NFLinechart is shown here:

        NFLinechart lc = new NFLinechart();
        NFLineSet lineSet = new NFLineSet("Apples", Color.red);
        for (int j=0; j < 20; j++)
                lineSet.addElement(j);

        lc.addLineSet(lineSet);
 


Field Summary
static java.util.Hashtable lineValueLabelStyleMap
          The set of allowed line value label styles.
 
Fields inherited from interface netcharts.pro.common.lineset.NFValueLabelConstants
BOTTOM, BOTTOMLEFT, BOTTOMRIGHT, CENTER, LEFT, NONE, RIGHT, TOP, TOPLEFT, TOPRIGHT
 
Constructor Summary
NFLineSet()
          Constructs a default line set.
NFLineSet(java.awt.Color lineColor)
          Constructs a set with the given line color
NFLineSet(int symbolType, java.awt.Color symbolColor, int symbolSize)
          Constructs a set with the given symbol type, color, and size
NFLineSet(int symbolType, java.awt.Color symbolColor, int symbolSize, int lineStyle, int lineThickness, java.awt.Color lineColor)
          Constructs a set with the given line style, line width, line color, sumbol type, symbol color, and symbol size.
NFLineSet(int lineStyle, int lineThickness, java.awt.Color lineColor)
          Constructs a set with the given line style, width, and color
NFLineSet(java.lang.String legendName, java.awt.Color lineColor)
          Constructs a set with the given legend name and line color
 
Method Summary
 void addElement(java.util.Date data)
          Add a object to the set.
 void addElement(double doubleValue)
          Add a double to the set.
 void addElement(int intValue)
          Add an integer to the set.
 void addElement(java.lang.Number data)
          Add a object to the set.
 void addElement(java.lang.Object xval, java.lang.Object yval)
          Adds the given x and y value to the set.
 java.lang.Object clone()
          Does a deep copy of this lineset object
 java.lang.String getCDL()
          Generate CDL parameters representing this data
 java.lang.String getCDLAppearance()
          Generate the CDL that creates the appearance information.
 java.lang.String getCDLAs2D()
          Generate CDL parameters representing this data in two dimensional form.
 java.lang.String getCDLDefault()
          Perform the superclass getCDL() method.
 java.lang.String getCDLLineValueLabelStyle()
          Get the line value label style for the set from a CDL string.
 java.lang.String getCDLTuples()
          Generate CDL parameters representing this data
 java.awt.Color getColor()
          Gets the default color to use for the lines and symbols.
 NFColorTable getColorTable()
          Gets the colorTable for the symbols in this set.
 java.awt.Color getFillColor()
          Gets the color to use for area fills
 NFFillPattern getFillPattern()
          Gets the fill pattern this lineset should use.
 java.lang.String getLegendName()
          Returns the data set name used in the legend.
 NFLineSetLine getLine()
          Get this lineset's line style
 int getLineValueLabelStyle()
          Gets the type of text labeling for lines in this set
 boolean getModifiedAppearance()
          Returns if the appearance of this dataset has changed.
 boolean getModifiedValueLabel()
          Returns if the positioning of value labels has changed in this set.
 NFLineSetSymbol getSymbol()
          Get this lineset's symbol
 void setCDLAppearance(java.lang.String s)
          Configures the appearance information from a CDL parameter representation.
 void setCDLLineValueLabelStyle(java.lang.String cdl)
          Set the line value label style for the set from a CDL string.
 void setColor(java.awt.Color defaultColor)
          Sets the default color to use for the lines and symbols.
 void setColorTable(NFColorTable colorTable)
          Sets the individual color for each symbols in this set.
 void setFillColor(java.awt.Color color)
          Sets the color to use for area fills
 void setFillPattern(NFFillPattern fillPattern)
          Sets the fill pattern this lineset should use.
 void setLegendName(java.lang.String legendName)
          Set the data set name to use in legend.
 void setLine(NFLineSetLine line)
          Set this lineset's line style
 void setLineValueLabelStyle(int lineValueLabelStyle)
          Sets the type of text labeling for lines in this set.
 void setSymbol(NFLineSetSymbol symbol)
          Set this lineset's symbol
 
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, 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
 

Field Detail

lineValueLabelStyleMap

public static java.util.Hashtable lineValueLabelStyleMap
The set of allowed line value label styles. Consists of NONE, RIGHT, LEFT, TOP, BOTTOM, TOPLEFT, TOPRIGHT, BOTTOMLEFT, BOTTOMRIGHT, CENTER.

Constructor Detail

NFLineSet

public NFLineSet()
Constructs a default line set. Creates a solid line using the default color table color.


NFLineSet

public NFLineSet(java.awt.Color lineColor)
Constructs a set with the given line color

Parameters:
lineColor - Line color.

NFLineSet

public NFLineSet(java.lang.String legendName,
                 java.awt.Color lineColor)
Constructs a set with the given legend name and line color

Parameters:
legendName - The name that will appear in the legend for this set.
lineColor - Line color.

NFLineSet

public NFLineSet(int symbolType,
                 java.awt.Color symbolColor,
                 int symbolSize)
Constructs a set with the given symbol type, color, and size

Parameters:
symbolType - A NFLineSetSymbol type. One of CIRCLE, SQUARE, DIAMOND, TRIANGLEUP, TRIANGLEDOWN, CROSS, VRECTANGLE, HRECTANGLE, IMAGE.
symbolColor - Color of the symbol (ignored for IMAGE types).
symbolSize - Size of symbol (ignored for IMAGE types)

NFLineSet

public NFLineSet(int lineStyle,
                 int lineThickness,
                 java.awt.Color lineColor)
Constructs a set with the given line style, width, and color

Parameters:
lineStyle - A NFLineSetLine style. One of NONE, SOLID, DOTTED, DASHED, DOTDASH
lineThickness - Line thickness in pixels.
lineColor - Line color.

NFLineSet

public NFLineSet(int symbolType,
                 java.awt.Color symbolColor,
                 int symbolSize,
                 int lineStyle,
                 int lineThickness,
                 java.awt.Color lineColor)
Constructs a set with the given line style, line width, line color, sumbol type, symbol color, and symbol size.

Method Detail

clone

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

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

addElement

public void addElement(int intValue)
Add an integer to the set.

Parameters:
intValue - datum to add

addElement

public void addElement(double doubleValue)
Add a double to the set.

Parameters:
doubleValue - datum to add

addElement

public void addElement(java.lang.Number data)
Add a object to the set. Use of this method assumes a one dimensional data set as is used in NFLinechart.

Parameters:
data - Number value

addElement

public void addElement(java.util.Date data)
Add a object to the set. Use of this method assumes a one dimensional data set as is used in NFLinechart.

Parameters:
data - Date value

addElement

public void addElement(java.lang.Object xval,
                       java.lang.Object yval)
Adds the given x and y value to the set. This method assumes this chart uses two dimensional line/symbol data (NFXYchart, NFCombochart, NFStockchart). Data may be a null or of type Number or Date.

If the value passed is not a valid data item an IllegalArgumentException will be thrown.

Parameters:
xval - The X value object
yval - The Y value object

getModifiedAppearance

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

Returns:
modified

setSymbol

public void setSymbol(NFLineSetSymbol symbol)
Set this lineset's symbol

Parameters:
symbol - Symbol to be drawn at data point locations.

getSymbol

public NFLineSetSymbol getSymbol()
Get this lineset's symbol

Returns:
symbol to be drawn at data point locations or null if not defined.

setLine

public void setLine(NFLineSetLine line)
Set this lineset's line style

Parameters:
line - Line style used to connect adjacent points.

getLine

public NFLineSetLine getLine()
Get this lineset's line style

Returns:
line style used to connect adjacent points or null if not defined.

setFillColor

public void setFillColor(java.awt.Color color)
Sets the color to use for area fills

Parameters:
color - Fill color to use.

getFillColor

public java.awt.Color getFillColor()
Gets the color to use for area fills

Returns:
fill color to use or null if not defined.

setColor

public void setColor(java.awt.Color defaultColor)
Sets the default color to use for the lines and symbols. This may be overridden by explicitly setting line or symbol properties.

Parameters:
defaultColor - Default color to use for lines and symbols.

setColorTable

public void setColorTable(NFColorTable colorTable)
Sets the individual color for each symbols in this set. The colorTable overrides the color set by setColor(Color).

Parameters:
colorTable - the colors to use for the symbols

getColor

public java.awt.Color getColor()
Gets the default color to use for the lines and symbols.

Returns:
default color to use for lines and symbols or null if not defined.

getColorTable

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

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

setFillPattern

public void setFillPattern(NFFillPattern fillPattern)
Sets the fill pattern this lineset should use.

Parameters:
fillPattern - Fill pattern for this lineset.

getFillPattern

public NFFillPattern getFillPattern()
Gets the fill pattern this lineset should use.

Returns:
fill pattern for this lineset or null if not defined.

setLegendName

public void setLegendName(java.lang.String legendName)
Set the data set name to use in legend.

Parameters:
legendName - Name to use in legend

getLegendName

public java.lang.String getLegendName()
Returns the data set name used in the legend.

Returns:
the legend name

setLineValueLabelStyle

public void setLineValueLabelStyle(int lineValueLabelStyle)
Sets the type of text labeling for lines in this set.

If the value passed is not a valid line value label style an IllegalArgumentException will be thrown.

Parameters:
lineValueLabelStyle - One of NONE, EXTERNAL, RIGHT, LEFT, BOTTOM, TOPLEFT, TOPRIGHT, BOTTOMRIGHT, BOTTOMLEFT, CENTER..

getLineValueLabelStyle

public int getLineValueLabelStyle()
Gets the type of text labeling for lines in this set

Returns:
lineValueLabelStyle One of NONE, EXTERNAL, RIGHT, LEFT, BOTTOM, TOPLEFT, TOPRIGHT, BOTTOMRIGHT, BOTTOMLEFT, CENTER or NONE if not set.

getModifiedValueLabel

public boolean getModifiedValueLabel()
Returns if the positioning of value labels has changed in this set.

Returns:
true if the value labels have changed.

getCDLAppearance

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

Returns:
CDL in the form: ("legendName", defaultColor)

setCDLAppearance

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

Parameters:
cdl - CDL in the form: ("legendName", defaultColor)

getCDL

public java.lang.String getCDL()
Generate CDL parameters representing this data

Overrides:
getCDL in class NFVector
Returns:
CDL data in the form: y1,y2,y3,y4,y5

getCDLAs2D

public java.lang.String getCDLAs2D()
Generate CDL parameters representing this data in two dimensional form. If the internal data does not have two dimensions, the vector index will be used to represent the X value.

Returns:
CDL data in the form: (x1,y1),(x2,y2),(x3,y3),(x4,y4),(x5,y5)

getCDLTuples

public java.lang.String getCDLTuples()
Generate CDL parameters representing this data

Returns:
CDL data in the form: (a1,a2,a3,...aN),(b1,b2,b3,...,bN)

getCDLDefault

public java.lang.String getCDLDefault()
Perform the superclass getCDL() method.

Returns:
CDL data

getCDLLineValueLabelStyle

public java.lang.String getCDLLineValueLabelStyle()
Get the line value label style for the set from a CDL string.

Returns:
cdl

setCDLLineValueLabelStyle

public void setCDLLineValueLabelStyle(java.lang.String cdl)
Set the line value label style for the set from a CDL string.

Parameters:
cdl -

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