I hate college...it goes too fast. I decided to study for a world history rather than go to my computer science class and now im lost..my HW asignment is here (
http://www.cse.buffalo.edu/faculty/a...b6/index.shtml) if you want to take a look, but ill describe everything ive done so far...
The first thing is
Quote:
|
You must also define the Applet so that it uses a Lab6System.
|
which is done like this
Code:
package lab6;
public class Applet extends containers.Lab5Applet {
public Applet() {
new Lab6System();
}
}
The next part is based on a UML diagram (which you will have to look at). I believe what i have to do is create a new class called CompositeShape and put this code in there
Code:
package lab6;
public class CompositeShape implements lab5lib.IMovingShape {
private lab5lib.IMovingShape _shape1;
private lab5lib.IMovingShape _shape2;
public CompositeShape(lab5lib.IMovingShape shape1, lab5lib.IMovingShape shape2){
}
public void setColor(cse115.graphics.colors.Color black){
}
public void slowDown(){
}
public void speedUp(){
}
}
as far as i know that is correct but now i have no idea how to do step two
Quote:
Step 2
Now build a CompositeShape consisting of three IMovingShapes (include one lab5lib.Oval, one lab5lib.Triangle and one lab5lib.Rectangle). Note that to do this you need only instantiate classes that already exist - you must not define any new classes.
Hook this CompositeShape up appropriately to the buttons. Test your implementation of the composite by checking that the buttons affect all the shapes of the composite.
|
So if someone could give me a hand (asap) i would greatley appreciate it.
and ps i would much rather someone explain what it means and how to me how to do it, rather than do it for me
Thank you