Results 1 to 2 of 2
Thread: Abstraction Assignment Help!
- 04-27-2011, 01:22 AM #1
Member
- Join Date
- Apr 2011
- Posts
- 1
- Rep Power
- 0
Abstraction Assignment Help!
Folks please go easy on me! I am a beginner so understanding all the concepts is quite hard at the moment.
For my programing class I was assigned to the following:
Suppose you want to draw various shapes on a panel and be able to
individually move them around, change their color or erase them.
You want to draw various shapes (like circles, polygons and stars).
You will need various methods (like draw, erase, move, setColor).
Think, then design your hierarchy of classes.
Where (in which class) will you put each method?
Which classes will be abstract?
Which methods will be abstract?
Write a test class to test your package.
You will need an array of shapes.
The paint() method should simply draw everything in the shapes array.
You will need some way to repaint your panel so you can demonstrate
that move and erase are working properly.
Repaint() creates a paint event.
You can use a MouseListener (or Adapter), a KeyListener (or Adapter),
an ActionListener (button) or a Timer.
A KeyListener is probably easiest since you can do different things
based on which key is pressed. At the bottom of your listener/handler,
call repaint().
Ive tried for several days now and I cant figure out how to go about this assignment. All the previous assignments have been fairly easy for me except for this one here.
I will appreciate any help people have to offer thanks!
- 04-27-2011, 02:12 AM #2
Member
- Join Date
- Dec 2010
- Posts
- 3
- Rep Power
- 0
Similar Threads
-
Help with abstraction
By Shephard in forum New To JavaReplies: 5Last Post: 03-05-2011, 09:43 PM -
Are abstraction and encapsulation concepts not in C?
By hitesh_public in forum New To JavaReplies: 1Last Post: 08-20-2010, 02:23 PM -
Abstraction
By maya700 in forum New To JavaReplies: 4Last Post: 07-04-2010, 06:26 PM -
diff between abstraction and inheritance
By sandeepsai17 in forum New To JavaReplies: 4Last Post: 05-24-2010, 06:04 AM -
Abstraction
By anurag in forum New To JavaReplies: 6Last Post: 05-15-2010, 06:15 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks