com.approximatrix.charting
Class DefaultChart

java.lang.Object
  extended by com.approximatrix.charting.render.AbstractRenderer
      extended by com.approximatrix.charting.AbstractChart
          extended by com.approximatrix.charting.DefaultChart
All Implemented Interfaces:
Chart, Renderer

public class DefaultChart
extends AbstractChart

The Default class to create a chart.

Version:
1.0
Author:
mueller

Field Summary
static int LINEAR_X_LINEAR_Y
           
static int NO_COORDINATE_SYSTEM
           
 
Fields inherited from class com.approximatrix.charting.AbstractChart
bounds, coord, legend, model, rcModel, renderer, title
 
Fields inherited from class com.approximatrix.charting.render.AbstractRenderer
listener
 
Constructor Summary
protected DefaultChart()
          Creates new empty DefaultChart.
  DefaultChart(ChartDataModel model, java.lang.String title)
          Creates a new DefaultChart with the given model and title string and no coordinate system.
  DefaultChart(ChartDataModel model, java.lang.String title, int coord)
          Creates a new DefaultChart with the given model and title string and a coordinate system.
  DefaultChart(ChartDataModel model, java.lang.String title, int coord, java.lang.String xaxis, java.lang.String yaxis)
          Creates a new DefaultChart with the given model and title string and a coordinate system.
 
Method Summary
 java.awt.Dimension getPreferredSize()
          Should compute the preferred size of the Chart
 void render(java.awt.Graphics2D g)
          Does the layout of the title, legend and coordinate system and calls the render method of all those including the ChartRenderers.
 
Methods inherited from class com.approximatrix.charting.AbstractChart
addChartRenderer, getBounds, getChartDataModel, getChartRenderer, getChartRenderer, getCoordSystem, getLegend, getRowColorModel, getTitle, paintDefault, setBounds, setChartDataModel, setChartRenderer, setCoordSystem, setLegend, setRowColorModel, setTitle
 
Methods inherited from class com.approximatrix.charting.render.AbstractRenderer
addRenderChangeListener, clearRenderChangeListeners, fireRenderChangeEvent, getDirectRender, isDifferentBounds, removeRenderChangeListener, setDirectRender
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LINEAR_X_LINEAR_Y

public static int LINEAR_X_LINEAR_Y

NO_COORDINATE_SYSTEM

public static int NO_COORDINATE_SYSTEM
Constructor Detail

DefaultChart

protected DefaultChart()
Creates new empty DefaultChart.


DefaultChart

public DefaultChart(ChartDataModel model,
                    java.lang.String title)
Creates a new DefaultChart with the given model and title string and no coordinate system.

Parameters:
model - the ChartDataModel
title - the title String

DefaultChart

public DefaultChart(ChartDataModel model,
                    java.lang.String title,
                    int coord)
Creates a new DefaultChart with the given model and title string and a coordinate system.

Parameters:
model - the ChartDataModel
title - the title String
coord - the id of the coordinate system configuration

DefaultChart

public DefaultChart(ChartDataModel model,
                    java.lang.String title,
                    int coord,
                    java.lang.String xaxis,
                    java.lang.String yaxis)
Creates a new DefaultChart with the given model and title string and a coordinate system.

Parameters:
model - the ChartDataModel
title - the title String
coord - the id of the coordinate system configuration
xaxis - the x-axis' unit
yaxis - the y-axis' unit
Method Detail

getPreferredSize

public java.awt.Dimension getPreferredSize()
Should compute the preferred size of the Chart

Returns:
null

render

public void render(java.awt.Graphics2D g)
Does the layout of the title, legend and coordinate system and calls the render method of all those including the ChartRenderers.

Specified by:
render in interface Chart
Specified by:
render in interface Renderer
Overrides:
render in class AbstractChart
Parameters:
g - the Graphics2D object to paint in.