CSC 221 Team Project
Spring 2009
Objective
To develop a software package that will function as a tool for
designing simple Java Swing Graphical User Interfaces. The tool must
allow
- the user to design user interfaces that include one
instance of a JFrame, and contain multiple instances of
JButton, JLabel, JTextField, JTextArea objects. NOTE: In the GUI, the
JFrame object will have to be simulated using a JPanel.
- save a designed user interface to a user specified file
so that it can be edited later.
- export Java source code corresponding to the designed user
interface to a file which, when compiled and executed, would yield
the user interface designed using the tool.
User Interface
Your software will include the following user interface elements:
- A menu bar with the following options (and
sub-options):
- File (New, Open, Save, Export, Exit)
- Edit (Cut, Resize, Properties)
- A tool section with the following controls. These can be simple
buttons
with text captions.
- JFrame
- JButton
- JLabel
- JTextField
- JTextArea
- Cut control
- Resize control
- Edit Properties control
- Refresh drawing control
Desired functionality
The software will have the following functionality:
- (20
points) Allow user to design Swing user interfaces that contain Swing
components specified above. The user will specify
location and
dimensions of the components using mouse interaction
as specified
below.
- A
left mouse press marks the location of the component.
- The user
then indicates the dimensions of the
component by dragging the mouse. As the user drags the
mouse, the current dimension of the component is shown as a red
rectangle.
- Mouse
release
marks the end of
the process..
- The red
rectangle disappears and the designed GUI component appears on the
design pane
- (10 points) Allow user to save GUI to a user specified file.
Allow user to read, display, and modify a GUI previously saved in a
file.
- (10 points) Completely erase current GUI.
Tie this action
to the File-New menu option.
- (10
points) Component selection: Allow user
to select a component that appears in the GUI being designed. The user
indicates the component to
be selected by a right mouse click within (or on) the
component to be selected
. The
software responds by drawing a red rectangle around the selected
component.
- (10 points) Allow user to cut (remove) selected
component
from the GUI.
Note that the
user has to select a component before it can be cut.
- (10
points) Allow user to resize a component.
Note that the
user has to select a component before it can be resized. Only the dimensions of the
component,
not its location, can be modified. The behavior of the
software during resizing is the same as in 1 above.
- (10 points) Allow user to specify the
following properties for a component: name, label, attached Java code.
For example,
in the context of a JButton in the GUI, the properties
might be
"calcButton", "Calc", "calcButton.addActionListener(this)". Note that the user has to
select a component before its properties can be set. All objects
created must have default, generic, values for properties when created.
For instance, the JButtons may be named button1, button2 etc. and have
labels "b1", "b2", etc.
- (20 points) Export source code to a user-specified
file. The code must compile without
further editing by the user and, when compiled, must generate a
GUI identical to the one designed
by the user.
Tie
this action to the File-Export menu option.. Here is an example of a Java source file created by the tool and a screenshot of the corresponding user interface designed using the tool.
-
(10 points) Extra Credit -
add-a-feature. You will receive up to 10 extra points for a
feature that you add to the tool. How many extra credit points you
receive depends on the utility and slickness of your enhancement.
Software Design
- Download the file SwingMan.jar and
add it as an external jar file to your project. It contains the class
BasicGUITool and the interface SwingThing
. Your GUITool will extend BasicGUITool.
- You will implement your own classes, like MyJButton,MyJFrame, MyJLabel etc.
that extend the corresponding Swing components JFrame, JButton,
JLabel, JTextField, JTextArea. Each of these classes MUST implement
the SwingThing
interface.
- A class corresponding to your design tool that extends the BasicGUITool.java class. The
BasicGUITool class provides some basic functionality of a GUI design
tool.
- You may not modify SwingThing.java or BasicGUITool.java.
Team composition and due date
Teams will be composed of three members each. Team member names are due to me in class on Friday, March 20, 2009.
Each
team
will
demonstrate its project in the lab
on Friday, April 24, 2009. The following
intermediate deadlines are STRONGLY SUGGESTED.
- Magenta Phase:
Complete by week ending April 3, 2009
- Yellow Phase:
Complete by week ending April 10, 2009
- Red Phase: Complete by
week ending April 17, 2009
Project Grading
Credit will given for completing the tasks identified in
the section above. Each task will be scored on a
boolean basis. That
is,
your software either fully provides the desired functionality or it does not. No partial credit will be given
for any feature.