![]() |
ANU College of Engineering and Computer Science
School of Computer Science
|
|
|
Java InteractionThe main objective of this lab is to understand some of the issues surrounding user interaction in a graphical Java application. The application you will modify and extend is a simple drawing program.Step 1 (3 marks)Obtain a copy of DrawIt.java and DrawArea.java which form a simple drawing program. Compile and run it("javac *.java; java DrawIt"). When you drag the mouse around the screen single pixels will be marked by the dragging action.Examine the code to understand what each line does. Note that, when this lab is marked you may be asked to explain parts of this code. Modify the code such that it draws a continuous line. Add menu items (or buttons) that enable you to change the: colour, thickness, and transparency of the line. Step 2 (2 mark)Add to your drawing program to enable it to draw with a number of other options including: smudge, spray paint, and area flood fill. Also add an addition option of your own choosing. e.g. erase, melt, lens effects, text, ...Step 3 (1 mark)Modify the program so that it is a vector drawing program rather than a image painting program. This will involve basically removing the options from the second step, so it is worth creating a new project so you have both for marking purposes. Your vector program only needs to be able to draw lines.This step will involve creating classes that can store a set of lines. Also you need to have an edit option so that existing lines can be repositioned. This will involve being able to select lines, adding move boxes to the ends of the line then a drag action will reposition the line. | |||||||||||||||||||||||||||||||||||||||||||||
|
Please direct all enquiries to: ericm@cs.anu.edu.au Page authorised by: Head of School, SoCS |
| The Australian National University — CRICOS Provider Number 00120C |