org.opensourcephysics.display2d
Class ContourAccumulator

java.lang.Object
  extended by org.opensourcephysics.display2d.ContourAccumulator

public final class ContourAccumulator
extends java.lang.Object

Title: Contour Description: The class LineAccumulator accumulates line drawing information and then draws all accumulated lines together. It is used as contour accumulator in the contour plot. The contour plot uses some code from the Surface Plotter package by Yanto Suryono.

Version:
1.0
Author:
Wolfgang Christian

Method Summary
 void addLine(int x1, int y1, int x2, int y2)
          Adds a line to the accumulator.
 void clearAccumulator()
          Clears accumulator.
 void drawAll(java.awt.Graphics g)
          Draws all accumulated lines.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

addLine

public void addLine(int x1,
                    int y1,
                    int x2,
                    int y2)
Adds a line to the accumulator.

Parameters:
x1 - the first point's x coordinate
y1 - the first point's y coordinate
x2 - the second point's x coordinate
y2 - the second point's y coordinate

clearAccumulator

public void clearAccumulator()
Clears accumulator.


drawAll

public void drawAll(java.awt.Graphics g)
Draws all accumulated lines.

Parameters:
g - the graphics context to draw