05-830, User Interface Software, Spring, 2017

Homework 3: Design and Implement an Input Model for your Retained Object System

18% of grade. Tuesday, Feb. 14, 2017 - Thursday, Mar. 9, 2017, 1:30pm

The goal of this assignment is to add input handling to your retained object model. This will allow the mouse the be used to manipulate the graphical objects. As discussed in lecture, input is one of the least-researched parts of toolkits, and there are basically only three models to choose from. It would be neat if you invented a new one (it might even be a research contribution worthy of publication). The models are:

  1. The Garnet-Amulet "Interactor" model, which might better be called a "behavior object" model.
  2. The SubArctic model, with multiple levels of "focus policies" and "dispatch agents".
  3. The Java model (also used in Visual Basic, etc.), where each individual graphical object has to directly handle all relevant input events (mouse down, up, etc.)

For this assignment, you are expected to use the first one, #1. (If you have a strong reason for using a different one, you can discuss this with the professor.) For #1, I provide an implementation guide on a design you might use for Interactors to go with the Retained Object design used for assignment #2. This design is in another file.


The requirements for your implementation include:

Drawing Editor

For the last part of the assignment, you will use your GraphicalObjects and behavior objects to create a simple drawing editor. The editor should have the following features, at a minimum:

The user interface is up to you. Most drawing editors use a tool palette to switch between creating lines and rectangles. You can do this with Swing widgets if you want, or you can create a trivial widget out of the behavior objects and graphics (but don't spend much time on it), or (under Swing) you can even just use keyboard modifiers -- e.g., shift-drag to create lines, plain drag to create rectangles. (Note that you will be making widgets for the last homework, so don't spend much time on creating widgets now). If it isn't obvious how to use your editor, be sure to display Text objects that document it, preferably outside the drawing area.

Extra Credit

For extra credit, you can implement more selectable objects, more behaviors, or more features in your drawing editor. Here are some ideas.

Selectable objects:



Drawing editor features:

See the detailed discussion for the design with behavior objects for further ideas and information.

As always, we will probably end up refining this design as you work on the assignment.

Back to Homework Overview
Back to 05-830 main page