|
ScatterPlot
DescriptionScatter Plot Exercise
- Fork/Checkout ScatterPlot-Unfinished from GIT (URL is https://bitbucket.org/ferzle/scatterplotunfinished).
- Run the program. It should pop up a window with about 100 small circles of various colors.
- In the ColorderPointUtil class, implement writeList.
Take a look at the following examples and/or your textbook to help you choose the class(es) to use.
- Test writeList by running the program and trying File-->Save.... Save the file on the desktop and then open it with a text editor to see if it looks correct.
- Still in ColorderPointUtil, implement stringToPoint and readList.
- Test the previous two methods by runing the program and using File-->Open...". Open the list you saved a few steps ago.
- In ScatterPlot, add a new menu item under File called New... that
replaces the current points with a new set of points by calling generateRandomList.
- Answer the following questions
- How many different ways do you think there are to implement the read and write methods?
- Can you improve the implementation of toString in ColoredPoint?
- Why are the read/write methods in ColoredPointUtil? Can't they just be part of ColoredPoint? (Hint: As with many questions in computer science, there are several options, with each having advantages and disadvantages).
|