Java Reference
In-Depth Information
Refinement
Description
Present the basic graphical user interface, including the main frame, buttons,
menus, menu items, and the drawing area. The select and shape buttons
work together as a radio button set (only one can be chosen at a time). No
functionality for these interface elements is included at this time. Exiting the
program is provided only by the frame's window close button.
1
Add support for drawing the four basic shapes: lines, ovals, rectangles, and
polylines. The chosen shape button determines what shape is drawn. The
stroke color button can be used to set the stroke color for the next shape
drawn. The color button causes a separate dialog box to appear to allow
color selection.
2
Add support for saving and loading drawings. This includes the functionality
of the open, save, and save as File menu items. When the open, new, or
exit File menu options are chosen, check to see if the current drawing has
been modified since last saved, and if so prompt to see if the user wants
to save the drawing.
3
Provide the ability to select and move shapes on the drawing surface.
Simple graphic selection blocks should be presented on the shape's outline
to indicate the currently selected shape. Once selected, the mouse can be
used to drag the shape to another location on the drawing surface.
4
Add the functionality for the cut, copy and paste Edit menu items. Once
selected, a shape can be cut or copied. Once a shape has been cut or copied,
it can be pasted (perhaps multiple times) onto the drawing surface at a fixed
offset to the original position. Edit menu items that are not valid at any
given time are disabled. For example, unless a shape is selected, the cut
and copy menu items cannot be chosen.
5
Add support for filling and reshaping a shape. Once a shape has been selected,
the fill color button can be used to determine its fill color. A menu item
on the Edit menu can be used to remove the fill of any filled object (make it
transparent). The currently selected shape will now have a reshape handle
that can be used to change the dimensions of the shape.
6
Add some extra functionality to the program. These additions include a
splash screen that appears when the system is initially executed, an
about dialog box, keyboard shortcuts for all menu items, and packaging the
application into an executable JAR file.
7
FIGURE J.2 Functional refinements for the PaintBox project
of this one refinement. We'll create additional diagrams that augment our under-
standing of the system design as further refinements are developed.
The detailed design and implementation for the interface refinement might
develop similarly to other graphical projects we've developed in previous chapters.
 
Search WWH ::




Custom Search