Modelling a Drawing Tool with Statecharts

COMP-522    Fall 2004
Shahla Almasri (salmas1@cs.mcgill.ca)

Proposal

The proposal can be found here.

Report

The report can be found here.

Source Code

Starting Point

1.

drawingTool.py

Python code for the tool

2.

draw.py

Statechart model

3.

draw.jpg

Image of the Statechart model

4.

Circle.gif

Circle image

5.

Rectangle.gif

Rectangle image

6.

Triangle.gif

Triangle image

Prototype

1.

drawingTool3.py

Python code for the tool (GUI controller)

2.

Shape.py

Shape class, which encapsulates all information about a shape on the canvas

3.

DrawingToolStatechart_mdl.py

Statechart model

4.

DrawingToolStatechart.des

Generated .des file

5.

DrawingToolStatechart.py

Python code generated from DrawingToolStatechart_mdl.py

6.

Circle.gif

Circle image

7.

Rectangle.gif

Rectangle image

8.

Triangle.gif

Triangle image

9.

start.bat

Script to run the tool. 
**Note:
- When used on Windows, the script assumes that scc binary is installed and its absolute path has been added to the system's PATH variable.
- When used on UNIX, the script assumes that /usr/local/pkgs/atom3-central/External/SVM has been added to the user's PATH.

Final Implementation

1.

drawingTool3.py

Python code for the tool (GUI controller)

2.

Globals.py

Global variables shared between classes

3.

Shape.py

Shape class, which encapsulates all information about a shape on the canvas

4.

DrawingToolStatechart_mdl.py

Statechart model

5.

DrawingToolStatechart.des

Generated .des file

6.

DrawingToolStatechart.py

Python code generated from DrawingToolStatechart_mdl.py

7.

Button.py

Button class. It acts like a controller for the Button's statechart.

8.

ButttoStatechart_mdl.py

Statechart model for a button

9.

ButtonStatechart.des

Generated .des file

10.

ButtonStatechart.py

Generated Python code

11.

RadioButton.py

RadioButton class. It acts like a controller for the RadioButton's statechart.

12.

RadioButttoStatechart_mdl.py

Statechart model for a radio button

13.

RadioButtonStatechart.des

Generated .des file

14.

RadioButtonStatechart.py

Generated Python code

15.

Circle.gif

Circle image

16.

Rectangle.gif

Rectangle image

17.

Triangle.gif

Triangle image

18.

start.bat

Script to run the tool. 
**Note:
- When used on Windows, the script assumes that scc binary is installed and its absolute path has been added to the system's PATH variable.
- When used on UNIX, the script assumes that /usr/local/pkgs/atom3-central/External/SVM has been added to the user's PATH.

 

Presentation

In-class presentation: presentation.pdf / presentation.ppt

 

References

·        David Harel, “On Visual Formalism”,  Communication of the ACM, 1998, Pages 514-530.
http://portal.acm.org/citation.cfm?doid=42411.42414

·        Huining Feng, “DCharts, A Formalism For Modeling and Simulation Based Design of Reactive Software Systems”, Master Thesis, McGill University, February 2004.
http://moncs.cs.mcgill.ca/people/tfeng/thesis/thesis.html