Package org.opensourcephysics.display2d
Class ContourAccumulator
java.lang.Object
org.opensourcephysics.display2d.ContourAccumulator
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
Modifier and TypeMethodDescriptionvoid
addLine
(int x1, int y1, int x2, int y2) Adds a line to the accumulator.void
Clears accumulator.void
Draws all accumulated lines.
-
Method Details
-
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 coordinatey1
- the first point's y coordinatex2
- the second point's x coordinatey2
- the second point's y coordinate
-
clearAccumulator
public void clearAccumulator()Clears accumulator. -
drawAll
Draws all accumulated lines.- Parameters:
g
- the graphics context to draw
-