cox.jmatt.java.MathTools.graphing
Interface GraphEngine

All Known Implementing Classes:
GraphEnginePDK, GraphEngineXML, NOGraphEngine

public interface GraphEngine

The GraphEngine provides all the components needed to create graphs. It and the graphing components it provides are specific to the implementation they provide. When requested, GraphEngineFactory tries to provide an implementation of this interface.

Runtime configuration is provided by means of Features. Exactly what these are, aside from generic Objects with String names, depends on the implementation. By intent, setting a Feature affects in some way the graphing components that are generated. Please note: this interface does NOT extend Renderable. It is not meant to appear on a graph; rather, it generates the items that do.

the pKey argument in all of GraphEngine's get__() methods can be used as a type for multiple classes implementing the interface or it can be used as an ID. If used as a type, it may or may not interact with the Renderable setType() method. It is provided for implementations that define, say, more than one type of Graphable. The GraphEngine for such an implementation could then furnish whichever was desired based on the key sent in. NOTE: The GraphKeys class, if it exists, is assumed to be self-sufficient so no key value is supplied for its getter.


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)
          Set a feature to be used when generating graph components.
 boolean testFeature(java.lang.String pFeature)
          Test whether or not a feature is set.
 

Method Detail

getGraphPaper

GraphPaper getGraphPaper(java.lang.Object pKey)
Retrieve a GraphPaper instance for the implementation.


getAxis

Axis getAxis(java.lang.Object pKey)
Create and return an implementation-specific Axis.


getGraph

Graphable getGraph(java.lang.Object pKey)
Create and return a Graphable suited to the implementation.


getGraphKeys

GraphKeys getGraphKeys()
Return an instance of the implementation's GraphKeys, or null if none such exists.


getPolygon

Polygon getPolygon(java.lang.Object pKey)
Return a blank Polygon. Implementations may give new Polygons default values but this is not required.


setFeature

boolean setFeature(java.lang.String pFeature,
                   java.lang.Object pValue)
Set a feature to be used when generating graph components. All such features are implementation-dependent and optional. By convention, setting a feature to null should clear that feature or reset it to its default state.

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

boolean testFeature(java.lang.String pFeature)
Test whether or not a feature is set.

Parameters:
pFeature - The name of the feature to test.
Returns:
true if the feature is set, false otherwise.