The Simpledraw applet allows users to draw rectangles ...



Applet Project Paper

By

Saowaphak Sasanus

Tatiana Chtchourakova

Xu Zhang

Proposed to

Prof. Peter Brusilovsky

For InFSCI 2470: Interactive System Design

Link to applet:

>

This Simpledraw applet allows users to draw rectangles, ellipses, lines, and arrows.

[pic]

User can interact with the applet to choose shapes, to move them, to delete chosen shapes, to add text, to change color of lines, and color of background.

[pic]

This applet demonstrates several GUI components that facilitate data entry by user and formatting data outputs to the user. There are three menus (File, Edit, and Help menus),

[pic] [pic]

two sets of buttons with icons( “Draw Mode”, “Geometries”), text field and label that indicates a purpose of the text field. Tool tips show purpose of each GUI component. All these GUI components enable user to interact with Simpledraw applet.

To draw, user should:

• decide which shape he wants to draw by choosing one of four buttons,

• click on “DRAW” button,

• drag the mouse on the applet.

To add another shape, whole procedure should be repeated: chose shape, click “DRAW” button, and drag mouse.

To interact with drawing shapes user should

• activate chosen shape, by clicking on it,

• chosen shape changes it’s color (feedback)

[pic]

• buttons “MOVE”, “RESIZE”, “ADD TEXT”, “COLOR”, and “DELETE” will be activated when chosen shape is activated,

• user can choose, what action will be performed.

• to change color of background, item “Color of Background” from Edit menu can be used.

• To change color of line, “Choosier of Color” (Color button) can be used.

The Simpledraw applet speaks the user language, and uses simple and natural dialog, but if user will have the difficulties to understand some functions, he could use Help menu.

Description of Classes:

1. Public class Simpledraw – defines GUI components that will be used in applet: create panels, container, buttons, menus, labels, text field; adds actionListener to these components, describes what actions should be performed, if some events will occur.

2. Private class ButtonHandler – to deal all the buttons’ action..

3. Private class ShapePanel – Provides a draw panel and defines private variables for coordinates of chosen shapes, adds actionListeners to the text field, to mouse, and describes what actions should be performed with some events (mouse-pressed, mouse-clicked, mouse-dragged).

4. Public class ArrowLine (file ArrowLine.java) – extends MyLine class, and uses features of the Graphics2D class and methods from Math package to draw arrow.

5. Public class MyLine (file MyLine.java) – extends Line2D.Double from java.awt.geom.*. Methods for move, resize, set text, draw are used in this class.

6. Public class MyShape (file MyShape.java) extends Shape class from java.awt.*

package, uses methods draw, move, resize, delete, color and addtext.

7. Public class MyEllipse (file MyEllipse.java) – extends Ellipse2D.Double from java,awt.geom.* package, uses features of the Ellipae2D, Graphics2D classes.

8. Public class MyRect (file MyRect.java)—extends Rectangle2D.Double from java.awt.geaom.* Uses methods to move, resize, color, addtext, delete and draw.

Team members: Saowaphak Sasanus, Tatiana Chtchourakova, Xu Zhang.

Distribution of this project,

Tatiana Chtchourakova:

1. Two pages project report.

2. Writing of the Function of Edit Color.

3. All of drop down Menus.

Saowaphak Sasanus:

1. All of the GIF file for function buttons and geometric image buttons.

2. Writing function of all of dropdown menus, and part of buttons

3. Writing program for part of the function, clear, changing object color and background color.

Xu Zhang:

1. Coding most of the class ‘s functions.

2. Design of the applet interfac

3. Two pages project report.

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download