DataAxisProperties dataAxisProperties,
AxisChartDataProcessor axisChartDataProcessor,
FontRenderContext fontRenderContext )
{
//---we know this is of this type
ScatterPlotDataProcessor scatterPlotDataProcessor= (ScatterPlotDataProcessor) axisChartDataProcessor;
if( dataAxisProperties.getScaleCalculator() == null )
{
ScaleCalculator s;
if( dataAxisProperties.hasUserDefinedScale() )
{
s = new UserDefinedScaleCalculator( dataAxisProperties.getUserDefinedMinimumValue(), dataAxisProperties.getUserDefinedIncrement() );
}
else
{
s = new AutomaticScaleCalculator();
if( axis instanceof XAxis )
{
s.setMaxValue( scatterPlotDataProcessor.getMaxValue() );
s.setMinValue( scatterPlotDataProcessor.getMinValue() );
}
else
{
s.setMaxValue( scatterPlotDataProcessor.getyMax() );
s.setMinValue( scatterPlotDataProcessor.getyMin() );
}
}
axis.setScaleCalculator( s );
}
else
{
axis.setScaleCalculator( dataAxisProperties.getScaleCalculator() );
if( axis instanceof XAxis )
{
axis.getScaleCalculator().setMaxValue( scatterPlotDataProcessor.getMaxValue() );
axis.getScaleCalculator().setMinValue( scatterPlotDataProcessor.getMinValue() );
}
else
{
axis.getScaleCalculator().setMaxValue( scatterPlotDataProcessor.getyMax() );
axis.getScaleCalculator().setMinValue( scatterPlotDataProcessor.getyMin() );
}
}
axis.getScaleCalculator().setRoundingPowerOfTen( dataAxisProperties.getRoundToNearest() );
axis.getScaleCalculator().setNumberOfScaleItems( dataAxisProperties.getNumItems() );