CS 6395: Assignment 3: Paint!
Summary
Implement a paint program. You program is to support a
selection of drawing primitives and colors. It is also to support
move/copy of rectangular regions and region fill.
The purpose of this assignment is to deal with interactivity
issues, not to create a full featured paint program.
Due
This assignment is due the last day of class. You are to
implement it in Java and Swing.
Details
You are to create a simple paint program. The program should support
the following main features:
- drawing primitive: you should support a few different
primitives, including (at least) two sizes of paint brushes (a
single pixel and 10 pixels wide) and the ability to draw lines
(and rectangles) by specifying their endpoints (corners).
- colors: you should support a palette of at least 8 colors.
These are used for the "paint color". The "background" color
is always white.
- move/copy of rectangular regions: you should support
the ability to select a rectangular region and then copy it
or move it. In both cases, moving or copying is performed by
grabbing the selected region and dragging it to a new
position, where it is painted onto the destination position.
The difference is that if the region is copied, then the
original region is not changed, but if the region is moved,
then the original region is filled with white, the background
color.
- region fill: you should be able to grab a paint color from
the palette and "drop" it on the paint surface, where it will
fill the region around the pixel that was "dropped" on. A
region is defined as the connected set of pixels of the same
color.
- at least one other feature of your choice.
Your interface should support multiple access to the modal
commands. In particular, the drawing primitives and the action
to select the copy/move region should be in a palette, a menu, and
have keyboard shortcuts.
The colors should only be available from a palette. Clicking on
a color should change the current color. Clicking and dragging
onto the paint region should perform a fill.
Move and copy are implicit: if the current command is to select
a copy/move region, dragging inside an existing region performs
copy, and dragging with a shift key held does a move. Dragging
outside the region replaces the region replaces the region.
Clicking anywhere clears the region.
The palettes for the colors and tools can be in their own
subwindow, or in the side of the main paint window, whichever
you prefer. They should all be within one top-level window.
Feedback
The major purpose of this assignment is exploring how to provide
good feedback and interactivity. For all of the above actions,
you should provide as much feedback as possible, while still
having the system remain interactive. Here is an
incomplete list of possibilities that you should keep in mind
- The cursor should unambiguously indicate what action is
being performed, especially if the effect of clicking changes
as the mouse moves.
- Feedback should be adjusted to be as detailed as possible,
given the constraints of the current operation. For example,
when dragging a rectangular image being copied, if the program
cannot smoothly drag the image, you should switch to using an
outline. But, for small images, you can draw the real image.
- When doing drag and drop filling, it would be desirable to
give an indication of what will happen when the button is
released. Ideally, you would show an outline of the affected
area, but that will be to slow to compute as you move the
mouse around. However, when the user pauses (doesn't move the
mouse for a small amount of time) you could provide that
feedback.
Extra Credit
You may obtain extra credit (up to 20% of the assignment value)
for implementing extra features that lead to interesting
interactivity problems and solutions. Please send the Professor
email (blair@cc) if you would like to attempt to do something
for extra credit, and want to make sure it is reasonable.
Blair MacIntyre
Last modified: Thu May 13 16:33:53 Eastern Daylight Time 1999