To develop a software package that will function as a simple shape drawing tool.
Your software will include the following user interface elements:
The software will have the following functionality:
Credit will given for completing the tasks identified in the section above. Each task will be scored on a Boolean basis. That is, your software either provides the desired functionality or it does not.
Questions answered:
I've attached Lab 14b. There are two issues that I would like to improve if possible.
Add g.dispose() to your open method.
The
Graphics
object should have the same state when you're finished painting as it
had when you started.
1 - If you drag too quickly using the thick line eraser, it seems to "skip" a little bit. It seems like it can't process the points fast enough.
Change drawRect to fillRect. This gives better behavior, but doesn’t solve the problem - if it is a problem.
2 - If there are two overlapping shapes and you erase a shape using the Shape Eraser, it won't repaint the remaining shape behind it. I'm not sure if we were supposed to address this issue or not.
Addressing this in the lab is not required. But when you resolve your persistence problem this goes away. To see the persistence problem, just minimize then maximize the frame and notice how your bottomPanel is empty. Don’t need to fix this for now. This is why I put a refresh requirement in Program 4.
This link may be beneficial:
http://java.sun.com/docs/books/tutorial/uiswing/14painting/concepts2.html
Also, look at Chapter 5 in our text.