schmitzm.jfree.chart.style
Class ChartStyleUtil

java.lang.Object
  extended by schmitzm.jfree.chart.style.ChartStyleUtil

public class ChartStyleUtil
extends Object

This class contains static utility methods related to chart styling.

Version:
1.0
Author:
Martin Schmitz

Field Summary
static ChartStyleXMLFactory CHART_STYLE_FACTORY
          Instance of ChartStyleXMLFactory.
 
Constructor Summary
ChartStyleUtil()
           
 
Method Summary
static ChartType getChartType(String typeStr)
          Returns the chart style for a given string.
static ChartStyle readStyleFromXML(URL url, ChartStyleXMLFactory factory)
          Reads a chart definition from URL.
static ChartStyle readStyleFromXML(URL url, String id, ChartStyleXMLFactory factory)
          Reads a chart definition from URL.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CHART_STYLE_FACTORY

public static final ChartStyleXMLFactory CHART_STYLE_FACTORY
Instance of ChartStyleXMLFactory.

Constructor Detail

ChartStyleUtil

public ChartStyleUtil()
Method Detail

getChartType

public static ChartType getChartType(String typeStr)
Returns the chart style for a given string.


readStyleFromXML

public static ChartStyle readStyleFromXML(URL url,
                                          ChartStyleXMLFactory factory)
                                   throws IOException
Reads a chart definition from URL. The URL must refers to a resource which contains exactly one chart definition as root element.
The filename is taken as chart ID

Parameters:
url - refers to XML resource
Throws:
IOException

readStyleFromXML

public static ChartStyle readStyleFromXML(URL url,
                                          String id,
                                          ChartStyleXMLFactory factory)
                                   throws IOException
Reads a chart definition from URL. The URL must refers to a resource which contains exactly one chart definition as root element.

Parameters:
url - refers to XML resource
id - the ID for the style (if null the ID is taken from "id" attribute)
factory - factory to create the style with
Throws:
IOException