becker.xtras.grapher
Class GrapherGUI

java.lang.Object
  extended by becker.xtras.grapher.GrapherGUI

public class GrapherGUI
extends Object

GrapherGUI provides a user interface for graphing mathematical functions when supplied with an instance of a student-written class implementing one of the three interfaces IFunction, IQuadraticFunction and IPolynomialFunction.

Please see the package description for a more in-depth discussion of using this class.

Author:
Byron Weber Becker
See Also:
IFunction, IQuadraticFunction, IPolynomialFunction

Constructor Summary
GrapherGUI(IFunction f)
          Construct a GUI for an object implementing the Function interface.
GrapherGUI(IPolynomialFunction f)
          Construct a GUI for an object implementing the PolynomialFunction interface.
GrapherGUI(IQuadraticFunction f)
          Construct a GUI for an object implementing the QuadraticFunction interface.
 
Method Summary
 void setLocation(int x, int y)
          Set the location of the graphing window relative to the top-left corner of the screen.
 void setSize(int width, int height)
          Set the size of the graphing window.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GrapherGUI

public GrapherGUI(IFunction f)
Construct a GUI for an object implementing the Function interface.

Parameters:
f - the object with the function to be graphed.

GrapherGUI

public GrapherGUI(IQuadraticFunction f)
Construct a GUI for an object implementing the QuadraticFunction interface.

Parameters:
f - the object with the function to be graphed.

GrapherGUI

public GrapherGUI(IPolynomialFunction f)
Construct a GUI for an object implementing the PolynomialFunction interface.

Parameters:
f - the object with the function to be graphed.
Method Detail

setSize

public void setSize(int width,
                    int height)
Set the size of the graphing window.

Parameters:
width - the width of the window
height - the height of the window

setLocation

public void setLocation(int x,
                        int y)
Set the location of the graphing window relative to the top-left corner of the screen.

Parameters:
x - the x-coordinate of the new location's top-left corner
y - the y-coordinate of the new location's top-left corner