All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class graphing.TraceGraphWindow

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Canvas
                   |
                   +----graphing.GraphWindow
                           |
                           +----graphing.ZoomGraphWindow
                                   |
                                   +----graphing.TraceGraphWindow

public class TraceGraphWindow
extends ZoomGraphWindow
A TraceGraphWindow displays functions which carry a number of nodes (TraceGraphNodes) on their graphs. The nodes can be moved by mouse-dragging. Nodes can be added or deleted dynamically. A collection of nodes is selected by dragging the rubber band around it, and deleted with the backspace key.


Variable Index

 o dragNode
The node that is currently being dragged
 o maxNodes
The maximum number of nodes allowed in this window.
 o nodes
Each node keys the function that it is attached to in this table

Constructor Index

 o TraceGraphWindow()
 o TraceGraphWindow(double, double, double, double)
 o TraceGraphWindow(double, double, double, double, double, double)

Method Index

 o deleteAll()
Delete all the nodes.
 o deleteFunction(Function)
Override the method from ZoomGraphWindow to make sure all the nodes on a function are deleted when the function is deleted.
 o keyDown(Event, int)
A backspace deletes the selected nodes
 o mouseDown(Event, int, int)
Clicking on (or quite near) a graph causes a node to be created there.
 o mouseDrag(Event, int, int)
 o mouseUp(Event, int, int)
 o paint(Graphics)

Variables

 o nodes
  protected Hashtable nodes
Each node keys the function that it is attached to in this table

 o dragNode
  protected TraceGraphNode dragNode
The node that is currently being dragged

 o maxNodes
  public int maxNodes
The maximum number of nodes allowed in this window.

Constructors

 o TraceGraphWindow
  public TraceGraphWindow(double xMin,
                          double xMax,
                          double xScale,
                          double yMin,
                          double yMax,
                          double yScale)
 o TraceGraphWindow
  public TraceGraphWindow(double xMin,
                          double xMax,
                          double yMin,
                          double yMax)
 o TraceGraphWindow
  public TraceGraphWindow()

Methods

 o paint
  public void paint(Graphics g)
Overrides:
paint in class ZoomGraphWindow
 o mouseDown
  public boolean mouseDown(Event evt,
                           int x,
                           int y)
Clicking on (or quite near) a graph causes a node to be created there. Clicking on an existing node selects it for dragging.

Overrides:
mouseDown in class ZoomGraphWindow
 o mouseDrag
  public boolean mouseDrag(Event evt,
                           int x,
                           int y)
Overrides:
mouseDrag in class ZoomGraphWindow
 o mouseUp
  public boolean mouseUp(Event evt,
                         int x,
                         int y)
Overrides:
mouseUp in class ZoomGraphWindow
 o keyDown
  public boolean keyDown(Event e,
                         int key)
A backspace deletes the selected nodes

Overrides:
keyDown in class Component
 o deleteFunction
  public void deleteFunction(Function f)
Override the method from ZoomGraphWindow to make sure all the nodes on a function are deleted when the function is deleted.

Overrides:
deleteFunction in class GraphWindow
 o deleteAll
  public void deleteAll()
Delete all the nodes.

Overrides:
deleteAll in class GraphWindow

All Packages  Class Hierarchy  This Package  Previous  Next  Index