CD-Edit a constraint diagrams editor

21
CD-Edit a constraint diagrams editor Yan Sorkin Supervisor: Dr. Joseph (Yossi) Gil

description

CD-Edit a constraint diagrams editor. Yan Sorkin Supervisor: Dr. Joseph (Yossi) Gil. Outline. Introduction Constraint diagrams Human factor aspects of CD-Edit CD-Edit implementation A short demo. What are Constraint Diagrams?. A visual language, dealing with sets - PowerPoint PPT Presentation

Transcript of CD-Edit a constraint diagrams editor

Page 1: CD-Edit a constraint diagrams editor

CD-Edit

a constraint diagrams editor

Yan SorkinSupervisor: Dr. Joseph (Yossi) Gil

Page 2: CD-Edit a constraint diagrams editor

IntroductionConstraint diagramsHuman factor aspects of CD-EditCD-Edit implementationA short demo

Outline

Page 3: CD-Edit a constraint diagrams editor

A visual language, dealing with sets Intuitive: replaces textual notations Familiar: based on Venn diagrams and Euler

circles Expressive: solve many of the topological

restrictions of Venn diagrams

Scope: system and class invariants

www.cs.technion.ac.il/users/ssdl

FOR MORE INFO...

What are Constraint Diagrams?

Page 4: CD-Edit a constraint diagrams editor

CD-Edit does syntactical checking (not semantics)Just like a syntax directed editor, but for a visual languageUsed for documentation and/or checking purposes

Programming Language

Checking Tool (compiler)Editing Tool

syntaxprogram

semantics

CD-Edit as an editing tool

Page 5: CD-Edit a constraint diagrams editor

Objectives

Develop a useful and practical editing tool

Language-driven user interfaceSupport as many language features as

possibleProvide for future syntax extensionsSupport conversion to common graphic

formatsInterface with external tools

Page 6: CD-Edit a constraint diagrams editor

Constraint Diagrams

Defined by J.Gil, J.Howse and S.KentDivided into three sub-languages in order

of increasing of diagrams’ complexity: Venn diagrams (contours and zones) Spider diagrams (spiders, ties and strands) Constraint diagrams (arrows and wildcards)

Before CD-Edit were created using Visio

Page 7: CD-Edit a constraint diagrams editor

Rectangular contours are classes containment means

inheritance intersection means

common derivatives EngineerManager

Employee

Secretary

A Constraint Diagram…

This, and all other drawings, were generated, and embedded into the PowerPoint presentation as an OLE with CD-Edit!

Page 8: CD-Edit a constraint diagrams editor

Rounded rectangles are states identified with the set of all objects in

this state

Full Half-way

Stack

Emptyall stacks are either empty,

full or half-way.

Another Constraint Diagram...

Page 9: CD-Edit a constraint diagrams editor

King Henry VIII marriage …

Royalty

KingQueen

(executed)henri_viii

married

Page 10: CD-Edit a constraint diagrams editor

Contours: classes, states, ad-hoc, projectionsSpiders: existential, universal, Schroedinger,

givenTies and strandsZones: connected, unconnectedArrowsNull link (ground) symbolLabels: for zones, contours, spiders, arrows

Components of the Notation

Page 11: CD-Edit a constraint diagrams editor

Ties and Strands

Denote the relationship of elements in d, a and b may be the same in h, d and c must be the same

d h

A

C

B E

F

D

b

a

c

d

Page 12: CD-Edit a constraint diagrams editor

The Multiple Perspectives Dilemma:Visual vs. Topological vs. Logical

Visual objects: Editing is visual: each shape is manipulated by

itself Semantics is topological: topology is determined

by the inter-relationships between shapes Semantics is logical: binding of labels to objects,

the definition of zones, etc.Examples

A zone is a logical, not an a topological entity Moving a contour may invalidate a zone What is the label of a spider created out of two? Can we create an arrow emanating from nothing

and then reconnect it?

Page 13: CD-Edit a constraint diagrams editor

Adhere to a small set of principles

Lots of experimentation: extensive user feedback

Analysis of existing tools: Visio and Office

Literature…

Meeting the challenge

Page 14: CD-Edit a constraint diagrams editor

CD-Edit Implementation

Object Oriented DesignC++Windows NTMicrosoft Visual StudioMicrosoft Foundation Classes (MFC)Object Linking and Embedding (OLE)

Page 15: CD-Edit a constraint diagrams editor

current pagepages

diagramundo

DiagramDocDiagramView view

DiagramPage

Diagram

redo

* *

*

*

page

Data Structures

Page 16: CD-Edit a constraint diagrams editor

Document Page Diagram

View

pages

current page

diagram

undo

redo

views page

Data Structures (continued)

PagesDoceCurrentPagDocDoc .., eCurrentPagDocPageViewView ..,

RedoPageUndoPagePage ..,

Page 17: CD-Edit a constraint diagrams editor

Optimal Spiders Algorithm

Spider is a treeOptimal spider is the minimal

spanning tree of spider’s graph

Page 18: CD-Edit a constraint diagrams editor

Automatic Label Placing

Spider is a treeThe label is placed near the foot for

which the sum of the distances to all other feet is minimal

Three phases: prepare-dist, sum-dist, find-min

Space complexity: O(n)Time complexity: O(n)

Page 19: CD-Edit a constraint diagrams editor

4

5

2

1

4

35

children: 7distances:4*3+8+5*4+7=47

children: 0distances: 0

children: 2distances: 8

children: 3distances: 7

After prepare-dist phase

Automatic Label Placing (2)

Root

Page 20: CD-Edit a constraint diagrams editor

4

5

2

1

4

35

47

8 + 27 + 4x5=55

7+20+5x4=47

52 + 3x7=7350 + 5x7=85 45 + 2x7=59

43 + 4x7=71

46 + 1x7=53

After sum-dist phase

Automatic Label Placing (3)Minimum

Page 21: CD-Edit a constraint diagrams editor

A short demo of CD-Edit…