I've been thinking a lot lately about how the mouse interaction should
happen. A colleague of mine pointed me to a document called "A Pattern
Language for Tool Construction and Integration Based on the Tools and
Materials Metaphor" (http://dirkriehle.com/computer-science/research/1994/plop-1994-tools.pdf
).
It explains some things as they already have been implemented in
Gaphas (heh!). The issue I'm struggling with is how to use Gaphas
tools to work on items (in context = view) and maybe even use two
layers of tools: one for canvas (model) level changes and one for view
level changes.
Another thing I'm pondering about is roles (http://www.artima.com/articles/dci_vision.html
). Is kinda related to the tools and materials metaphor. The idea of a
role (as opposed to a mixin) is that a role is applied to an instance
(whereas a mixin is applied to a class). For example: if an item
becomes focused it'll get a Focused role applied (within the context
of the view). This role will provide the extra functionality needed to
interact with the item (e.g. how to deal with handles). One of the
points where roles are very handy is then items need to connect to
each other.
Okay...
Well... basically roles are a lot like Zope adapters. The idea is the
same. But I wouldn't be happy if gaphas depends on zope.interface and
zope.component. They're frameworks and restrict the way the gaphas can
be used. For Gaphor it works like a charm, though.
Regards,
Arjan