©2005 Felleisen, Proulx, et. al.
A GUI Component
is one of
the following:
Checkbox
Textfield
OptionsView
ColorView
Table
The first four components are primitive components, while the
Table
is a compound component. Each component contains a
label and some additional data.
The data for
a Table
is a list of Row
s. A Row
is
a list of Component
s.
Data for each of the primitive components consists of the
default value to
be displayed, specified as a String
, and also the preferred
width and height for this component.
Draw the class diagram for this collection of classes.
Design the
methods needed to count the number of primitive GUI components in a
given GUI Component
.
Design the
methods needed to determine the height of a given GUI
Component
. The height of a table is the sum of the
heights of the Row
s. The height of a Row
is the
maximum of its components' heights.