com.approximatrix.charting.model
Class DefaultChartDataModelConstraints

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

public class DefaultChartDataModelConstraints
extends java.lang.Object
implements ChartDataModelConstraints

Implementing the ChartDataModelConstraints this class provides the default implementation for the data model constraints. Alternative implementations could return the sum of all column values to implement stacked bar charts e.g.

Author:
smueller armstrong

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
DefaultChartDataModelConstraints(AbstractChartDataModel model, int axis)
          Creates a new instance of DefaultChartDataModelConstraints
DefaultChartDataModelConstraints(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 getMinimumY()
 java.lang.Number getMaximumX()
          Returns the maximum xvalue of all datasets.
 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 xvalue of all datasets.
 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

DefaultChartDataModelConstraints

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


DefaultChartDataModelConstraints

public DefaultChartDataModelConstraints(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 getMinimumY()

Returns the maximum value of all datasets.

Specified by:
getMaximumValue in interface ChartDataModelConstraints
Returns:
a Number object defining 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:
a Number object defining the smallest value.

getMinimumY

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

Specified by:
getMinimumY in interface ChartDataModelConstraints
Returns:
the minimum 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 xvalue of all datasets.

Specified by:
getMinimumX in interface ChartDataModelConstraints
Returns:
the minimum x value

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 xvalue of all datasets.

Specified by:
getMaximumX in interface ChartDataModelConstraints
Returns:
the maximum x value