|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectschmitzm.jfree.chart.style.ChartStyleXMLFactory<E>
public class ChartStyleXMLFactory<E extends ChartStyle>
This class defines a factory to create a chart style from XML.
Constructor Summary | |
---|---|
ChartStyleXMLFactory()
|
Method Summary | |
---|---|
static Element |
addChildToElement(Element element,
String childName)
Creates an child element with no attributes. |
static Element |
addChildToElement(Element element,
String childName,
boolean inclNullAttr,
Object... attributes)
Creates an child element and sets some attributes. |
void |
applyStyleFromXML(E chartStyle,
Element element)
Applies the chart style definition from XML (except the type and id!! |
ChartAxisStyle |
createAxisStyleFromXML(Element element)
Creates a ChartLabelStyle from XML element. |
E |
createDefaultChartStyle(String id,
ChartType type)
Creates a default style for a chart type. |
Element |
createElementFromStyle(E style,
String rootElementName)
Creates a XML Element representing the ChartStyle . |
ChartLabelStyle |
createLabelStyleFromXML(Element element)
Creates a ChartLabelStyle from XML element. |
ChartPlotStyle |
createPlotStyleFromXML(Element element)
Creates a ChartPlotStyle from XML element. |
ChartRendererStyle |
createRendererStyleFromXML(Element element)
Creates a ChartRendererStyle from XML element. |
E |
createStyleFromXML(Element element)
Reads a chart definition from XML element. |
E |
createStyleFromXML(Element element,
String id)
Reads a chart definition from XML element. |
void |
writeStyleToFile(E style,
String rootElementName,
File filePath)
Stores a ChartStyle to an XML file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ChartStyleXMLFactory()
Method Detail |
---|
public E createStyleFromXML(Element element)
element
- the XML elementfactory
- factory to create the style withpublic E createStyleFromXML(Element element, String id)
element
- the XML elementid
- the ID for the style (if null
the
ID is taken from "id" attribute)public E createDefaultChartStyle(String id, ChartType type)
id
- a (unique) ID for the styletype
- a chart typepublic void applyStyleFromXML(E chartStyle, Element element)
ChartStyle
object.
chartStyle
- an existing chart style (null
not permitted!)element
- element to read the properties from
UnsupportedOperationException
- if chartStyle
or element
is null
public ChartLabelStyle createLabelStyleFromXML(Element element)
ChartLabelStyle
from XML element.
element
- an elementpublic ChartAxisStyle createAxisStyleFromXML(Element element)
ChartLabelStyle
from XML element.
element
- an elementpublic ChartRendererStyle createRendererStyleFromXML(Element element)
ChartRendererStyle
from XML element.
element
- an elementpublic ChartPlotStyle createPlotStyleFromXML(Element element)
ChartPlotStyle
from XML element.
element
- an elementpublic void writeStyleToFile(E style, String rootElementName, File filePath) throws IOException
ChartStyle
to an XML file.
style
- style to storerootElementName
- name for the root element (if null
"ChartType" is
used)filePath
- file to store the style to
IOException
public Element createElementFromStyle(E style, String rootElementName)
Element
representing the ChartStyle
.
style
- style to create an element forrootElementName
- name for the root element (if null
"ChartStyle" is
used)public static Element addChildToElement(Element element, String childName)
element
- if not null
the new element is added as child to
this elementchildName
- name of the new child
public static Element addChildToElement(Element element, String childName, boolean inclNullAttr, Object... attributes)
element
- if not null
the new element is added as child to
this elementchildName
- name of the new childinclNullAttr
- if false
attributes with value null
are not set; if ALL attributes are null
also
the child is not created!attributes
- attribute/value pairs for the new child element
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |