NetCharts Pro

netcharts.pro.charts.multipie
Class NFSliceSet

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.charts.multipie.NFSliceSet
All Implemented Interfaces:
java.lang.Cloneable

public class NFSliceSet
extends NFBaseSet

An NFSliceSet 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:

        NFMultiPiechart chart = new NFMultiPiechart();
        NFSliceSet sliceSet = new NFSliceSet("name", Color.red, "ON");
        for (int i=0; i < 20; i++)
                sliceSet.addElement(i);

        chart.addSet(sliceSet);
 


Constructor Summary
NFSliceSet()
          Constructs a default slice set.
NFSliceSet(java.awt.Color color)
          Constructs a slice set with the given color.
NFSliceSet(java.lang.String legendName, java.awt.Color color)
          Constructs a set with the given legend name and color.
NFSliceSet(java.lang.String legendName, java.awt.Color color, boolean showSliceLabel)
          Constructs a set with the legend name, color and show label flag.
 
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 an object to the set.
 void addElement(java.lang.Object[] data)
          Add an object array to the set.
 java.lang.Object clone()
          Does a deep copy of this object
 java.lang.String getCDLAppearance()
          Generate the CDL that creates the appearance information.
 java.awt.Color getColor()
          Returns the color for all slices in this set.
 java.lang.String getLegendName()
          Returns the legend name of the set.
 boolean getModifiedAppearance()
          Returns a flag indicating if the appearance of this set has changed.
 boolean getShowSliceLabel()
          Returns whether the slice label is to be displayed.
 NFVector getSlicePositions()
          Returns the slice positions for this set.
 void setCDLAppearance(java.lang.String s)
          Configures the appearance information from a CDL parameter representation.
 void setColor(java.awt.Color color)
          Sets the color for all slices 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 setLegendName(java.lang.String legendName)
          Set the legend name of the set.
 void setShowSliceLabel(boolean showSliceLabel)
          Sets whether the slice label is to be displayed.
 void setSlicePositions(NFVector slicePositions)
          Sets the slice positions for this set.
 
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, isEmptyStringAsNull, loadDataModel, loadDataModel, loadDataModel, removeElementAt, reset, setCDL, setCDLHasTuples, setCDLNullString, 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

NFSliceSet

public NFSliceSet()
Constructs a default slice set.


NFSliceSet

public NFSliceSet(java.awt.Color color)
Constructs a slice set with the given color.

Parameters:
color - The color of all slices in this set.

NFSliceSet

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

Parameters:
legendName - The name that will appear in the legend for this set. Also used to label the slices in this set.
color - The color of all slices in this set.

NFSliceSet

public NFSliceSet(java.lang.String legendName,
                  java.awt.Color color,
                  boolean showSliceLabel)
Constructs a set with the legend name, color and show label flag.

Parameters:
legendName - The name that will appear in the legend for this set. Also used to label the slices in this set.
color - The color of all slices in this set.
param - Indicates if the slice label is to be displayed.
Method Detail

setLegendName

public void setLegendName(java.lang.String legendName)
Set the legend name of the set. Also used to label the slices in this set.

Parameters:
legendName - The name that will appear in the legend for this set and also used to label the slices.

getLegendName

public java.lang.String getLegendName()
Returns the legend name of the set.

Returns:
the legend set name or null if not defined.

setColor

public void setColor(java.awt.Color color)
Sets the color for all slices in this set. If set to null, then the color for this set will be a unique color supplied by the chart's ColorTable.

Parameters:
color - Color of all slices in the set.

getColor

public java.awt.Color getColor()
Returns the color for all slices in this set. If set to null, then the color for this set will be a unique color supplied by the chart's ColorTable.

Returns:
the color of all slices in the set.

setShowSliceLabel

public void setShowSliceLabel(boolean showSliceLabel)
Sets whether the slice label is to be displayed.

Parameters:
showSliceLabel - If true, the slice label is displayed.

getShowSliceLabel

public boolean getShowSliceLabel()
Returns whether the slice label is to be displayed.

Returns:
true if the slice label is to be displayed, false if not. Returns true if not set.

setSlicePositions

public void setSlicePositions(NFVector slicePositions)
Sets the slice positions for this set.

If the NFVector contains elements that are not numeric values, than an IllegalArgumentException will be thrown.

Parameters:
slicePositions - An NFVector of numeric values corresponding to each slice position for this set.

getSlicePositions

public NFVector getSlicePositions()
Returns the slice positions for this set.

Returns:
An NFVector of numeric values corresponding to each slice position.

clone

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

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

addElement

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

Parameters:
intValue - data value to add

addElement

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

Parameters:
doubleValue - data value to add

addElement

public void addElement(java.lang.Object data)
Add an object to the set. The object is expected to either be null or of type Number.

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

Overrides:
addElement in class NFVector
Parameters:
data - data object

addElement

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

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 - 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.

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.

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 a flag indicating if the appearance of this set has changed.

Returns:
true if the appearance has changed.

getCDLAppearance

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

Returns:
CDL in the form: ("legendName", color, showSliceLabel)

setCDLAppearance

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

Parameters:
s - CDL in the form: ("legendName", color, showSliceLabel)

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