Homework 4: Final Project

05-631: Software Architecture for User Interfaces , Fall, 2001

Assigned: October 25, 2001
Due: Tuesday, Dec 11
Project choice and/or description due: Thursday, Nov. 8

Scoring Structure

For this project, each alternative will have a “base score”.  This is the score you will receive if you complete the project as stated.  In addition, there is an opportunity to earn extra points up to 100%.  Finally, up to 15% “extra credit” points above 100% may be earned for truly exceptional additional features.  The “extra credit” points will not be used as part of the score used to determine initial grades for the class.  However, after grades for the class have been assigned, if your grade is just below the cutoff for a particular letter grade, these points can be used to raise you to the next letter grade.

Project Alternative 1: Interface Builder (Base Score: 85 points)

This project is to build a simple interface builder or layout editor.  This program should allow the interactive specification of the size and position of a series of objects in a drawing-like editor.  A typical interface might consist of a palette of objects that can be placed in a resizable drawing/edit area.  These objects will be edit-time representations of the built-in Java Swing widgets. In addition to allowing the user to place these objects and (where appropriate) resize them, your editor should also allow the user to reorder them – that is to change the drawing order, moving objects closer to the front or further to the back.

Your editor should also provide an interface to a series of properties for each edited object.  For example, a button object might have (at least) the following properties:

Name

The Java variable name that will hold the object at run-time.

X

An integer giving the x position of the button.  This value would also be set in the drawing-like editor, but is duplicated here to allow the user to specify exact positioning.

Y

An integer giving the y position of the button.

Visible

A Boolean controlling whether the button was initially visible.

Enabled

A Boolean controlling whether the button was initially enabled (accepting input).

Label

A String which determines the button’s textual label.

Callback

A String giving a Java expression which results in a callback_object.

Note that buttons are not resizable, hence do not have the w, and h properties that other objects may have.

A typical interface to the properties of an object would be a “property sheet” – a dialog box with a series of textual labels and data entry fields. Validation should be performed on each field to ensure that it contains a properly typed value. 

Your interface should be able to save and restore a set of edited objects.  Finally, your interface must be able to generate Java code that builds and runs the interface that the user has specified.  This code should be written to a text file and be in a form suitable for compilation by the Java compiler.  When run, this code should create a running interface. 

To earn the base score for this project alternative, you should implement an editor that includes buttons, labels, vertical sliders, checkboxes and radio buttons. The layout can leave the objects exactly where the user places them (i.e., only use a static layout -- the null Swing LayoutManager).

For an extra 10 points, include support for the following LayoutManagers, and some "reasonable" way for the user to specify where widgets are placed using them: BorderLayout,  BoxLayout, FlowLayout,  GridLayout. For another extra 5 points, figure out a good way for designers to interactively use GridBagLayout.

Additional extra points will be awarded for additional features. Possibilities include: the rest of the Swing widgets, a menu-bar editor, support for snapping or other alignment, support for hierarchy (grouping and subgroups) in the edited interface, etc.


Project Alternative 2: Object Browser / Inspector (Base Score: 85 points)

This project is to use the reflection (also known as introspection) capabilities of Java to create a browser or visualizer for Java objects.  This browser should be capable of accepting any Java object and producing a visualization of its fields, values in the fields, methods, and constructors.  Note that information about a Java object can be obtained by calling getClass() on the object. This method returns a java.lang.Class object.  This object in turn allows you to access descriptions for the fields and methods of the object (see the JavaDoc documentation for java.lang.Class as well as related classes in java.lang.reflect for details).  For each method of an object’s class you should display the name, return type, parameter types, and protection of the method. A similar display without return type should be constructed for each constructor of the class. For fields, the protection and field type should be displayed.  In addition, the current value of the field should be displayed.  If the value is of a primitive type (or a String) the value should be displayed directly.  If the value is an object type, a button or other interface device should be provided to allow the object being referenced to be displayed in a new browser.

If you desire, you may separate the fields and methods declared directly in a class from those that are inherited from its superclass.  In any case, you should provide a mechanism for traversing the superclass hierarchy to view the fields, methods, and constructors in the superclass, and a display of the superclass name and any interfaces implemented.

As a part of your project you need to provide a class representing your browser that is capable of taking any Java object as a parameter to its constructor and build a browser interface for it.  If you choose to implement a browser which separates superclass information, you should also provide a constructor which takes both an Object and a Class (and constructs a browser for the given object viewing as the given class). Be sure to handle null objects and improper classes graceful (i.e., by putting up a small interface stating that the object is null, or that the given class is not a super class of the given object).

You may earn 5 extra points by providing an interactive mechanism for pointing at Java Swing objects and invoking your browser on them. Additional extra points may be earned for additional features such as the ability to edit parameters of the objects interactively, the ability to invoke methods (and browse their results, if any), and for providing specialized visualizations for types such as colors, fonts, images, etc.

Please see the Inspector for Amulet which provided these features for Amulet. It was one of the most popular features of Amulet:


Project Alternative 3: Add Constraints to your Structured Graphics Model (Base Score: 95 points)

There are many algorithms for solving a set of constraints. This project would be to take a simple constraint solving model and implement it as part of the structured graphics model of Homework 2. You would allow the programmer to specify constraints among the properties of objects, and then after values change (e.g., due to an Interactor of Homework 3 running) the constraint solver would make sure that all the values were computed correctly based on the constraints, and then cause a redraw.

The base score would be achieved with a fairly limited language in which the constraints could be expressed, e.g., just numbers and simple arithmetic expressions on them. An extra 5 points for allowing arbitrary Java code in the constraints. I can give you guidance on papers which contain constraint solving algorithms.

If you start from an existing implementation of a constraint solver (e.g., you take the solver code out of subArctic or Amulet) and port it to the Homework 3 system, that would start off as 80 points, and for extra credit, you would need to extend either the solver a little or add an interesting way to specify constraints (e.g., an interactive editor or pre-processor).


Project Alternative 4: Add something else cool to your Structured Graphics Model (Base Score: TBD)


Project Alternative 5: Laser Pointer Interaction (Base Score: 95 points)

As part of two recent papers, we started looking at how the laser pointer can be used to interact with objects on the screen. We have the basic laser pointer dot finding code available. However, we did not implement any interaction techniques, and the ones in the literature are pretty poor. This project is to re-implement some existing laser pointer interaction techniques, and hopefully invent some new ones.

Relevant papers:


Project Alternative 6: Roll Your Own (Base Score: TBD)