File: connect.txt

package info (click to toggle)
gaphor 0.17.2-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 4,552 kB
  • ctags: 3,629
  • sloc: python: 23,713; xml: 222; makefile: 112; sh: 1
file content (41 lines) | stat: -rw-r--r-- 1,303 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
Connection protocol
===================

In Gaphor, if a connection is made on a diagram between an element and a
relationship, the connection is also made at semantic level (the model). 
From a GUI point of view it all starts with a button release event.

With "item" I refer to objects in a diagram (graphical), with "element" I
refer to symantic (model) objects.

Is relation with this element allowed?
  No:
    do nothing (not even glue should have happened as the same question is
    asked there).
  Yes:
    connect_handle()
    Is opposite end connected?

      No:
        Do nothing
      Yes:
        Does the item already have a subject element relation?
          Yes:
            Is the previous item the same as the current?
              Yes:
                Do nothing

              No:
                Let subject end point to the new element

          No:
            Create relation or find existing relation in model

            Search for an existing relation in the model:
              Found:
                Use that relation
                  Nothing:

            Create new model elements and connect to item

The check if a connection is allowed should also check if it is valid to create a relation to/from the same element (like associations, but not generalizations)