org.ujac.chart
Class ChartFactory

java.lang.Object
  extended by org.ujac.chart.ChartFactory

public class ChartFactory
extends Object

Name: PieChart2D
Description: A class rendering 2D pie charts.

Author:
lauerc

Constructor Summary
ChartFactory()
           
 
Method Summary
static Chart createChart(String type)
          Creates a chart instance.
static Chart createChart(String type, ChartModel model, ChartAttributes attributes)
          Creates a chart instance.
static void registerChart(String name, Class clazz)
          Registers the given chart class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChartFactory

public ChartFactory()
Method Detail

registerChart

public static final void registerChart(String name,
                                       Class clazz)
Registers the given chart class.

Parameters:
name - The chart's name.
clazz - The chart class to register.

createChart

public static Chart createChart(String type)
                         throws ChartException
Creates a chart instance.

Parameters:
type - The name of the chart type to instanciate.
Returns:
The created chart, or null if the chart type is not registered.
Throws:
ChartException - In case the chart construction or configuration failed.

createChart

public static Chart createChart(String type,
                                ChartModel model,
                                ChartAttributes attributes)
                         throws ChartException
Creates a chart instance.

Parameters:
type - The name of the chart type to instanciate.
model - The chart model.
attributes - The chart attributes.
Returns:
The created chart, or null if the chart type is not registered.
Throws:
ChartException - In case the chart construction or configuration failed.


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