34
Tool for Sketching Tool for Sketching Statecharts (TSS) Statecharts (TSS) Shahla Almasri ([email protected]) Shahla Almasri ([email protected]) COMP 762B: Modelling and Simulation COMP 762B: Modelling and Simulation Based Design Based Design April 4 April 4 th th , 2005 , 2005

Tool for Sketching Statecharts (TSS) Shahla Almasri ([email protected]) COMP 762B: Modelling and Simulation Based Design April 4 th, 2005 April 4 th,

Embed Size (px)

Citation preview

Page 1: Tool for Sketching Statecharts (TSS) Shahla Almasri (salmas1@cs.mcgill.ca) COMP 762B: Modelling and Simulation Based Design April 4 th, 2005 April 4 th,

Tool for Sketching Tool for Sketching Statecharts (TSS)Statecharts (TSS)Tool for Sketching Tool for Sketching Statecharts (TSS)Statecharts (TSS)Shahla Almasri ([email protected])Shahla Almasri ([email protected])

COMP 762B: Modelling and Simulation Based COMP 762B: Modelling and Simulation Based DesignDesign

April 4April 4thth, 2005, 2005

Page 2: Tool for Sketching Statecharts (TSS) Shahla Almasri (salmas1@cs.mcgill.ca) COMP 762B: Modelling and Simulation Based Design April 4 th, 2005 April 4 th,

Agenda• Implementation Details• SATIN• Introduction to Statecharts• TSS Syntax• Demo• Conclusion• Future work

Page 3: Tool for Sketching Statecharts (TSS) Shahla Almasri (salmas1@cs.mcgill.ca) COMP 762B: Modelling and Simulation Based Design April 4 th, 2005 April 4 th,

Implementation Details• TSS is written in Java using JDK 1.5

and SATIN 2.31.• Can be run on any machine that

has JDK 1.4 or higher.• It can be run using a stylus or a

mouse.

1. Refer to reference [2] for detailed information.

Page 4: Tool for Sketching Statecharts (TSS) Shahla Almasri (salmas1@cs.mcgill.ca) COMP 762B: Modelling and Simulation Based Design April 4 th, 2005 April 4 th,

Agenda• Implementation Details• SATIN• Introduction to Statecharts• TSS Syntax• Demo• Conclusion• Future work

Page 5: Tool for Sketching Statecharts (TSS) Shahla Almasri (salmas1@cs.mcgill.ca) COMP 762B: Modelling and Simulation Based Design April 4 th, 2005 April 4 th,

SATIN• Sketch and Transformational

Infrastructure (http://guir.berkeley.edu/projects/satin/)

• An open-source toolkit for developing informal ink-based applications.

• It only supports 2D applications.

Page 6: Tool for Sketching Statecharts (TSS) Shahla Almasri (salmas1@cs.mcgill.ca) COMP 762B: Modelling and Simulation Based Design April 4 th, 2005 April 4 th,

SATIN (cont.)• Built using JDK 1.3.• SATIN is a layer on top of Swing.

This figure is taken from reference [2].

Page 7: Tool for Sketching Statecharts (TSS) Shahla Almasri (salmas1@cs.mcgill.ca) COMP 762B: Modelling and Simulation Based Design April 4 th, 2005 April 4 th,

SATIN (cont.)• SATIN comes with Quill, which is a

tool for designing gestures for pen-based applications.

• SATIN framework comes with Rubine’s1 recognition algorithm, but other recognition algorithm can easily be plugged in.

1. Dean Rubine. “Specifying Gestures by Examples,” Computer

Graphics. ACM SIGGRAPH’91 Conference Proceedings. 25(3): pp.329-337, July, 1991.

Page 8: Tool for Sketching Statecharts (TSS) Shahla Almasri (salmas1@cs.mcgill.ca) COMP 762B: Modelling and Simulation Based Design April 4 th, 2005 April 4 th,

Agenda• Implementation Details• SATIN• Introduction to Statecharts• TSS Syntax• Demo• Conclusion• Future work

Page 9: Tool for Sketching Statecharts (TSS) Shahla Almasri (salmas1@cs.mcgill.ca) COMP 762B: Modelling and Simulation Based Design April 4 th, 2005 April 4 th,

Introduction to Statecharts

• An extension of finite state automata.

• Invented by David Harel in the late 1980s.

• It was adopted by UML for describing reactive behavior.

Page 10: Tool for Sketching Statecharts (TSS) Shahla Almasri (salmas1@cs.mcgill.ca) COMP 762B: Modelling and Simulation Based Design April 4 th, 2005 April 4 th,

Agenda• Implementation Details• SATIN• Introduction to Statecharts• TSS Syntax• Demo• Conclusion• Future work

Page 11: Tool for Sketching Statecharts (TSS) Shahla Almasri (salmas1@cs.mcgill.ca) COMP 762B: Modelling and Simulation Based Design April 4 th, 2005 April 4 th,

TSS Syntax• Statecharts notations• Supported characters• Supported commands• How gestures are interpreted• Statechart diagram validation

Page 12: Tool for Sketching Statecharts (TSS) Shahla Almasri (salmas1@cs.mcgill.ca) COMP 762B: Modelling and Simulation Based Design April 4 th, 2005 April 4 th,

Statecharts’ Notations

Notation Harel’s TSS

States

Default States

Recognized as state, therefore transformed to

Recognized as default state,

therefore transformed to

Page 13: Tool for Sketching Statecharts (TSS) Shahla Almasri (salmas1@cs.mcgill.ca) COMP 762B: Modelling and Simulation Based Design April 4 th, 2005 April 4 th,

Statecharts’ Notations (cont)

Notation Harel’s TSS

Composite States

Not supporte

d

Orthogonal States

Not supporte

d

Page 14: Tool for Sketching Statecharts (TSS) Shahla Almasri (salmas1@cs.mcgill.ca) COMP 762B: Modelling and Simulation Based Design April 4 th, 2005 April 4 th,

Statecharts’ Notations (cont.)

Notation Harel’s TSS

Transitions

Labels Any character

s

a – z, ., /, [, and ]

Recognized as transition, therefore

transformed to

Page 15: Tool for Sketching Statecharts (TSS) Shahla Almasri (salmas1@cs.mcgill.ca) COMP 762B: Modelling and Simulation Based Design April 4 th, 2005 April 4 th,

Supported Charactersd

e

f

a

b

c

Page 16: Tool for Sketching Statecharts (TSS) Shahla Almasri (salmas1@cs.mcgill.ca) COMP 762B: Modelling and Simulation Based Design April 4 th, 2005 April 4 th,

Supported Characters (cont.)

j

k

l

g

h

i

Page 17: Tool for Sketching Statecharts (TSS) Shahla Almasri (salmas1@cs.mcgill.ca) COMP 762B: Modelling and Simulation Based Design April 4 th, 2005 April 4 th,

Supported Characters (cont.)

p

q

r

m

n

o

Page 18: Tool for Sketching Statecharts (TSS) Shahla Almasri (salmas1@cs.mcgill.ca) COMP 762B: Modelling and Simulation Based Design April 4 th, 2005 April 4 th,

Supported Characters (cont.)

v

w

x

s

t

u

Page 19: Tool for Sketching Statecharts (TSS) Shahla Almasri (salmas1@cs.mcgill.ca) COMP 762B: Modelling and Simulation Based Design April 4 th, 2005 April 4 th,

Supported Characters (cont.)

[

]

/

y

z

. .

Page 20: Tool for Sketching Statecharts (TSS) Shahla Almasri (salmas1@cs.mcgill.ca) COMP 762B: Modelling and Simulation Based Design April 4 th, 2005 April 4 th,

Supported CommandsComman

dGesture Pie Menu

Item

New None Yes

Save None Yes

Open None Yes

Change Color

None Yes

Page 21: Tool for Sketching Statecharts (TSS) Shahla Almasri (salmas1@cs.mcgill.ca) COMP 762B: Modelling and Simulation Based Design April 4 th, 2005 April 4 th,

Supported Commands (cont.)

Command

Gesture Pie Menu Item

Scroll No

Copy Yes

Page 22: Tool for Sketching Statecharts (TSS) Shahla Almasri (salmas1@cs.mcgill.ca) COMP 762B: Modelling and Simulation Based Design April 4 th, 2005 April 4 th,

Supported Commands (cont.)

Command

Gesture Pie Menu Item

Cut Yes

Paste Yes

Page 23: Tool for Sketching Statecharts (TSS) Shahla Almasri (salmas1@cs.mcgill.ca) COMP 762B: Modelling and Simulation Based Design April 4 th, 2005 April 4 th,

Supported Commands (cont.)

Command

Gesture Pie Menu Item

Undo Yes

Redo Yes

Page 24: Tool for Sketching Statecharts (TSS) Shahla Almasri (salmas1@cs.mcgill.ca) COMP 762B: Modelling and Simulation Based Design April 4 th, 2005 April 4 th,

Supported Commands (cont.)

Command

Gesture Pie Menu Item

Delete Yes

Edit Labels

No

Page 25: Tool for Sketching Statecharts (TSS) Shahla Almasri (salmas1@cs.mcgill.ca) COMP 762B: Modelling and Simulation Based Design April 4 th, 2005 April 4 th,

How interpretation works

Page 26: Tool for Sketching Statecharts (TSS) Shahla Almasri (salmas1@cs.mcgill.ca) COMP 762B: Modelling and Simulation Based Design April 4 th, 2005 April 4 th,

Statechart Diagram Validation

• A valid statechart diagram has to have a default state.

Page 27: Tool for Sketching Statecharts (TSS) Shahla Almasri (salmas1@cs.mcgill.ca) COMP 762B: Modelling and Simulation Based Design April 4 th, 2005 April 4 th,

Agenda• Implementation Details• SATIN• Introduction to Statecharts• TSS Syntax• Demo• Conclusion• Future work

Page 28: Tool for Sketching Statecharts (TSS) Shahla Almasri (salmas1@cs.mcgill.ca) COMP 762B: Modelling and Simulation Based Design April 4 th, 2005 April 4 th,

Demo

Page 29: Tool for Sketching Statecharts (TSS) Shahla Almasri (salmas1@cs.mcgill.ca) COMP 762B: Modelling and Simulation Based Design April 4 th, 2005 April 4 th,

Conclusion• SATIN saves time by providing a

concrete framework for pen-based applications.

• It provides many of the common features in pen-based applications

Page 30: Tool for Sketching Statecharts (TSS) Shahla Almasri (salmas1@cs.mcgill.ca) COMP 762B: Modelling and Simulation Based Design April 4 th, 2005 April 4 th,

Conclusion• It is hard to design gestures that

are easy to learn by humans and easy to recognize by computers1.

• Studies found that users who are used to using PDAs are better at designing “good” gestures1.

1. Refer to reference [3].

Page 31: Tool for Sketching Statecharts (TSS) Shahla Almasri (salmas1@cs.mcgill.ca) COMP 762B: Modelling and Simulation Based Design April 4 th, 2005 April 4 th,

Remaining work• Fix some known bugs:

– Cannot edit transitions’ labels.– When opening a saved file,

transitions’ labels do not show up.– Non-recognized objects are not saved.– Cannot select labels.– Moving, resizing, and deleting states

and transitions don’t always work.• Write the report.

Page 32: Tool for Sketching Statecharts (TSS) Shahla Almasri (salmas1@cs.mcgill.ca) COMP 762B: Modelling and Simulation Based Design April 4 th, 2005 April 4 th,

Future work• Support composite and orthogonal

states.• Keep transitions the way they

were drawn.

Page 33: Tool for Sketching Statecharts (TSS) Shahla Almasri (salmas1@cs.mcgill.ca) COMP 762B: Modelling and Simulation Based Design April 4 th, 2005 April 4 th,

References[1] David Harel, “Statecharts: a visual

formalism for complex system,” Science Computer Program, Vol 8, pp 231-274, 1987.

[2] Jason I. Hong and James A. Landay, "SATIN: A Toolkit for Informal Ink-based Applications." In UIST 2000, ACM Symposium on User Interface Software and Technology, CHI Letters , 2(2), p. 63-72.

Page 34: Tool for Sketching Statecharts (TSS) Shahla Almasri (salmas1@cs.mcgill.ca) COMP 762B: Modelling and Simulation Based Design April 4 th, 2005 April 4 th,

References (cont.)[3] Allan Christian Long, Jr., James A.

Landay, and Lawrence A. Rowe, "Implications for a Gesture Design Tool." In Proceedings of Human Factors in Computer Systems: CHI 99, Pittsburgh, PA, May 15-20, 1999, pp. 40-47.