cox.jmatt.java.MathTools.graphing.xml
Class GraphEngineXML

java.lang.Object
  extended by cox.jmatt.java.MathTools.graphing.xml.GraphEngineXML
All Implemented Interfaces:
GraphEngine

public class GraphEngineXML
extends java.lang.Object
implements GraphEngine

This GraphEngine creates graphing classes that render XML output. The markup used is simplified, per other MathTools XML, and none of the tags has deeply nested children. All components returned are of the 'XML' variety: AxisXML, GrapPaperXML, etc. None of these have any non-standard methods with the exception of RenderableXML. That class has a setID() method which is used to set the necessary ID attributes on the tags it generates. This is handled automatically and transparently, so the script does not need to worry about it! The ID is set when the RenderableXML is added to its GraphPaper. The key used to add the component becomes its ID and this cannot be null or empty! (This is enforced.)

The 'name=' attribute of the tag, if it exists, is the value used when the original component was created. That is, the 'pKey' arguments in this class, which must be String, become the 'name=' attribute of the tag whenever the component is rendered. Since GraphPaper becomes the root element of the XML document it does not have or require an 'id=' attribute. Its name and type, however, can still be set.


Constructor Summary
GraphEngineXML()
          The only constructor needed.
 
Method Summary
 Axis getAxis(java.lang.Object pKey)
          Create and return an implementation-specific Axis.
 Graphable getGraph(java.lang.Object pKey)
          Create and return a Graphable suited to the implementation.
 GraphKeys getGraphKeys()
          Return an instance of the implementation's GraphKeys, or null if none such exists.
 GraphPaper getGraphPaper(java.lang.Object pKey)
          Retrieve a GraphPaper instance for the implementation.
 Polygon getPolygon(java.lang.Object pKey)
          Return a blank Polygon.
 boolean setFeature(java.lang.String pFeature, java.lang.Object pValue)
          Not used.
 boolean testFeature(java.lang.String pFeature)
          Not used.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GraphEngineXML

public GraphEngineXML()
The only constructor needed.

Method Detail

setFeature

public boolean setFeature(java.lang.String pFeature,
                          java.lang.Object pValue)
Not used. Returns false.

Specified by:
setFeature in interface GraphEngine
Parameters:
pFeature - The String name of the feature to be set.
pValue - The value the feature is to have.
Returns:
true if the feature is set, false if it does not apply or is not set for whatever reason.

testFeature

public boolean testFeature(java.lang.String pFeature)
Not used. Returns false.

Specified by:
testFeature in interface GraphEngine
Parameters:
pFeature - The name of the feature to test.
Returns:
true if the feature is set, false otherwise.

getAxis

public Axis getAxis(java.lang.Object pKey)
Description copied from interface: GraphEngine
Create and return an implementation-specific Axis.

Specified by:
getAxis in interface GraphEngine

getGraph

public Graphable getGraph(java.lang.Object pKey)
Description copied from interface: GraphEngine
Create and return a Graphable suited to the implementation.

Specified by:
getGraph in interface GraphEngine

getGraphPaper

public GraphPaper getGraphPaper(java.lang.Object pKey)
Description copied from interface: GraphEngine
Retrieve a GraphPaper instance for the implementation.

Specified by:
getGraphPaper in interface GraphEngine

getPolygon

public Polygon getPolygon(java.lang.Object pKey)
Description copied from interface: GraphEngine
Return a blank Polygon. Implementations may give new Polygons default values but this is not required.

Specified by:
getPolygon in interface GraphEngine

getGraphKeys

public GraphKeys getGraphKeys()
Description copied from interface: GraphEngine
Return an instance of the implementation's GraphKeys, or null if none such exists.

Specified by:
getGraphKeys in interface GraphEngine