Class EDU.emporia.mathbeans.MathTable
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class EDU.emporia.mathbeans.MathTable

Object
   |
   +----Component
           |
           +----Container
                   |
                   +----JComponent
                           |
                           +----JScrollPane
                                   |
                                   +----EDU.emporia.mathbeans.MathTable

public class MathTable
extends JScrollPane
MathTable creates a table designed to allow the user to create a list of 2-dimensional points.

Version:
1.0
Author:
Joe Yanik
Since:
7/3/00

Variable Index

 o xLabel
The label that will be displayed at the top of the first column
 o yLabel
The label that will be displayed at the top of the second column

Constructor Index

 o EDU.emporia.mathbeans.MathTable()

Method Index

 o addPoint(Point2D.Double)
Adds a point to the table
 o addPoints(Point2D.Double[])
Adds an array of points to the table
 o adjustTable()
Sets up the table so that the columns will fit properly.
 o clearTable()
Clears out all data from the table.
 o getPoints()
Returns the data entered into the table in the form of points
 o getXLabel()
Gets the label that is displayed at the top of the first column
 o getYLabel()
Gets the label to be displayed at the top of the second column.
 o main(String[])
 o removePoint(Point2D.Double)
Removes the point.
 o removePoint(double, double)
Removes the point with indicated coordinates from the table (if it is there)
 o setBounds(int, int, int, int)
Overridden to adjust the column size whenever it is called
 o setBounds(Rectangle)
Overridded to adjust the column size when it is called
 o setSize(int, int)
Overridden to adjust the column size when it is called
 o setSize(Dimension)
Overridden to adjust the column size when it is called
 o setXLabel(String)
Sets the label that will be displayed at the top of the first column
 o setYLabel(String)
Sets the label that will appear at the top of the second column.

Variables

 o xLabel
protected java.lang.String xLabel
The label that will be displayed at the top of the first column

 o yLabel
protected java.lang.String yLabel
The label that will be displayed at the top of the second column

Constructors

 o MathTable
public MathTable()

Methods

 o addPoint
public void addPoint(EDU.emporia.mathtools.Point2D.Double p)
Adds a point to the table

Parameters:
p - The point to be added
 o addPoints
public void addPoints(EDU.emporia.mathtools.Point2D.Double[] pointArray)
Adds an array of points to the table

Parameters:
pointArray - The array to be added
 o adjustTable
public void adjustTable()
Sets up the table so that the columns will fit properly.

 o clearTable
public void clearTable()
Clears out all data from the table.

 o getPoints
public EDU.emporia.mathtools.Point2D.Double[] getPoints()
Returns the data entered into the table in the form of points

Returns:
An array of Point2D.Double objects corresponding to the data that has been entered in.
 o getXLabel
public java.lang.String getXLabel()
Gets the label that is displayed at the top of the first column

 o getYLabel
public java.lang.String getYLabel()
Gets the label to be displayed at the top of the second column.

 o main
public static void main(String[] argv)
 o removePoint
public void removePoint(EDU.emporia.mathtools.Point2D.Double p)
Removes the point. (Uses the "equals" method to determine the point that matches)

Parameters:
p - The point to be removed
 o removePoint
public void removePoint(double x,
                        double y)
Removes the point with indicated coordinates from the table (if it is there)

Parameters:
x - The x-coordinate of the point to be removed
y - The y-coorindate of the point to be removed.
 o setBounds
public void setBounds(int x,
                      int y,
                      int width,
                      int height)
Overridden to adjust the column size whenever it is called

Overrides:
setBounds in class Component
 o setBounds
public void setBounds(Rectangle a)
Overridded to adjust the column size when it is called

Overrides:
setBounds in class Component
 o setSize
public void setSize(int width,
                    int height)
Overridden to adjust the column size when it is called

Overrides:
setSize in class Component
 o setSize
public void setSize(Dimension a)
Overridden to adjust the column size when it is called

Overrides:
setSize in class Component
 o setXLabel
public void setXLabel(String xLabel)
Sets the label that will be displayed at the top of the first column

Parameters:
xLabel - The label to be displayed
 o setYLabel
public void setYLabel(String yLabel)
Sets the label that will appear at the top of the second column.

Parameters:
yLabel - The label to be displayed

All Packages  Class Hierarchy  This Package  Previous  Next  Index