A2: Model-View-Controller (Java) -- JSketch

Due Fri Oct 19 at 5:00 PM


In this assignment you'll demonstrate your understanding of MVC by implementing a vector-drawing program, consisting of a canvas and tool palettes. Your program will selecting drawing properties, and drawing shapes on-screen.

This is a rough mockup that illustrates the features that you will implement, and the basic layout that you must use.

Learning Goals


The main area of your drawing program is a canvas that supports drawing shapes from the tool palette. Users can draw by selecting a shape from the list on the side, then clicking and dragging the mouse on the canvas to draw that shape. A shape "preview" is shown as the mouse is dragged, and the shape is complete when the mouse button is released (i.e. the first click sets the starting position, and the drag operation sets the width of the circle, or creates a line, depending on the shape being drawn, and the shape is complete when the mouse button is released).

Your drawing program will have the following layout and features:

The following functionality should be supported:

Technical Requirements

The following is a list of technical constraints and guidelines:

Additional Features (Mandatory, choose one or more features from the list below, totalling 10%).

Bonus Features: Resizing (Bonus, up to 10% for completing this feature)

In addition to making the canvas fixed-size, you may choose to enable scaling of the canvas to the window. This is an optional feature. If you complete it, we will reward up to 10 bonus marks on your assignment. If you exceed 100%, we will apply the "extra" marks to your lowest assignment.

This feature allows the user to toggle between scaling the canvas full-size (as above), or scaling the canvas and its contents to the window. You should add the following options to your toolbar:


Submit the following to your personal Git repository, in the A2/ subdirectory:


Your submission will be assessed roughly as follows:

Makefile compiles and runs program.
Functional requirements, described above.
MVC architecture (incl. at least 1 model and 2 views).
Dynamic layout, and appropriate use of widgets.
Additional features from the list above.
Optional, maximum bonus for resizing.