|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.microstar.xml.HandlerBase ptolemy.plot.plotml.PlotBoxMLParser ptolemy.plot.plotml.PlotMLParser
public class PlotMLParser
This class constructs a plot from specifications in PlotML (Plot Markup Language), which is an XML language. This class supports extends the base class to support the subset that applies to the Plot class. It ignores unrecognized elements in the DTD. The class contains an instance of the Microstar Ælfred XML parser and implements callback methods to interpret the parsed XML. The way to use this class is to construct it with a reference to a Plot object and then call its parse() method.
Red (cxh) |
Yellow (eal) |
Field Summary | |
---|---|
protected boolean |
_connected
The default connected state. |
protected int |
_currentDataset
The current dataset number in a "dataset" element. |
protected double |
_currentPointCount
A count within the current dataset, in case no x value is given. |
Fields inherited from class ptolemy.plot.plotml.PlotBoxMLParser |
---|
_attributes, _currentCharData, _parser, _plot, PlotML_DTD_1 |
Constructor Summary | |
---|---|
protected |
PlotMLParser()
Protected constructor allows derived classes to set _plot differently. |
|
PlotMLParser(Plot plot)
Construct an parser to parse commands for the specified plot object. |
Method Summary | |
---|---|
protected void |
_addPoint(boolean connected,
java.lang.String element)
Add a point based on the current attributes. |
void |
endElement(java.lang.String elementName)
End an element. |
void |
startDocument()
Start a document. |
void |
startElement(java.lang.String elementName)
Start an element. |
Methods inherited from class ptolemy.plot.plotml.PlotBoxMLParser |
---|
_checkForNull, _currentExternalEntity, attribute, charData, endDocument, error, parse, parse, parse, resolveEntity, startExternalEntity |
Methods inherited from class com.microstar.xml.HandlerBase |
---|
doctypeDecl, endExternalEntity, ignorableWhitespace, processingInstruction |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected boolean _connected
protected int _currentDataset
protected double _currentPointCount
Constructor Detail |
---|
public PlotMLParser(Plot plot)
plot
- The plot object to which to apply the commands.protected PlotMLParser()
Method Detail |
---|
public void endElement(java.lang.String elementName) throws java.lang.Exception
endElement
in interface XmlHandler
endElement
in class PlotBoxMLParser
elementName
- The element type name.
java.lang.Exception
- If thrown by the superclass or while calling
setConnected().XmlHandler.endElement(java.lang.String)
public void startDocument()
startDocument
in interface XmlHandler
startDocument
in class PlotBoxMLParser
XmlHandler.startDocument()
public void startElement(java.lang.String elementName) throws XmlException
startElement
in interface XmlHandler
startElement
in class PlotBoxMLParser
elementName
- The element type name.
XmlException
- If the element produces an error
in constructing the model.XmlHandler.startElement(java.lang.String)
protected void _addPoint(boolean connected, java.lang.String element) throws java.lang.Exception
connected
- If true, connect to the previous point.element
- The name of the element.
java.lang.Exception
- If there is a problem adding the point.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |