cox.jmatt.java.MathTools.graphing
Class GraphEngineFactory

java.lang.Object
  extended by cox.jmatt.java.MathTools.graphing.GraphEngineFactory

public class GraphEngineFactory
extends java.lang.Object

This is the only concrete class in the graphing.* package that is absolutely required. Its purpose is to create GraphEngines for specific implementations. Doing so requires the fully-qualified name of the GraphEngine desired and, of course, access to it. Access requires that the implementation be 'visible' to GraphEngineFactory, either by being in the ClassPath OR by being in CapCom's ClassLoader. GraphEngineFactory can be instructed to use it via the useMathClassLoader() method.

This class is also able to provide RenderEngines and Constraint instances. These classes, while useful, are NOT absolutely mandatory for constructing graphs!


Field Summary
static java.lang.String GRAPH_ENGINE
          String constant for constructing a graphing.Graph.GraphEnginePDK instance.
static java.lang.String NO_ENGINE
          String constant for a no-op or 'null' GraphEngine.
static java.lang.String XML_ENGINE
          String constant for constructing a graphing.xml.GraphEngineXML instance.
 
Method Summary
 Constraint getConstraint(java.lang.String pRequirement, java.lang.Object pValue)
          Create and return a new Constraint with the given requirement and value Object.
 GraphEngine getGraphEngine(java.lang.String pEngineName)
          Create and return a new GraphEngine tuned to a specific implementation.
 RenderEngine getRenderEngine()
          Create and return a RenderEngine.
static GraphEngineFactory newInstance()
          Use this method to obtain an instance of GraphEngineFactory.
 void reset()
          Clear all previous settings including the ClassLoader.
 void setMathClassLoader(boolean pEnable)
          Call this method to enable or disable CapCom's ClassLoader to find GraphEngine instances.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

XML_ENGINE

public static final java.lang.String XML_ENGINE
String constant for constructing a graphing.xml.GraphEngineXML instance.

See Also:
Constant Field Values

GRAPH_ENGINE

public static final java.lang.String GRAPH_ENGINE
String constant for constructing a graphing.Graph.GraphEnginePDK instance.

See Also:
Constant Field Values

NO_ENGINE

public static final java.lang.String NO_ENGINE
String constant for a no-op or 'null' GraphEngine.

See Also:
Constant Field Values
Method Detail

newInstance

public static GraphEngineFactory newInstance()
Use this method to obtain an instance of GraphEngineFactory.


setMathClassLoader

public void setMathClassLoader(boolean pEnable)
Call this method to enable or disable CapCom's ClassLoader to find GraphEngine instances.

Parameters:
pEnable - true to set the MathClassLoader, false to clear it.

reset

public void reset()
Clear all previous settings including the ClassLoader.


getGraphEngine

public GraphEngine getGraphEngine(java.lang.String pEngineName)
Create and return a new GraphEngine tuned to a specific implementation. The fully-qualified class name must be used, and the class itself must be visible in order to be created. To use an implementation from an external JAR, point ScriptPanel's URLClassLoader to it and enable it. If no ClassLoader is set GraphEngineFactory uses the ClassLoader that created it.

Parameters:
pEngineName - The full class name of the desired GraphEngine. If blank or empty this method returns null.

getRenderEngine

public RenderEngine getRenderEngine()
Create and return a RenderEngine.


getConstraint

public Constraint getConstraint(java.lang.String pRequirement,
                                java.lang.Object pValue)
Create and return a new Constraint with the given requirement and value Object.

Parameters:
pRequirement - The String designation of the desired Requirement.
pValue - The value Object.
Returns:
A fresh new Constraint.