import java.awt.*; import java.applet.Applet; import java.util.*; public class QuiltWorld extends PictureWorld { public void initializePictureChoices() { // Define your pictures here and in auxiliary methods. // Add your pictures to the menu via "addPictureChoice(String name, Picture pic);" addPictureChoice("quilt1", quilt1()); addPictureChoice("quilt2", quilt2()); } public Picture quilt1 () { // Introduce local names for colors to avoid the "Color." syntax. Color black = Color.black; Color blue = Color.blue; Color green = Color.green; Color red = Color.red; Color yellow = Color.yellow; // Put your code for defining quilt1 here: return empty(); } public Picture quilt2 () { // Introduce local names for colors to avoid the "Color." syntax. Color blue = Color.blue; Color green = Color.green; Color red = Color.red; Color yellow = Color.yellow; // Put your code for defining quilt2 here: return empty(); } // Auxiliary methods public Picture fourPics (Picture p1, Picture p2, Picture p3, Picture p4) { // Flesh this out in lab. return empty(); } public Picture fourSame (Picture p) { // Flesh this out in lab. return empty(); } public Picture rotations (Picture p) { // Flesh this out in lab. return empty(); } public Picture corner (Picture p1, Picture p2) { // Flesh this out in lab. return empty(); } public Picture patch_2x2 (Color c) { // Flesh this out in lab. return empty(); } public Picture patch_4x4 (Color c) { // Flesh this out in lab. return empty(); } public Picture triangles_2x2 (Color c1, Color c2) { // Flesh this out in lab. return empty(); } public Picture triangles_4x4 (Color c1, Color c2) { // Flesh this out in lab. return empty(); } public Picture triangles_8x8 (Color c1, Color c2) { // Flesh this out in lab. return empty(); } // Methods for generating the primitive pictures for this problem. // You do not have to understand these in order to do the problem set. public Picture patch(Color c) { return overlay (new Rect(0.0, 0.0, 1.0, 1.0, Color.black, false), new Rect(0.0, 0.0, 1.0, 1.0, c, true)); } public Picture triangles(Color c1, Color c2) { return overlay (new Rect(0.0, 0.0, 1.0, 1.0, Color.black, false), overlay (new Line(0.0, 1.0, 1.0, 0.0, Color.black), overlay(tri(c1, true), clockwise180(tri(c2, true))))); } public Picture tri(Color c, boolean isFilled) { Poly triPoly = new Poly (c, isFilled); triPoly.addPoint(0.0, 0.0); triPoly.addPoint(0.0, 1.0); triPoly.addPoint(1.0, 0.0); return triPoly; } }