All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.ibm.eou.swingchart.ChartDataAggregator

java.lang.Object
   |
   +----com.ibm.eou.swingchart.ChartDataAggregator

public class ChartDataAggregator
extends Object
implements Serializable
Use this class together with other beans, such as buttons, to create the 2D array of double values used by the Chart bean.

Each value in the array is identified by a group index and a a value index within the group. The following diagram shows how group and value indices identify segments in a stacked bar chart.

| Group1
| Value2
|
| Group1  Group2
| Value2  Value2
|
| Group1  Group2
| Value1  Value2
+---------------

To set specific values, use the following sequence of method calls:

Alternatively, you can add values or groups of values at the next spare index:

When you are using add... methods, you can roll the chart after a specified number of groups by setting on the rollActive property and specifying a group count in the rollAfter property. This property has no effect on set... methods.

Whenever a value is set or added, the bean fires a property change event. You can use this event to trigger sending the updated values to the Chart bean.

You should not mix calls to set... methods and add... methods.


Constructor Index

 o ChartDataAggregator()

Method Index

 o addGroupAndValue(double)
Add a new group at the next spare group index and adds a value at index 0 within the group.
 o addPropertyChangeListener(PropertyChangeListener)
 o addValue(double)
Add a value at the next unused index within the current group.
 o copyright()
IBM copyright
 o getGroupIndex()
Return group index.
 o getRollActive()
Return group rolling status.
 o getRollAfter()
Return number of groups to display before rolling chart.
 o getValueGrid()
Get the aggregated values as a DoubleGrid object.
 o getValueIndex()
Return value index.
 o getValues()
Get values as a 2d Array.
 o getValues(int, int)
Return a specific chart value identified by a row and column index.
 o removePropertyChangeListener(PropertyChangeListener)
 o setGroupIndex(int)
Set group index to be used by subsequent call to setValue.
 o setRollActive(boolean)
Set rolling on or off.
 o setRollAfter(int)
Set number of groups to display before rolling chart if rolling is active.
 o setValue(double)
Sets value at the group index and value index specified by previous calls to setGroupIndex and setValueIndex.
 o setValueGrid(DoubleGrid)
Sets the values as a DoubleGrid object.
 o setValueIndex(int)
Set value index to be used by subsequent call to setValue.
 o setValues(double[][])
Set values from a 2d array

 o setValues(int, int, double)
Set a single value to be displayed by the chart, identified by row and column index numbers.

Constructors

 o ChartDataAggregator
 public ChartDataAggregator()

Methods

 o addGroupAndValue
 public void addGroupAndValue(double value)
Add a new group at the next spare group index and adds a value at index 0 within the group.

Parameters:
value - Value to add
See Also:
addValue, setRollAfter
 o addPropertyChangeListener
 public void addPropertyChangeListener(PropertyChangeListener l)
 o addValue
 public void addValue(double value)
Add a value at the next unused index within the current group.

Parameters:
value - Value to add
See Also:
addGroupAndValue
 o copyright
 public static String copyright()
IBM copyright

 o getGroupIndex
 public int getGroupIndex()
Return group index.

Returns:
index Group index

See Also:
setValueIndex
 o getRollActive
 public boolean getRollActive()
Return group rolling status.

Returns:
True: roll groups active False: roll groups not active
See Also:
setRollActive
 o getRollAfter
 public int getRollAfter()
Return number of groups to display before rolling chart.

Returns:
Number of groups to display.
 o getValueGrid
 public DoubleGrid getValueGrid()
Get the aggregated values as a DoubleGrid object. This method is provided primarily for property editors. When wiring beans or using the API, use the alternative method getValues.

Returns:
com.ibm.eou.swingchart.DoubleGrid
See Also:
getValues
 o getValueIndex
 public int getValueIndex()
Return value index.

Returns:
index Value index

See Also:
setValueIndex
 o getValues
 public double[][] getValues()
Get values as a 2d Array. Use this method to return edited values to the Chart bean.

Returns:
2d array of doubles. Rows define values. Columns define groups.
 o getValues
 public double getValues(int rowIndex,
                         int columnIndex)
Return a specific chart value identified by a row and column index.

Parameters:
rowIndex - 0 based row index
columnIndex - 0 based column index
Returns:
value
 o removePropertyChangeListener
 public void removePropertyChangeListener(PropertyChangeListener l)
 o setGroupIndex
 public void setGroupIndex(int index)
Set group index to be used by subsequent call to setValue.

Parameters:
index - Group index

See Also:
setValueIndex, setValue
 o setRollActive
 public void setRollActive(boolean roll)
Set rolling on or off. Use together with setRollAfter and add... to roll previous groups off the left of the graph when a specified number of groups have been added.

Parameters:
roll - True: roll groups False: do not roll groups
See Also:
addGroupAndValue
 o setRollAfter
 public void setRollAfter(int count)
Set number of groups to display before rolling chart if rolling is active. Use this method together with setRollActive and addGroupAndValue methods.

Parameters:
count - Number of groups to display.
See Also:
setRollActive, addGroupAndValue
 o setValue
 public void setValue(double value)
Sets value at the group index and value index specified by previous calls to setGroupIndex and setValueIndex.

Parameters:
value - Value to set at group and value index
See Also:
setGroupIndex, setValueIndex
 o setValueGrid
 public void setValueGrid(DoubleGrid dg)
Sets the values as a DoubleGrid object. This method is provided primarily for property editors. When wiring beans or using the API, use the alternative method setValues.

Parameters:
dg - com.ibm.eou.swingchart.DoubleGrid
See Also:
setValues
 o setValueIndex
 public void setValueIndex(int index)
Set value index to be used by subsequent call to setValue.

Parameters:
index - Value index

See Also:
setValueIndex, setValue
 o setValues
 public void setValues(double values[][])
Set values from a 2d array

Parameters:
values - 2d array of doubles. Rows define values. Columns define groups.
 o setValues
 public void setValues(int rowIndex,
                       int columnIndex,
                       double value)
Set a single value to be displayed by the chart, identified by row and column index numbers.

If the specified row or column index is larger than the number of rows and columns in the current values array, the array is resized by inserting an appropriate number of new values initialized to 0.

Parameters:
rowIndex - 0 based row index
columnIndex - 0 based column index
value - value

All Packages  Class Hierarchy  This Package  Previous  Next  Index