Create (at least) two new classes which extend RenderAbsClass, and which represent these objects. The concentric circle object should look like a series of concentric circles whose radii differ by 2 pixels. In order to be able to create objects from these classes, they must implement the abstract methods in RenderAbsClass. Thus they must implement at least the following:
protected void doRender(Component comp, Graphics g) public String toString()Along with the required methods, you should include constructor for your objects with headers in the same form as:
public Bouncer(int x, int y, int width, int height, Color color)(presuming the name of your class is Bouncer). Thus you should be able to create these bouncer objects at any location, and having any size and color desired.
I'll leave it to you to decide exactly which fields should be included in your objects. Because your classes extend RenderAbsClass they will automatically include fields x, y, and color. Be sure not to declare them again as this will screen out the original ones. I suggest that you look at the code for classes RenderAbsClass and Rect in the Graphics library for ideas on how you might code these operations.
I found it easiest to do the drawing by overriding the methods:
public void render(Component comp) public void erase(Component comp) public void invert(Component comp)by having these methods set a flag (e.g., a field) before calling doRender so it can check to see which operation it should do. If you have done a good job, you will only need to change a few lines of the program BouncingBall.java. Be sure to add the files for your classes to the project BouncingBall.µ before attempting to compile and run the program.
This program is due Monday, February 24, 1997 at 11:59pm. Please label the folder containing your program, project, and classes with your name, and drag the folder to the CS136 dropoff folder on Cider Press/Courses/CS 136 folder. Your program should be fully commented (including your name). No late assignments will be accepted.