Difference between revisions of "CSC111 Lab 11 2015"
Line 97: | Line 97: | ||
<br /> | <br /> | ||
<br /> | <br /> | ||
+ | =<center>Discussion Time!</center>= | ||
+ | <br /> | ||
+ | <center>[[Image:discussion.jpg|400px]]</center> | ||
+ | <br /> | ||
+ | * Discuss the various options as a class. Figure out what is going on. What is missing, what the problem is, and how to fix it. | ||
+ | <br /> | ||
+ | |||
+ | <!-- | ||
* Ok, if you thought that the inherited '''move()''' method from the Rectangle class is not what we want to use, because the original Rectangle class does not know anything about the label, you are totally correct. If, furthermore, you thought you needed to create a new '''move()''' method for '''MyRect()''' that will ''override'' the Rectangle '''move()''' method, then I'm really impressed! | * Ok, if you thought that the inherited '''move()''' method from the Rectangle class is not what we want to use, because the original Rectangle class does not know anything about the label, you are totally correct. If, furthermore, you thought you needed to create a new '''move()''' method for '''MyRect()''' that will ''override'' the Rectangle '''move()''' method, then I'm really impressed! | ||
* Create a new method called '''move()''' and base its design on the '''draw()''' method, so that it will call '''Rectangle.move()''' to make the yellow rectangle move, and it will activate the '''move()''' method of the label to make it move by the same dx, dy displacement. | * Create a new method called '''move()''' and base its design on the '''draw()''' method, so that it will call '''Rectangle.move()''' to make the yellow rectangle move, and it will activate the '''move()''' method of the label to make it move by the same dx, dy displacement. | ||
* Verify that your new program makes the rectangle and the label move together (it's ok if you see some jitter in the motion). | * Verify that your new program makes the rectangle and the label move together (it's ok if you see some jitter in the motion). | ||
+ | --> | ||
+ | |||
<br /> | <br /> | ||
<!-- ================================================================ --> | <!-- ================================================================ --> |