cox.jmatt.java.MathTools.graphing.Graph
Class GraphPaperPDK
java.lang.Object
cox.jmatt.java.MathTools.graphing.noop.NORenderable
cox.jmatt.java.MathTools.graphing.noop.NOGraphPaper
cox.jmatt.java.MathTools.graphing.Graph.GraphPaperPDK
- All Implemented Interfaces:
- GraphPaper, Renderable
public class GraphPaperPDK
- extends NOGraphPaper
- implements GraphPaper
This is the main do-it class for the Graph implementation. It includes everything needed for a .grf file except the graph, and that is handled by the
GraphablePDK
class. All other Renderable
classes are no-op versions.
Method Summary |
boolean |
addGraph(java.lang.String pKey,
Graphable pGraph)
Add a graph to the paper. |
java.lang.Object |
render(java.lang.Object pContext)
Render the graph. |
boolean |
setRanges(double xMin,
double yMin,
double xMax,
double yMax)
This method sets the range values for the resulting graph. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
GraphPaperPDK
public GraphPaperPDK()
- Standard constructor. Builds an instance with everything needed to graph but the graph.
addGraph
public boolean addGraph(java.lang.String pKey,
Graphable pGraph)
- Add a graph to the paper. The 'pKey' parameter is not used and is ignored. If pGraph is null this method returns false immediately, otherwise it returns true.
- Specified by:
addGraph
in interface GraphPaper
- Overrides:
addGraph
in class NOGraphPaper
- 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.
setRanges
public boolean setRanges(double xMin,
double yMin,
double xMax,
double yMax)
- This method sets the range values for the resulting graph. If the minimum values are not less than the maxima the method returns false immediately.
- Specified by:
setRanges
in interface GraphPaper
- Overrides:
setRanges
in class NOGraphPaper
- Parameters:
xMin
- The minimum horizontal (X) value on the graph.yMin
- The minimum vertical (Y) value for the graph.xMax
- The maximum horizontal value for the graph.yMax
- The maximum vertical (Y) value on the graph.
- Returns:
- true if the implementation can support these settings, false otherwise.
render
public java.lang.Object render(java.lang.Object pContext)
- Render the graph. The result of a call to this method will be a properly-formatted String ready to be saved in a .grf file. The rendering context
Object is a
GraphKeysPDK
instance but if one is not furnished it will be handled automatically.
- Specified by:
render
in interface Renderable
- Overrides:
render
in class NORenderable
- Parameters:
pContext
- The Context Object to be used for rendering.
- Returns:
- The graph-ready Object, requiring no further MathTools interaction.