The first thing is
Quote
You must also define the Applet so that it uses a Lab6System.
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 therepackage 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.
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


Sign In
Create Account

Back to top










