Assignment 3
CPS-615
David Figatner

Here is the java applet:

Here is the source code for the improved ShowData.java (note that most of the updates have been documented in the code.  I'll give a brief overview of them below).

Here is the updated datafile (to support labels on data points).

* Double buffered window drawing - I added a double buffered created and maintained within paint() for the data window.

* Added labels to points - I added labels (defined in the inputfile) to the graph.  The label option can be disabled by placing a 0 (instead of the current 1) in the datafile: "1       // Labels: 1=yes, 0=no".

* Added a grid checkbox and the actual grid.  The grid is numbered in intervals of 0.5 (could have made another control to indicate the intervals, but I thought it would have been a bit of an overkill for this project).

Most of the changes above are well documented (by comments and by code) in the ShowData.java file.  For the most part, working with java was pretty easy conversion from C++.  There are a couple of changes, but they are mostly cosmetic.  I was a little dissappointed by the speed of the applet running above.  A similar program in C++ would run much faster, and would not need to use double-buffering to avoid flicker (a simple background colored box would be fast enough).

Hopefully this is the kind of thing you were looking for.

Back to Assignment 3 Main Page