Due: Friday, May 2 at 11:59 pm.
This is a modified version of an
assignment by Julie Zelenski. The problem is to write a class that draws a
picture of a type of quilt called a sampler quilt. A sampler quilt is
composed of several different block types that illustrate a variety of quilting
styles. Your quilt will consist of at
least 2 patterns of blocks. The blocks
should be arranged so that they repeat in a cycle. So, for example, if you have 4 patterns
numbered 0-3, you would start with a random block, say 2, and if your quilt
were 5 by 8, the layout would be:
Row 0: pattern 2, pattern 3, pattern 0, pattern1,
pattern 2, pattern 3, pattern 0, pattern1
Row 1: pattern1, pattern 2, pattern 3, pattern 0,
pattern1, pattern 2, pattern 3, pattern 0
Row 2: pattern 0, pattern1, pattern 2, pattern 3,
pattern 0, pattern1, pattern 2, pattern 3
Row 3: pattern 3, pattern 0,
pattern1, pattern 2, pattern 3, pattern 0, pattern1, pattern 2
Row 4: pattern 2, pattern 3, pattern
0, pattern1, pattern 2, pattern 3, pattern 0, pattern1
D-level functionality (correctness)
Create a Control class called QuiltController, similar to the ColorController
we made in class in Wednesday, April 23. The constructor should take two paramaters -- the number of rows and columns in the quilt
and then create and display a QuiltFrame. The QuiltFrame
should extend JFrame and should have a preferred size
of 100*columns by 100*rows.
C-level functionality (correctness)
Create a Block class that is a basic
quilt block with a solid color that is passed into the constructor. Create one other class that extends the Block
class, but consists of some other pattern than just a solid color. Display these blocks in an alternating
pattern similar to that described above in the number of rows and columns
specified by the user.
B-level functionality (correctness)
Create and use at least 3 more
extensions to the Block class with different patterns (so your quilt must have
at least 5 patterns including solid color).
At least one of your patterns must use a recursive drawing
function. At least one of your patterns
must include an image.
Also, include the ability to click
with the mouse on a particular block and have it display in an enlarged version
in a separate frame. Note that you will
need to construct a copy of your block rather than using a reference to the
original. When the enlarged frame is
closed, it should just dispose of that frame and not close the entire
application.
A-level functionality
Be creative here though the amount
of points will depend on the difficult of the extension. Possible
extensions: more block variations, the
ability to change the color scheme in all blocks through a menu item, combinations
of blocks in patterns. Talk to me about
what you’re planning.
Handins
Use handin to turn in your work. You need to include:
The handin name is project4. Include all project files in the handin.