Object-Oriented Software Engineering

Object-Oriented Software Engineering


CS 319

OBJECT-ORIENTED SOFTWARE ENGINEERING

ANALYSIS REPORT

FIGURE DRAWING TOOL

GROUP 6

INSTRUCTOR: Uğur DOĞRUSÖZ

GROUP MEMBERS:

Aykut Selçuk ÖZKAT

Mert ÖZDAL

Ebrahim RAJABZADEH

Talha SOYSAL

İsmail Hakkı ÖZTÜRK

31.10.2008

Table of Contents

1.Introduction

1.1.Vision

1.2.What is Joodle?

1.3.Reasons for choosing Joodle

1.4.Characteristic Features

2.Overview

3.Requirements

3.1.Functional Requirements

3.2.Nonfunctional Requirements

4.System Models

4.1.Domain Analysis

4.2.Use Case Analysis

4.3.Sequence Diagrams

4.3.1.Draw a Rectangle Sequence Diagram

4.3.2.Group Selected Shapes Sequence Diagram

4.3.3.Copy Selected Shapes Sequence Diagram

4.3.4.Scale a Rectangle Sequence Diagram

4.3.5.Select Shapes (by Drawing a Selection Rectangle) Sequence Diagram

4.3.6.Select Shapes (by Drawing a Selection Rectangle) Sequence Diagram

4.4.Activity Diagrams

4.4.1.Creator Tool Activity

4.4.2.Shape Selection Activity

4.4.3.Shape Editing Activity

5.Screen Mock-Ups

6.Conclusion

1.Introduction

1.1.Vision

Our aim is to develop a easy-to-use application for creating and editing vector graphics. For this purpose, we will practice Agile software methodology and iterative development.

1.2.What is Joodle?

The main purpose of a vector graphics tool is to create basic shapes and perform certain editing operations on them. Generally, figure drawing tools have a canvas on which the user executes operations and a simple interface suitable for carrying out simple commands and allows the user to focus on the canvas. Therefore, the basic requirement for a figure drawing tool will be a simple, effective and easy-to-use interface.

A useful and effective figure drawing tool should be able to draw shapes at least. The user can create basic shapes, composite shapes by the help of basic shapes or any text. Our program will enable the user to draw shapes and edit them as he/she desires with the use of our panel which includes creating and editing buttons. Also, those shapes can be grouped, edited, moved, rotated, etc. There are many attributes such as line width, color, line style, etc. for shapes and texts.

1.3.Reasons for choosing Joodle

The most important reason for us to choose this project was to implement our project in an Object-Oriented approach so that we could get a deeper understanding on how to use Object-Oriented Architecture. Firstly, we decided that, figure drawing tool is a great opportunity for us to test our abilities and expand our knowledge about the general concept of the Object-Oriented approach. As a group, we believe that we can create an understandable project by using Object oriented approach . Another aim is to develop an original drawing tool that is user-friendly and has features that makes it different from other ordinary drawing tools. We thought that creating a figure drawing tool like this will both be fun and educative. Therefore, we had chosen figure drawing tool as our project and we are happy to see that that was really a good decision.

1.4.Characteristic Features

We are spending most of our effort to make Joodle simple, reliable and easy to use. Joodle supports additional shapes to be added through a plug-in mechanism. This enhances its usability and makes it highly customizable. Its simple user-interface is another reason why Joodle can stand out as a pleasure to work with.

2.Overview

Firstly, we will give information about the functional and non-functional requirements for our program. That section will include the most essential properties of figure drawing tools, both technical and non-technical. Afterwards, we will explain our system models in detail with the help of our use cases, scenarios, sequence and activity diagrams. We will show our mock-up screenshots of Joodle and try to create an idea what the user interface of Joodle will be like. Finally, we will finish our analysis report with the experiences we had while working on the analysis of our project.

3.Requirements

3.1.Functional Requirements

User will be able to;

  • Draw Shapes

Joodle provides user drawing lines, rectangles, squares, ellipses, circles and many others through its Add-On option. Moreover, Joodle also provides adding texts to the canvas by the user.

  • Group multiple shapes

By using Joodle’s grouping property, user can easily treat multiple shapes as one shape by selecting one or more of them on the canvas.

  • Edit drawn shapes

Joodle’s versatile editing tool provides user editing, moving and rotating shapes on the canvas. By this functionality, user can remodel shapes through his request, move them to around the canvas, and rotate them with respect to some particular angles.

  • Copy / Delete one or more shapes

According to this property, user can copy/delete one or more shapes by firstly selecting them holding CTRL key from the keyboard and clicking any point on their boundaries, or using selection rectangle; then clicking copy/delete button on the editing tool.

  • Save drawings as plain-text XML (SVG) files

User will be able to save his sketches using save option of the Joodle. Furthermore, drawings should be preserved as plain-text XML (SVG) files after name verification on the file name entered by the user and control of the required memory space.

  • Load previously saved files for editing the drawings

Joodle enables user to load previously saved files for editing his drawings. Moreover, Joodle also includes file extension checking for this option.

  • Export drawings

Joodle enables the user to export their drawings to raster images. The supported image formats include bmp, jpeg and png.

  • Change attributes of the shapes

By this property, user will be able to modify line width and line style, change line color and fill color. In brief, user will generate his desired shapes by altering such attributes of the shapes.

  • Get help via on-demand help

By the help option of the Joodle, user will obtain sufficient information about all of the shapes, how to generate them, and what kinds of features the editing tool provides.

3.2.Nonfunctional Requirements

The most important non-functional requirements of Joodle are:

  • Simplicity of the User Interface

Joodle will have a simple and understandable user interface. The targeted users of this application may include lay-person with no technical background. Therefore we will try to make Joodle as simple and straightforward as possible.

  • Reliability and infrequency of crashes

We will do our best to minimize the program crashes. In exceptional circumstances user will be notified, his current document will be saved and he will be presented with the options to continue using the program and/or file a complaint with the support staff.

  • Although not an essential part of the functionality of the program, logging facilities will be employed throughout the program to ease the debugging and troubleshooting process.
  • Internationalization

In line with our policy of broadening Joodle’s audience, we will provide multiple languages in the user interface. These languages will include, but not limited to, US English and Turkish.

4.System Models

4.1.Domain Analysis

Figure 1: Domain Analysis [click to enlarge]

Canvas: Canvas is the big white board on which the user makes all the desirable operations. It has a coordinate system which enables the shapes to be drawn. Moreover, it comes empty in the beginning of the program besides these; the shapes are drawn and edited on this board. Canvas is the element that is responsible for responding to requested operations such as generating new shape(s), editing the existing shape(s) and selecting them. That is, canvas is in communication with EditTool, CreateTool, and SelectTool and contains zero or more shapes.

CreateTool: CreateTool is a button group on which our shapes reside. Drawing requests are handled from this class and it includes properties for each of the shapes such as required number of points in order to draw rectangles, circles, ellipses, squares and many others. Therefore, we can easily say that the user clicks on one of the shape icons and then draws it on the canvas by putting required points on the canvas. That is, CreateTool is in communication with Shape and Canvas.

EditTool: EditTool is a button group on which our shape editing methodologies reside. These editing methodologies are edit, move, copy, delete, rotate right, rotate left and scale. The user clicks one of the tools; then can edit the shapes that are assumed to be drawn before. These changes can be seen on canvas. Therefore, EditTool class is in communication with Canvas and Shape.

SelectTool: SelectTool is a button group on which our Group/Ungroup and Mouse selection buttons reside. Mouse mode is a mode in which the user can wander around canvas without making a change. Group/Ungroup button requires the user selects multiple shapes in order to group/ungroup them and then by clicking on the button executes the action. These changes such as grouping, take place in canvas as the selected shapes are shown as one shape. Therefore, SelectTool class is also in communication with Shape and Canvas.

Shape: Shape is an element which represents the basic shapes such as lines, rectangles, squares, ellipses, circles and many others. These shapes have the property “point” for the coordinate system which canvas has. The point represents the coordinate points on which the shape takes place. It also has the knowledge of the required points for a shape. Since it is the primary element of our program, this element has the communication with all of other elements.

Attribute: This class contains the attributes of shape elements. It has five properties: color, fillColor, font, lineWidth and lineStyle. Color is the attribute which contains the information of the border color of a shape; whereas, fillColor is the attribute which contains the information of the filling color of a shape. Font is a property which has the knowledge of the type of the text. LineWidth is the property containing the information of the width of the line that constitutes the borders of any shape. Lastly, lineStyle is the property which has the information based on the style of the borders of a shape. Therefore, it is only responsible for Shape element; in brief, Shape element has a relationship with Attribute class.

4.2.Use Case Analysis

The core capabilities of Joodle are captured in the following diagram. Among these are the basic load/save operations of the drawings as well as creation, selection and editing tools discussed in more details in the following sections.

Figure 2: Use Case Diagram 1

Figure 3: Draw a Shape Use Case Diagram

Use Case UC1: Draw a Shape

Scope: Joodle Drawing Tool

Primary actor: User

Level: User Goal

Stakeholders and Interests:

  • User: Wants to draw a new shape on the canvas

Preconditions: User has selected a shape creation tool from the tool bar.

Success Guarantee: New shape is added to the canvas.

Main Success Scenario:

1. User selects a shape-creation tool from the left toolbar.

2. User sets the line width and style in the bottom toolbar.

3. User selects a point on the canvas by clicking on it.

User repeats step 3 until there are sufficient dots to draw the chosen shape.

4. Chosen shape is drawn on the canvas.

Extensions:

3.a. At any time during step 3, if the user presses ESC key

1. Drawing operation is cancelled.

2. The previous points are deleted.

Use Case UC2: Edit a Shape

Figure 4: Edit A Shape Use Case Diagram

Scope: Joodle Drawing Tool

Primary actor: User

Level: User Goal

Stakeholders and Interests:

  • User: Wants to edit a shape

Preconditions: There has to be at least one shape on the canvas.

Success Guarantee: The chosen shape is edited.

Main Success Scenario:

1. User selects an editing tool from the left toolbar.

2. User selects a point on the shape.

3. User moves the mouse. The shape changes accordingly.

User repeats step 3 until there are sufficient dots to draw the chosen shape.

Extensions:

3.a. User selects another tool, while selecting points on the canvas

1. Editing operation is cancelled.

2. The previous points are deleted.

Use Case UC3: Copy a Shape/Shapes

Scope: Joodle Drawing Tool

Primary actor: User

Level: User Goal

Stakeholders and Interests:

  • User: Wants to copy a shape or shapes which are on the canvas

Preconditions: There has to be at least one shape on the canvas.

Success Guarantee: Copies of the selected shape/shapes are inserted on the canvas.

Main Success Scenario:

  1. User presses Copy button on the left toolbar.
  2. User chooses a shape by clicking to a point of the shape or multiple shapes by holding the CTRL button.
  3. A copy of the selected shape/shapes are inserted on the canvas at a point that user chooses by clicking.
  4. The original shape or shapes remain selected.

Extensions:

2.a. User pressed ESC button before selecting the copy position on the canvas

1. The shape/shapes are not copied.

2. Selection focus is removed.

Use Case UC4: Delete a Shape/Shapes

Scope: Joodle Drawing Tool

Primary actor: User

Level: User Goal

Stakeholders and Interests:

  • User: Wants to delete a shape or shapes which are on the canvas

Preconditions: There has to be at least one shape on the canvas.

Success Guarantee: Selected shape or shapes are removed from the canvas.

Main Success Scenario:

1. User presses Delete button on the left toolbar.

2. User chooses a shape by clicking to a point of the shape or multiple shapes by holding the CTRL button.

3. The selected shape/shapes are deleted from the canvas.

Extensions:

2.a. During the selection of multiple shapes if the user presses ESC button

1. The shapes are not deleted.

2. Selection focus is removed.

Use Case UC5: Group Shapes

Scope: Joodle Drawing Tool

Primary actor: User

Level: User Goal

Stakeholders and Interests:

  • User: Wants to group shapes which are on the canvas

Preconditions: User has selected more than one shape.

Success Guarantee: Selected shapes are combined into one shape.

Main Success Scenario:

1. User presses Group button on the left toolbar.

2. The selected shapes are combined into one shape.

3. The resulting shape is assigned to be not selected.

Use Case UC6: Ungroup a Composite Shapes

Scope: Joodle Drawing Tool

Primary actor: User

Level: User Goal

Stakeholders and Interests:

  • User: Wants to ungroup composite shapes

Preconditions: One or more composite shapes are selected.

Success Guarantee: Composite shapes are separated into their composing shapes and added to the canvas.

Main Success Scenario:

1. User disables Group button on the left toolbar.

2. Selected composite shape is divided into its component shapes.

3. The resulting shapes are added to the canvas as each of them separately.

Use Case UC7: Select a Shape/Shapes

Scope: Joodle Drawing Tool

Primary actor: User

Level: User Goal

Stakeholders and Interests:

  • User: Wants to select a shape or shapes

Preconditions: -

Success Guarantee: One or more shapes are selected.

Main Success Scenario:

1. User chooses a selection tool from the left toolbar.

2. User selects a shape by clicking on it.

3. User holds the CTRL key and clicks to another shape.

4. The shape is added to the selection.

User can repeat step 3 for other shapes.

Extensions:

3.a. Any time user clicks on canvas

1. The previous selection is cleared.

Variations:

2-3.a.

1. User clicks on a point on canvas.

2. User clicks on another point on canvas.

3. All the shapes that are enclosed in the rectangle are selected.

Use Case UC8: Save a Drawing

Scope: Joodle Drawing Tool

Primary actor: User

Level: User Goal

Stakeholders and Interests:

  • User: Wants to save a drawing.

Success Guarantee: Drawing is saved as a plain-text XML file.

Main Success Scenario:

1. User chooses Save option from the File menu.

2. A dialog box appears that asks for the directory and name of the file.

3. User enters file name and file directory.

4. User presses OK button.

5. File is saved on the disk.

Extensions:

2.a. User cancels the dialog box.

1. Dialog box is disappeared.

2. Drawing is not saved.

3.a. Disk space is not enough.

1. Drawing is not saved.

3.b. File name is not valid.

1. An error dialog box is shown to the user and the same dialog box is shown again.

Use Case UC9: Load a Drawing

Scope: Joodle Drawing Tool

Primary actor: User

Level: User Goal

Stakeholders and Interests:

  • User: Wants to load a drawing on the computer.

Success Guarantee: Drawing is loaded and appeared to the screen.

Main Success Scenario:

1. User chooses Open option from the File menu.

2. A dialog box asks user for the directory and name of the file.

3. User selects the file.

4. User presses OK button.

5. Current shapes on the canvas are removed and the shapes on the file are added to canvas.

Extensions:

2.a. User cancels the dialog box.

1. Dialog box is disappeared.

2. Drawing is not loaded.

3.a. File name is not valid.

1. An error dialog box is shown to the user and dialog box is shown again.

3.b. File type is not valid.

1. An error dialog box is shown to the user and dialog box is shown again.

Use Case UC10: Change Settings

Scope: Joodle Drawing Tool

Primary actor: User

Level: User Goal

Stakeholders and Interests:

  • User: Wants to change the settings of the program

Success Guarantee: Settings are changed with respect to user’s request