Results 1 to 2 of 2
  1. #1
    CoolKidsClub is offline Member
    Join Date
    Apr 2011
    Rep Power

    Default 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!

  2. #2
    1060406004020 is offline Member
    Join Date
    Dec 2010
    Rep Power

Similar Threads

  1. Help with abstraction
    By Shephard in forum New To Java
    Replies: 5
    Last Post: 03-05-2011, 10:43 PM
  2. Are abstraction and encapsulation concepts not in C?
    By hitesh_public in forum New To Java
    Replies: 1
    Last Post: 08-20-2010, 03:23 PM
  3. Abstraction
    By maya700 in forum New To Java
    Replies: 4
    Last Post: 07-04-2010, 07:26 PM
  4. diff between abstraction and inheritance
    By sandeepsai17 in forum New To Java
    Replies: 4
    Last Post: 05-24-2010, 07:04 AM
  5. Abstraction
    By anurag in forum New To Java
    Replies: 6
    Last Post: 05-15-2010, 07:15 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts