cox.jmatt.java.MathTools.graphing
Interface GraphPaper

All Superinterfaces:
Renderable
All Known Implementing Classes:
GraphPaperPDK, GraphPaperXML, NOGraphPaper

public interface GraphPaper
extends Renderable

GraphPaper is what brings together all the other graph components. It defines the 'surface' or 'paper' on which a graph is drawn and it provides the machinery to generate the Object which will be transformed into the final graph. This last point is critical! Once the GraphPaper render() method is called MathTools' responsibility ends. The Object returned is, as far as MathTools is concerned, the complete and final graph. No further interaction is required.

Since GraphPaper bridges the gap between the broad metaphor used by MathTools and an actual printed (or image) graph, its methods are defined more in the sense of what the final presentation will look like. Thus arguments involving such things as size and boundary values are represented as actual numbers (doubles) as opposed to generic Objects. The exact interpretation still depends on the implementation, but the values set should 'resemble closely' the concepts that are implied.

Interaction between the setSize() and setRanges() methods is not defined explicitly nor implied. Either method may be used, or both, and the result is handled 'under the hood.' Likewise, the addTransform() method is provided as an option for implementation technology capable of supporting it. The actual transformation is not defined and is specified as Object to allow maximum flexibility.


Method Summary
 boolean addAxis(java.lang.String pKey, Axis pAxis)
          Add an Axis instance to the current paper.
 boolean addGraph(java.lang.String pKey, Graphable pGraph)
          Add a graph to the current paper.
 boolean addPolygon(java.lang.String pKey, Polygon pPolygon)
          Add a polygon to the current paper.
 boolean addTransform(java.lang.Object pTransform)
          Use this method to apply a universal transformation to all of the graph components.
 boolean setRanges(double pMinX, double pMinY, double pMaxX, double pMaxY)
          Set the minimum and maximum horizontal and vertical values for the graph.
 boolean setSize(double pWidth, double pHeight)
          Set the size of the actual graph.
 
Methods inherited from interface cox.jmatt.java.MathTools.graphing.Renderable
render, setParameter, setType, testCondition
 

Method Detail

setSize

boolean setSize(double pWidth,
                double pHeight)
Set the size of the actual graph.

Parameters:
pWidth - The width of the graph.
pHeight - The height of the graph.
Returns:
true for valid settings, false otherwise.

setRanges

boolean setRanges(double pMinX,
                  double pMinY,
                  double pMaxX,
                  double pMaxY)
Set the minimum and maximum horizontal and vertical values for the graph.

Parameters:
pMinX - The minimum horizontal (X) value on the graph.
pMinY - The minimum vertical (Y) value for the graph.
pMaxX - The maximum horizontal value for the graph.
pMaxY - The maximum vertical (Y) value on the graph.
Returns:
true if the implementation can support these settings, false otherwise.

addTransform

boolean addTransform(java.lang.Object pTransform)
Use this method to apply a universal transformation to all of the graph components. Exactly what this entails, or if it is even used, depend on the implementation. Implementations should keep track of the transforms applied AND the order in which they should be applied! Presumably the transform takes place during rendering but this is a suggestion, not a requirement!

Parameters:
pTransform - The transformation to apply.
Returns:
true if the transform succeeds, false otherwise.

addAxis

boolean addAxis(java.lang.String pKey,
                Axis pAxis)
Add an Axis instance to the current paper. The key is provided to allow unique identification of axes.

Parameters:
pKey - The identification or description of the Axis being added.
pAxis - The Axis to add.
Returns:
true if it happened, false otherwise.

addGraph

boolean addGraph(java.lang.String pKey,
                 Graphable pGraph)
Add a graph to the current paper. The key is provided for identification or description and its use is optional.

Parameters:
pKey - The String key used to identify the graph.
pGraph - The graph to add.
Returns:
true if all is well, false if something bad happened.

addPolygon

boolean addPolygon(java.lang.String pKey,
                   Polygon pPolygon)
Add a polygon to the current paper. The key is provided for identification or description and its use is optional.

Parameters:
pKey - The String key used to identify the polygon.
pPolygon - The Polygon to add.
Returns:
true if all is well, false if something bad happened.