Base repository for CS56 F16 lab04 (Open Source)
See: https://ucsb-cs56-f16.github.io/lab/lab04/
Originally, this section of the README.md was called grader hints, but is occurred to me that students completing the assignment should probably read this also. These are the commands that the TA, Reader, Instructor are going to use to check your work, so it will benefit you to run these commands also.
In addition, you can see examples of some past student work that illustrates what you are supposed to do in this assignment.
- Use
ant -p
to see all available tasks - The grader tasks include these:
gradeMPV1 run MultiPictureViewer for studentName with arg 1 gradeMPV2 run MultiPictureViewer for studentName with arg 2 gradeMPV3 run MultiPictureViewer for studentName with arg 3 gradePV run simple.PictureViewer for student in studentName property gradeSimpleGui1 run simpleGui1 for student in studentName property
To run one of those tasks, overriding the student's CSIL id to jgaucho, use, for example:
ant -DstudentName=jgaucho gradePV
You can test this with studentName set to pconrad
, andrewberls
, or jstaahl
as examples. All of those should work on pconrad, though only the MPV tasks will work for the other two.
Try executing the following:
What you should see will look something like the picture shown at right. |
This is sample output from the program src/edu/ucsb/cs56/drawings/pconrad/simple/PictureViewer.java.
It shows code that was drawn by: edu.ucsb.cs56.drawings.pconrad.simple.PictureComponent. This code draws a simple house, and an incomplete snowman.
One of your "warmup exercises" for the lab is to try to complete your own version of this snowman (or, if you prefer, "person of snow".) This requires you to understand the Circle class which is in that same directory, and is just a simple wrapper around the built-in Ellipse2D class provided by that Java libraries.
Now try these commands:
ant -DstudentName=andrewberls gradeMPV1
ant -DstudentName=andrewberls gradeMPV2
ant -DstudentName=andrewberls gradeMPV3
ant -DstudentName=jstaahl gradeMPV1
ant -DstudentName=jstaahl gradeMPV2
ant -DstudentName=jstaahl gradeMPV3
What you should see in the first three cases are three pictures defined by three methods of the class edu.ucsb.cs56.drawings.andrewberls.advanced.AllMyDrawings
Here are screenshots of the images that result from running those commands:
All of those are the result of the two iPod images defined in these classes, one of which inherits from the other:
edu.ucsb.cs56.drawings.andrewberls.advanced.IPod
edu.ucsb.cs56.drawings.andrewberls.advanced.IPodDetail
Similarly, the second three images are the result of the methods of the class
edu.ucsb.cs56.drawings.jstaahl.advanced.AllMyDrawings
All of those are the result of the two pencil images defined in these classes, one of which inherits from the other:
edu.ucsb.cs56.drawings.jstaahl.advanced.Pencil
edu.ucsb.cs56.drawings.jstaahl.advanced.SharpenedPencil
Here are screenshots of the images that result from running those commands: