NetCharts Pro

netcharts.pro.common.barset
Class NFBarSet

java.lang.Object
  |
  +--netcharts.pro.common.NFBaseClass
        |
        +--netcharts.pro.common.NFVector
              |
              +--netcharts.pro.common.NFBaseSet
                    |
                    +--netcharts.pro.common.NFSet
                          |
                          +--netcharts.pro.common.rectangular.NFDataSet
                                |
                                +--netcharts.pro.common.barset.NFBarSet
All Implemented Interfaces:
java.lang.Cloneable

public class NFBarSet
extends NFDataSet

An NFBarSet describes a single set of 1 dimensional data along with its appearance characteristics. Data can be added via the addElement(), setElementAt(), or loadDataModel() methods. A simple example of this object's usage is shown here:

	NFBarchart bc = new NFBarchart();
	NFBarSet barSet = new NFBarSet("Apples", Color.red);
	for (int j=0; j < 20; j++)
		barSet.addElement(j);
	barSet.setBarType(NFBarSet.TRIANGLEBAR);

	bc.addBarSet(barSet);
 


Field Summary
static int BAR
          Bar style
static java.util.Hashtable barValueLabelStyleMap
          The set of allwoed bar value label styles.
static int BOTTOM
          Bottom value label style - shows value at bar bottom
static int CYLINDER
          Cylindrical bar style
static int DIAMONDBAR
          Diamond bar style
static int EXTERNAL
          External value label style - shows value outside of bar
static int MIDDLE
          Middle value label style - shows value at bar midpoint
static int NONE
          No value label style
static int PIEHORIZONTAL
          Horizontal pie style - considers data to be a percentage value less than or equal to 100.
static int PIEVERTICAL
          Vertical pie style - considers data to be a percentage value less than or equal to 100.
static int TOP
          Top value label style - shows value on inside of bar top
static int TRIANGLEBAR
          Triangular bar style
 
Constructor Summary
NFBarSet()
          Constructs a default bar set
NFBarSet(java.awt.Color barColor)
          Constructs a bar set with the given data color.
NFBarSet(java.lang.String legendName, java.awt.Color barColor)
          Constructs a bar set with the given legend name and data color.
 
Method Summary
 void addElement(double doubleValue)
          Add a double to the set.
 void addElement(int intValue)
          Add an integer to the set.
 void addElement(java.lang.Object data)
          Add a object to the set.
 void addElement(java.lang.Object[] data)
          Add a object array to the set.
 java.lang.Object clone()
          Does a deep copy of this barset object
 int getBarStyle()
          Gets the display style for all bars in this set.
 int getBarValueLabelStyle()
          Gets the type of text labeling for bars in this set
 java.lang.String getCDLAppearance()
          Generate the CDL that creates the appearance information.
 java.lang.String getCDLBarValueLabelStyle()
          Get the bar value label style for the set from a CDL string.
 java.awt.Color getColor()
          Gets the color for all bars in this set.
 NFColorTable getColorTable()
          Gets the colorTable for the bars in this set.
 NFFillPattern getFillPattern()
          Gets the fill pattern for all bars in this set.
 NFVector getGroupStackFillPatterns()
          Returns the fill patterns for a GROUPSTACK bar chart.
 java.lang.String getLegendName()
          Returns the legend name
 boolean getModifiedAppearance()
          Returns if the appearance of this dataset has changed in this set.
 boolean getModifiedValueLabel()
          Returns if the positioning of value labels has changed in this set.
 NFBarSymbol getSymbol()
          Gets the bar symbol for all bars in this set.
 void setBarStyle(int barStyle)
          Sets the display style for all bars in this set.
 void setBarValueLabelStyle(int barValueLabelStyle)
          Sets the type of text labeling for bars in this set.
 void setCDLAppearance(java.lang.String s)
          Configures the appearance information from a CDL parameter representation.
 void setCDLBarValueLabelStyle(java.lang.String cdl)
          Set the bar value label style for the set from a CDL string.
 void setColor(java.awt.Color barColor)
          Sets the color for all bars in this set.
 void setColorTable(NFColorTable colorTable)
          Sets the individual color for each bar in this set.
 void setElementAt(java.lang.Object[] data, int index)
          Set the object array into the vector.
 void setElementAt(java.lang.Object data, int index)
          Set the object into the vector.
 void setFillPattern(NFFillPattern fillPattern)
          Sets the fill pattern for all bars in this set.
 void setGroupStackFillPatterns(NFVector groupStackFillPatterns)
          Sets the fill patterns for a GROUPSTACK bar chart.
 void setLegendName(java.lang.String legendName)
          Set the legend name of the set
 void setSymbol(NFBarSymbol barSymbol)
          Sets the bar symbol for all bars in this set.
 
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
elementAt, elementAt, getCDL, getCDL, getCDL, getCDLHasTuples, getCDLKeyValues, getCDLKeyValuesHasPoints, getMaxDimensions, getQuoteStrings, getSize, loadDataModel, loadDataModel, loadDataModel, removeElementAt, reset, setCDL, setCDLHasTuples, setCDLNullString, 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

BAR

public static final int BAR
Bar style

TRIANGLEBAR

public static final int TRIANGLEBAR
Triangular bar style

DIAMONDBAR

public static final int DIAMONDBAR
Diamond bar style

CYLINDER

public static final int CYLINDER
Cylindrical bar style

PIEVERTICAL

public static final int PIEVERTICAL
Vertical pie style - considers data to be a percentage value less than or equal to 100.

PIEHORIZONTAL

public static final int PIEHORIZONTAL
Horizontal pie style - considers data to be a percentage value less than or equal to 100.

NONE

public static final int NONE
No value label style

EXTERNAL

public static final int EXTERNAL
External value label style - shows value outside of bar

TOP

public static final int TOP
Top value label style - shows value on inside of bar top

MIDDLE

public static final int MIDDLE
Middle value label style - shows value at bar midpoint

BOTTOM

public static final int BOTTOM
Bottom value label style - shows value at bar bottom

barValueLabelStyleMap

public static java.util.Hashtable barValueLabelStyleMap
The set of allwoed bar value label styles. Consists of NONE, EXTERNAL, TOP, MIDDLE, BOTTOM
Constructor Detail

NFBarSet

public NFBarSet()
Constructs a default bar set

NFBarSet

public NFBarSet(java.awt.Color barColor)
Constructs a bar set with the given data color.
Parameters:
barColor - The color of the bars in this barset.

NFBarSet

public NFBarSet(java.lang.String legendName,
                java.awt.Color barColor)
Constructs a bar set with the given legend name and data color.
Parameters:
legendName - The name that will appear in the legend for this set.
barColor - The color of the bars in this barset.
Method Detail

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Does a deep copy of this barset object
Overrides:
clone in class NFSet
Returns:
Object

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.Object data)
Add a object to the set. The object is expected to either be null or of type Number or Date.

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

Overrides:
addElement in class NFVector
Parameters:
data - Object

addElement

public void addElement(java.lang.Object[] data)
Add a object array to the set. The values within the object array are expected to either be null or of type Number or Date.

If the array contains a value that is not a valid data item an IllegalArgumentException will be thrown.

Overrides:
addElement in class NFVector
Parameters:
data - Object

setElementAt

public void setElementAt(java.lang.Object data,
                         int index)
Set the object into the vector. The object is expected to either be null or of type Number or Date.

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

Overrides:
setElementAt in class NFVector
Parameters:
data - object to add
index - Row index to put the object.

setElementAt

public void setElementAt(java.lang.Object[] data,
                         int index)
Set the object array into the vector. The values within the object array are expected to either be null or of type Number or Date.

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

Parameters:
data - object to add
index - Row index to put the object.

getModifiedAppearance

public boolean getModifiedAppearance()
Returns if the appearance of this dataset has changed in this set.
Returns:
true if the appearance has changed.

getModifiedValueLabel

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

setSymbol

public void setSymbol(NFBarSymbol barSymbol)
Sets the bar symbol for all bars in this set.
Parameters:
barSymbol - Bar symbol for this barset.

getSymbol

public NFBarSymbol getSymbol()
Gets the bar symbol for all bars in this set.
Returns:
bar symbol for this barset or null if not defined.

setBarStyle

public void setBarStyle(int barStyle)
Sets the display style for all bars in this set.

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

Parameters:
barStyle - One of BAR, TRIANGLEBAR, DIAMONDBAR, CYLINDER, PIEVERTICAL, PIEHORIZONTAL.

getBarStyle

public int getBarStyle()
Gets the display style for all bars in this set.
Returns:
barStyle One of BAR, TRIANGLEBAR, DIAMONDBAR, CYLINDER, PIEVERTICAL, PIEHORIZONTAL or BAR if not set.

setColor

public void setColor(java.awt.Color barColor)
Sets the color for all bars in this set. If set to null, and this is the only set in the chart, each bar in the set will have a unique color supplied by the chart's ColorTable. If there are multiple sets in the chart, each set with barColor=null will get a unique color supplied by the chart's ColorTable.
Parameters:
barColor - The color for this set's bars.

setColorTable

public void setColorTable(NFColorTable colorTable)
Sets the individual color for each bar in this set. The colorTable overrides the color set by setColor(Color). If unset or set to null, the behavior specified in the setColor(Color) method applies.
Parameters:
colorTable - the colors to use for the bars in the set

getColor

public java.awt.Color getColor()
Gets the color for all bars in this set. If set to null, and this is the only set in the chart, each bar in the set will have a unique color supplied by the chart's ColorTable. If there are multiple sets in the chart, each set with barColor=null will get a unique color supplied by the chart's ColorTable.
Returns:
the color for this set's bars 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.

setFillPattern

public void setFillPattern(NFFillPattern fillPattern)
Sets the fill pattern for all bars in this set.
Parameters:
fillPattern - Fill pattern for this barset.

getFillPattern

public NFFillPattern getFillPattern()
Gets the fill pattern for all bars in this set.
Returns:
fill pattern for this barset or null if not defined.

setGroupStackFillPatterns

public void setGroupStackFillPatterns(NFVector groupStackFillPatterns)
Sets the fill patterns for a GROUPSTACK bar chart.

If the vector contains elements that are not NFFillPattern objects, an IllegalArgumentException will be thrown.

Parameters:
groupStackFillPatterns - Vector of NFFillPattern

getGroupStackFillPatterns

public NFVector getGroupStackFillPatterns()
Returns the fill patterns for a GROUPSTACK bar chart.
Returns:
the vector of NFFillPattern objects.

setBarValueLabelStyle

public void setBarValueLabelStyle(int barValueLabelStyle)
Sets the type of text labeling for bars in this set.

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

Parameters:
barValueLabelStyle - One of NONE, EXTERNAL, TOP, MIDDLE, BOTTOM.

getBarValueLabelStyle

public int getBarValueLabelStyle()
Gets the type of text labeling for bars in this set
Returns:
barValueLabelStyle One of NONE, EXTERNAL, TOP, MIDDLE, BOTTOM or NONE if not set.

setLegendName

public void setLegendName(java.lang.String legendName)
Set the legend name of the set
Parameters:
legendName - Name of the set to use.

getLegendName

public java.lang.String getLegendName()
Returns the legend name
Returns:
the legend set name 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", barColor, barStyle)

setCDLAppearance

public void setCDLAppearance(java.lang.String s)
Configures the appearance information from a CDL parameter representation.
Parameters:
s - CDL in the form: ("legendName", barColor, barStyle)

getCDLBarValueLabelStyle

public java.lang.String getCDLBarValueLabelStyle()
Get the bar value label style for the set from a CDL string.
Returns:
cdl

setCDLBarValueLabelStyle

public void setCDLBarValueLabelStyle(java.lang.String cdl)
Set the bar value label style for the set from a CDL string.
Parameters:
cdl -  

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 - 2006
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 14, 2006