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:
- setGroupIndex(groupIndexNumber)
- setValueIndex(valueIndexNumber)
- setValue(value)
Alternatively, you can add values or groups of values at the next spare index:
- addGroupAndValue(value) // Adds a new group and a value at index 0
- addValue(value) // Adds a value at the next index in the current group
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.
-
ChartDataAggregator()
-
-
addGroupAndValue(double)
- Add a new group at the next spare group index and adds a value at index 0 within the group.
-
addPropertyChangeListener(PropertyChangeListener)
-
-
addValue(double)
- Add a value at the next unused index within the current group.
-
copyright()
- IBM copyright
-
getGroupIndex()
- Return group index.
-
getRollActive()
- Return group rolling status.
-
getRollAfter()
- Return number of groups to display before rolling chart.
-
getValueGrid()
- Get the aggregated values as a DoubleGrid object.
-
getValueIndex()
- Return value index.
-
getValues()
- Get values as a 2d Array.
-
getValues(int, int)
- Return a specific chart value identified by a row and column index.
-
removePropertyChangeListener(PropertyChangeListener)
-
-
setGroupIndex(int)
- Set group index to be used by subsequent call to
setValue.
-
setRollActive(boolean)
- Set rolling on or off.
-
setRollAfter(int)
- Set number of groups to display before rolling chart if rolling
is active.
-
setValue(double)
- Sets value at the group index and value index specified by previous calls
to
setGroupIndex and setValueIndex.
-
setValueGrid(DoubleGrid)
- Sets the values as a DoubleGrid object.
-
setValueIndex(int)
- Set value index to be used by subsequent call to
setValue.
-
setValues(double[][])
- Set values from a 2d array
-
setValues(int, int, double)
- Set a single value to be displayed by the chart, identified by row and column
index numbers.
ChartDataAggregator
public ChartDataAggregator()
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
addPropertyChangeListener
public void addPropertyChangeListener(PropertyChangeListener l)
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
copyright
public static String copyright()
- IBM copyright
getGroupIndex
public int getGroupIndex()
- Return group index.
- Returns:
- index Group index
- See Also:
- setValueIndex
getRollActive
public boolean getRollActive()
- Return group rolling status.
- Returns:
- True: roll groups active False: roll groups not active
- See Also:
- setRollActive
getRollAfter
public int getRollAfter()
- Return number of groups to display before rolling chart.
- Returns:
- Number of groups to display.
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
getValueIndex
public int getValueIndex()
- Return value index.
- Returns:
- index Value index
- See Also:
- setValueIndex
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.
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
removePropertyChangeListener
public void removePropertyChangeListener(PropertyChangeListener l)
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
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
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
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
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
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
setValues
public void setValues(double values[][])
- Set values from a 2d array
- Parameters:
- values - 2d array of doubles. Rows define values. Columns define groups.
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