Homework Assignment 8 (Servlet project continued)

Deadline: 20/6.

What to submit: a WAR file (as in Homework 7).

1. Live Paint with rotations.

For this exercise you are allowed (and expected) to re-use your code for Live Paint (HW 7). Alternatively, you can use the code posted on the class web page.

For this exercise you have to extend the live paint program so that it can rotate images by 90 degrees clockwise or counter-clockwise. In particular, you need to add the following four buttons to the user interface.

Requirements:

  1. Two buttons labeled "Rotate image left" and "Rotate image right". When such a button is clicked the image should be appropriately rotated. This should immediately become visible to all users.
  2. Two buttons labeled "Rotate view left" and "Rotate view right". When such a button is clicked the image should be appropriately rotated only for the current user. This should have no effect to other users.

Extra requirement: when a user rotates his own view, all his subsequent actions should be automatically translated to the correct image. For example, if a user rotates his own view 90 degrees and then draws a vertical line, all other users should see a horizontal line being drawn.