com.approximatrix.charting.model
Class StackedChartDataModelConstraints

java.lang.Object
  extended by com.approximatrix.charting.model.StackedChartDataModelConstraints
All Implemented Interfaces:
ChartDataModelConstraints

public class StackedChartDataModelConstraints
extends java.lang.Object
implements ChartDataModelConstraints

Implementing the ChartDataModelConstraints this class provides an implementation for the data model constraints where the maximum value is the sum of all positive values and the minimum value is the sum of all negative values.

Author:
smueller

Field Summary
protected  boolean allowManualColScale
          A flag which determines if column values should be manually scalable.
protected  int axis
          The axis to compute the constraints.
protected  AbstractChartDataModel model
          The model for which to calculate the constraints.
 
Constructor Summary
StackedChartDataModelConstraints(AbstractChartDataModel model, int axis)
          Creates a new instance of DefaultChartDataModelConstraints
StackedChartDataModelConstraints(AbstractChartDataModel model, int axis, boolean allowManualColScale)
          Creates a new instance of DefaultChartDataModelConstraints
 
Method Summary
 double getMaximumColumnValue()
          Deprecated. As of release 1.3, replaced by getMaximumX()
 java.lang.Number getMaximumValue()
          Deprecated. As of release 1.3, replaced by getMaximumY()
 java.lang.Number getMaximumX()
          Returns the maximum x value.
 java.lang.Number getMaximumY()
          Returns the maximum value of all datasets.
 double getMinimumColumnValue()
          Deprecated. As of release 1.3, replaced by getMinimumX()
 java.lang.Number getMinimumValue()
          Deprecated. As of release 1.3, replaced by getMinimumY()
 java.lang.Number getMinimumX()
          Returns the minimum column value.
 java.lang.Number getMinimumY()
          Returns the minimum value of all datasets.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

model

protected AbstractChartDataModel model
The model for which to calculate the constraints.


axis

protected int axis
The axis to compute the constraints.


allowManualColScale

protected boolean allowManualColScale
A flag which determines if column values should be manually scalable.

Constructor Detail

StackedChartDataModelConstraints

public StackedChartDataModelConstraints(AbstractChartDataModel model,
                                        int axis)
Creates a new instance of DefaultChartDataModelConstraints


StackedChartDataModelConstraints

public StackedChartDataModelConstraints(AbstractChartDataModel model,
                                        int axis,
                                        boolean allowManualColScale)
Creates a new instance of DefaultChartDataModelConstraints

Parameters:
model - the AbstractDataModel for which constraints will be computed
axis - the y-axis which will be considered
allowManualScale - a flag which triggers if column values should be allowed to be scaled manually (default is yes)
Method Detail

getMaximumValue

public java.lang.Number getMaximumValue()
Deprecated. As of release 1.3, replaced by getMaximumY()

Returns the maximum value of all datasets.

Specified by:
getMaximumValue in interface ChartDataModelConstraints
Returns:
the maximum value

getMaximumY

public java.lang.Number getMaximumY()
Returns the maximum value of all datasets.

Specified by:
getMaximumY in interface ChartDataModelConstraints
Returns:
the maximum value

getMinimumValue

public java.lang.Number getMinimumValue()
Deprecated. As of release 1.3, replaced by getMinimumY()

Returns the minimum value of all datasets.

Specified by:
getMinimumValue in interface ChartDataModelConstraints
Returns:
the mimimum value

getMinimumY

public java.lang.Number getMinimumY()
Returns the minimum value of all datasets.

Specified by:
getMinimumY in interface ChartDataModelConstraints
Returns:
the mimimum value

getMinimumColumnValue

public double getMinimumColumnValue()
Deprecated. As of release 1.3, replaced by getMinimumX()

Returns the minimum column value.

Specified by:
getMinimumColumnValue in interface ChartDataModelConstraints
Returns:
In the case of non-numeric x-values this should be 0, in the case of numeric x-values this should nomen est omen be the smallest value.
Throws:
java.lang.ArrayIndexOutOfBoundsException - if the Model is empty

getMinimumX

public java.lang.Number getMinimumX()
Returns the minimum column value.

Specified by:
getMinimumX in interface ChartDataModelConstraints
Returns:
the minimum x value
Throws:
java.lang.ArrayIndexOutOfBoundsException - if the Model is empty

getMaximumColumnValue

public double getMaximumColumnValue()
Deprecated. As of release 1.3, replaced by getMaximumX()

Returns the maximum column value.

Specified by:
getMaximumColumnValue in interface ChartDataModelConstraints
Returns:
In the case of non-numeric x-values this should be the amount of columns - 1, in the case of numeric x-values this should nomen est omen be the smallest value.
Throws:
java.lang.ArrayIndexOutOfBoundsException - if the model is empty

getMaximumX

public java.lang.Number getMaximumX()
Returns the maximum x value.

Specified by:
getMaximumX in interface ChartDataModelConstraints
Returns:
the maximum x value
Throws:
java.lang.ArrayIndexOutOfBoundsException - if the model is empty