cs349 - s10 - Lecture 20

CS349 - Implementing User Interfaces - Spring 2010

Public Service Annoucements

  1. Mid-term: 17 June, 2010, MC4059.

Lecture 20 - Constructing an Interface from Components

Making an Interface out of Components (in Java)

Start with a container widget

Add components one by one, using the container's add method.

Components that get events get them through Listener interfaces

Components can communicate in two ways

  1. Some components create events, which can be listened for in other widgets.
  2. Components can call each other's methods.

The important structure of a Java interface is the structure that determines the flow of information from the user to the presentation. Inter-component communication controls the flow of information.

Call the show method of the highest level container to complete the initialization

Occasionally you want to change the appearance of a component in response to an event

  1. Change the paint method.
  2. Call paint, repaint or update.

Typical Components

Trend is to abstract components, which encapsulate affordances independently of presentation.

From Java AWT

As a self-test, to see if you are getting the essence of each component, try identifying

  1. Aspects of the component that implement the parts of a dialogue,
  2. Aspects of the component that implement Olsen's presentation components.

Look-and-feel: layout

Your program puts components into the interface. What can it specify?

These create geometric patterns, with which users have strong associations. How do you get this right?

The twenty-first century has provided surprises

Layout was supposed to be the solution

Look-and-feel: customizing components

Customization of component sets is common, especially on major UI projects.

When you are going through this process you are designing a new - or modified - look-and-feel for your interface.

(Hints. 1. `Unique' is put in here as a deliberately bad descriptor. 2. The answer should prominentaly include the word `gratuitous'.)

Three questions must be answered.

  1. Who does the customization?
  2. What is the context of customization?
  3. What is the mechanism of customization?

Who does the customization?


Interface programmer

Platform on which the interface runs

What is the context of customization?

These questions get answered in a variety of contexts. Each context may provide some customization, and there may be conflicts between the needs of different contexts

  1. component-specific
  2. container-wide
  3. document-wide
  4. application-wide
  5. system-wide
  6. manufacturer-wide
  7. country-wide

The country-wide context experienced a very large amount of research and attempted innovation during the 1990s. The issue was `internationalization': how do you make an interface that works for groups of peole who come to it from different languages, cultures and political systems. It is now called `localization' and appears screwed up almost everywhere.

Sometimes there are contradictions and inconsistencies

If the contexts form a hierarchy?

If the contexts don't form a hierarchy?

There are two conditions that any successful solution must obey.

  1. Understandable to the user.
  2. Understandable to the programmer.

Two options for implementing this in practice

  1. initialization files, at the mercy of a set of rules for finding them,
  2. resource forks, at the mercy of update operations.

There is, at present, no acknowledged solution for this problem. There are two practical approaches

  1. Open systems (Apple -> Sun)
  2. My way or the highway (Stone age IBM -> Microsoft)

    Solution by fiat, IBM: `Let them learn EBCDIC', Microsoft: `Let them learn English.' E.g.,

What is the mechanism of customization?



  1. Environment variables
  2. .rc files
  3. Resource forks
  4. Resource files: special names, special places

How do they work in practice

An Example of Customization - Colour

Cultural meanings of colour

Different cultures assign different meanings to the same colour.

Even lack of colour means different things in different cultures.

Basic science of colour - Berlin and Kay


Having read this, what do you know about using colour in an internationalized interface?

Specific meanings associated with colour need to be changed from culture to culture. Possibly overall graphic design as well.

Return to: