Ingeborg Endter 10/3/97
Problem set 4
Problem 1. Centered Helvetica
Expanding and Reverting text in this problem repeats
each time "Expand" is pressed. The "Revert" button reverses
the process in stages,
until it arrives at the original form.
In this problem words longer than 5 characters are assumed to
be more important than shorter words.
"Expand" repeats the longer words once each time the
button is pressed.
"Revert" reverses the process as expected.
The same source file is used for both problems. The applet
reads the parameter "problem" from the HTML code.
Problem 2 uses the "expandText" and "revertText" methods, and problem 3
uses the "expandTextMeaning" and "revertTextMeaning" methods.
Both methods keep track of a
counter of the number of transforms. Each time "expand.." is
called, the counter is incremented. Each call to "revert.." decrements
the counter. The contents of the text being
transformed cannot be changed by the user unless the counter is 0, and
the user may begin a new transform at that point.