|
JClass DesktopViews 6.3.0 API Documentation |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.klg.jclass.chart3d.event.Chart3dDataSupport | +--com.klg.jclass.chart3d.data.Base3dDataSource | +--com.klg.jclass.chart3d.data.Base3dGridDataSource | +--com.klg.jclass.chart3d.data.JCDefault3dGridDataSource | +--com.klg.jclass.chart3d.data.JCXML3dDataSource
This class parses data from an XML file.
Specification for the xml data can be found in
the chart3d.dtd
file.
An example XML file would have the following appearance:
<?xml version="1.0"?>
<!DOCTYPE data SYSTEM "chart3d.dtd">
<data hole="-100" name="my data">
<xgrid>
<xval>0.78</xval>
<xval>1.565</xval>
<xval>2.00</xval>
</xgrid>
<ygrid>
<yval>1.00</yval>
<yval>2.0</yval>
<yval>3.0</yval>
<yval>4.0</yval>
<yval>5.0</yval>
</ygrid>
<zgrid>
<zval>15.64</zval>
<zval>23.4546</zval>
<zval>45.4545</zval>
<zval>20.4546</zval>
<zval>14.4545</zval>
</zgrid>
<zgrid>
<zval>18.5656</zval>
<zval>23.884</zval>
<zval>35.6454</zval>
<zval>21.47</zval>
<zval>37.45</zval>
</zgrid>
<zgrid>
<zval>16.58</zval>
<zval>10.5656</zval>
<zval>17.65</zval>
<zval>19.645</zval>
<zval>34.4561</zval>
</zgrid>
<xlabel>January</xlabel>
<xlabel>February</xlabel>
<xlabel>March</xlabel>
<ylabel>Orcs</ylabel>
<ylabel>Zombies</ylabel>
<ylabel>Skeletons</ylabel>
<ylabel>Vampires</ylabel>
<ylabel>Werewolves</ylabel>
</data>
Field Summary | |
static String |
XML_DS_ATT_HOLE
Static string for hole attribute of top level tag in the chart XML datasource. |
static String |
XML_DS_ATT_NAME
Static string for datasource name of chart XML datasource. |
static String |
XML_DS_XDATA
Static string for x data tag of chart XML datasource. |
static String |
XML_DS_XLABEL
Static string for x Labels of chart XML datasource. |
static String |
XML_DS_YDATA
Static string for y data tag of chart XML datasource. |
static String |
XML_DS_YLABEL
Static string for series label tag of chart XML datasource. |
static String |
XML_DS_ZGRID
Static string for z grid tag of chart XML datasource. |
static String |
XML_DS_ZVAL
Static string for z data tag of chart XML datasource. |
Fields inherited from class com.klg.jclass.chart3d.data.Base3dGridDataSource |
chartDataListeners, dataSourceName, xGrid, xLabels, yGrid, yLabels, zValues |
Fields inherited from class com.klg.jclass.chart3d.data.Base3dDataSource |
holeValue |
Fields inherited from class com.klg.jclass.chart3d.event.Chart3dDataSupport |
source |
Fields inherited from interface com.klg.jclass.chart3d.HoleValueChart3dDataModel |
DEFAULT_HOLE_VALUE |
Constructor Summary | |
JCXML3dDataSource(File xmlFile)
This constructor takes an xml file as an argument. |
|
JCXML3dDataSource(InputSource inSource)
This constructor takes an InputSource
. |
|
JCXML3dDataSource(InputStream inStream)
This constructor takes an InputStream in XML form. |
|
JCXML3dDataSource(Reader reader)
This constructor takes a Reader which contains xml. |
|
JCXML3dDataSource(String xmlString)
This constructor takes xml in String form . |
Method Summary | |
protected double |
convertDoubleValue(String toConvert)
Convenience method to convert a String to a double . |
DocumentBuilder |
getDocBuilder()
Creates a DocumentBuilder object which parses the XML into a Document object, which can then be parsed into a Chart3d dataSource. |
protected void |
parseDoc(Document doc)
This is the workhorse of this class which parses the document . |
protected double[] |
parseDoubles(NodeList dat)
Convenience method for pulling double[] out of
NodeLists . |
protected String[] |
parseLabels(NodeList labs)
Convenience method for pulling String[] out of
NodeLists This method assumes that the NodeList
contains bottom-level Elements which contain text. |
Methods inherited from class com.klg.jclass.chart3d.data.JCDefault3dGridDataSource |
getXGridSize, getYGridSize, getZArray, setZArray |
Methods inherited from class com.klg.jclass.chart3d.data.Base3dGridDataSource |
clone, getDataSourceName, getNumX, getNumY, getXGrid, getXLabels, getYGrid, getYLabels, getZValues, setDataSourceName, setXGrid, setXLabels, setYGrid, setYLabels, setZValues |
Methods inherited from class com.klg.jclass.chart3d.data.Base3dDataSource |
getHoleValue, setHoleValue |
Methods inherited from class com.klg.jclass.chart3d.event.Chart3dDataSupport |
addChart3dDataListener, fireChart3dDataEvent, fireChart3dDataEvent, removeChart3dDataListener |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String XML_DS_ATT_HOLE
public static final String XML_DS_ATT_NAME
public static final String XML_DS_XLABEL
public static final String XML_DS_YLABEL
public static final String XML_DS_XDATA
public static final String XML_DS_YDATA
public static final String XML_DS_ZGRID
public static final String XML_DS_ZVAL
Constructor Detail |
public JCXML3dDataSource(String xmlString)
xmlString
- String containing xml datapublic JCXML3dDataSource(InputStream inStream)
InputStream
in XML form.
inStream
- an xml InputStreampublic JCXML3dDataSource(Reader reader)
Reader
which contains xml.
reader
- a Reader objectpublic JCXML3dDataSource(InputSource inSource)
InputSource
.
inSource
- InputSourcepublic JCXML3dDataSource(File xmlFile)
xmlFile
- The xml file objectMethod Detail |
public DocumentBuilder getDocBuilder()
protected void parseDoc(Document doc)
doc
- The document object created from the xml file.protected double[] parseDoubles(NodeList dat)
double[]
out of
NodeLists
. This method assumes that the NodeList
contains bottom-level Elements which only contain doubles.
dat
- The NodeList
we want returned as an array of
doubles
protected double convertDoubleValue(String toConvert)
toConvert
- the String we wish made double
protected String[] parseLabels(NodeList labs)
String[]
out of
NodeLists
This method assumes that the NodeList
contains bottom-level Elements which contain text.
labs
- The NodeList
we want returned as an array of
Strings
|
Copyright © 2004 Quest Software Inc.. All rights reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |