org.ujac.chart
Class DefaultChartModel

java.lang.Object
  extended by org.ujac.chart.DefaultChartModel
All Implemented Interfaces:
ChartModel
Direct Known Subclasses:
RealtimeChartModel

public class DefaultChartModel
extends Object
implements ChartModel

Name: DefaultChartModel
Description: Default implementation for chart models.

Author:
lauerc

Field Summary
protected  List areaLabels
          The chart area labels.
protected  List chartData
          The chart data.
protected  double maxValue
          The maximum data value.
protected  double minValue
          The minimum data value.
protected  List segmentLabels
          The chart segment labels.
protected  TextChartItem title
          The chart's title item.
 
Constructor Summary
DefaultChartModel()
          Constructs a DefaultChartModel instance with no specific attributes.
 
Method Summary
 List getAreaLabels()
          Gets the chart area labels as a list of Strings.
 List getChartData()
          Gets the chart data as a list of double arrays.
 double getMaxValue()
          Gets the maximum value from the chartData.
 double getMinValue()
          Gets the minimum value from the chartData.
 int getNumAreas()
          Gets the number of areas.
 int getNumSegments()
          Gets the number of segments.
 List getSegmentLabels()
          Gets the chart segment labels as a list of Strings.
 TextChartItem getTitle()
          Gets the chart title.
 void setAreaLabels(List areaLabels)
          Sets the chart area labels as a list of Strings.
 void setChartData(List chartData)
          Sets the chart data as a list of double arrays.
 void setMaxValue(double maxValue)
          Sets the maximum value from the chart data.
 void setMinValue(double minValue)
          Sets the minimum value from the chart data.
 void setSegmentLabels(List segmentLabels)
          Sets the chart segment labels as a list of Strings.
 void setTitle(TextChartItem title)
          Sets the chart title.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

title

protected TextChartItem title
The chart's title item.


chartData

protected List chartData
The chart data.


areaLabels

protected List areaLabels
The chart area labels.


segmentLabels

protected List segmentLabels
The chart segment labels.


minValue

protected double minValue
The minimum data value.


maxValue

protected double maxValue
The maximum data value.

Constructor Detail

DefaultChartModel

public DefaultChartModel()
Constructs a DefaultChartModel instance with no specific attributes.

Method Detail

getTitle

public TextChartItem getTitle()
Description copied from interface: ChartModel
Gets the chart title.

Specified by:
getTitle in interface ChartModel
Returns:
The chart's title item.
See Also:
ChartModel.getTitle()

setTitle

public void setTitle(TextChartItem title)
Description copied from interface: ChartModel
Sets the chart title.

Specified by:
setTitle in interface ChartModel
Parameters:
title - The title item for the chart.
See Also:
ChartModel.setTitle(org.ujac.chart.TextChartItem)

getChartData

public List getChartData()
Description copied from interface: ChartModel
Gets the chart data as a list of double arrays.

Specified by:
getChartData in interface ChartModel
Returns:
A list of double arrays.
See Also:
ChartModel.getChartData()

setChartData

public void setChartData(List chartData)
Description copied from interface: ChartModel
Sets the chart data as a list of double arrays.

Specified by:
setChartData in interface ChartModel
Parameters:
chartData - A list of double arrays.
See Also:
ChartModel.setChartData(java.util.List)

getAreaLabels

public List getAreaLabels()
Gets the chart area labels as a list of Strings.

Specified by:
getAreaLabels in interface ChartModel
Returns:
A list of Strings.

setAreaLabels

public void setAreaLabels(List areaLabels)
Sets the chart area labels as a list of Strings.

Specified by:
setAreaLabels in interface ChartModel
Parameters:
areaLabels - A list of Strings.

getSegmentLabels

public List getSegmentLabels()
Gets the chart segment labels as a list of Strings.

Specified by:
getSegmentLabels in interface ChartModel
Returns:
A list of Strings.

setSegmentLabels

public void setSegmentLabels(List segmentLabels)
Sets the chart segment labels as a list of Strings.

Specified by:
setSegmentLabels in interface ChartModel
Parameters:
segmentLabels - A list of Strings.

getMinValue

public double getMinValue()
Gets the minimum value from the chartData.

Specified by:
getMinValue in interface ChartModel
Returns:
The minimum chart data value.

setMinValue

public void setMinValue(double minValue)
Sets the minimum value from the chart data.

Specified by:
setMinValue in interface ChartModel
Parameters:
minValue - The minimum chart data value.

getMaxValue

public double getMaxValue()
Gets the maximum value from the chartData.

Specified by:
getMaxValue in interface ChartModel
Returns:
The maximum chart data value.

setMaxValue

public void setMaxValue(double maxValue)
Sets the maximum value from the chart data.

Specified by:
setMaxValue in interface ChartModel
Parameters:
maxValue - The maximum chart data value.

getNumSegments

public int getNumSegments()
Gets the number of segments.

Specified by:
getNumSegments in interface ChartModel
Returns:
The number of segments.

getNumAreas

public int getNumAreas()
Gets the number of areas.

Specified by:
getNumAreas in interface ChartModel
Returns:
The number of areas (the segment lengths).


Copyright © 2003-2004 UJAC.org. All Rights Reserved.