com.approximatrix.charting
Class ExtendedChart

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

public class ExtendedChart
extends AbstractChart


Field Summary
static int LINEAR_X_LINEAR_Y
          Constant to specify a linear xy coordinate system during chart construction
static int NO_COORDINATE_SYSTEM
          Present for future expansion
 
Fields inherited from class com.approximatrix.charting.AbstractChart
bounds, coord, legend, MISSING_LEGEND_WIDTH, MISSING_TITLE_HEIGHT, model, rcModel, renderer, title
 
Fields inherited from class com.approximatrix.charting.render.AbstractRenderer
listener
 
Constructor Summary
protected ExtendedChart()
          Creates new empty DefaultChart.
  ExtendedChart(ChartDataModel model, java.lang.String title)
          Creates a new DefaultChart with the given model and title string and no coordinate system.
  ExtendedChart(ChartDataModel model, java.lang.String title, int coord)
          Creates a new DefaultChart with the given model and title string and a coordinate system.
  ExtendedChart(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.
 void zoom(java.awt.Rectangle area)
          Zooms in on a specified rectangle area of the chart by setting the max and min values to display.
 
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 final int LINEAR_X_LINEAR_Y
Constant to specify a linear xy coordinate system during chart construction

See Also:
Constant Field Values

NO_COORDINATE_SYSTEM

public static final int NO_COORDINATE_SYSTEM
Present for future expansion

See Also:
Constant Field Values
Constructor Detail

ExtendedChart

protected ExtendedChart()
Creates new empty DefaultChart.


ExtendedChart

public ExtendedChart(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

ExtendedChart

public ExtendedChart(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

ExtendedChart

public ExtendedChart(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.

zoom

public void zoom(java.awt.Rectangle area)
Zooms in on a specified rectangle area of the chart by setting the max and min values to display. This routine will have no effect if autoscaling is enabled. The area to zoom to is specified in terms of the graphics coordinates (the transform to data coordinates is performed here).

Parameters:
area - A Rectangle specifying the area in graphics coordinates to zoom