
Elements
--------
Element on the Gaphor canvas can be easely be inherited from DiaCanvasElement.
This gives them the oportunity to connect relationships etc. Elements typically
have some sort of text inside. This can be handled by DiaCanvasText. The
Gaphor element only has to glue these objects together (which is pretty
straight forward now that all is abstracted by iterators).

Another point is Undo information. We have to find some way to commit undo
indormation and undo it. Typically, GObjects have a get/set_property()
function which handles this. We can use this for properties defined in the
parent, but not for out own properties. For elements, however, this should
not be nessesary.
NOTE: properties can be set by a __gproperty__ attribute in the class.

Undoing and redoing data has some feetback on the data model. If an element
is removed from the diagram, it increments a undo-counter on the data object,
knowing that the data object could be unlinked, but should not be removed
entirely. I (Arjan) have to investigate if this is a desired solution at all,
and if so, if how diagram item subjects (the model elements) should behave
onder those circumstances.

Connecting and disconnecting is also done by DiaCanvasElement. Gaphor elements
should only allow specific types of elements to connect.

Relationships
-------------
Relationships can also have text subtypes. This text, however should be able
to move. connecting and disconnect should be pretty easy to convert to Python
code since most calls are already Python calls. Constraints should be made
to keep the text close to the line.

Connection protocol
-------------------
When a relationship is to be connected to a model element, the relationship
should have an option to check if a connection is valid. After a connection
is established, the line should be notified so it can update its internal
state and the data model.

1. The user drags a handle of a relationship to a model element
2. If the user releases the handle a connect_handle signal is emited.
3. The connect_handle asks the relationship if the connection is allowed by
   calling allow_connect_handle().
4. If the connection is allowed, the element tries to connect the relationship
5. The relationship is notified by calling confirm_connect_handle()

For disconnecting lines, an identical procedure is used
(allow_disconnect_handle() and confirm_disconnect_handle())

Conclusion
----------
This should work ;-)...

