Status: New
Owner: ----
CC: alexandr...(a)gmail.com
Labels: Type-Defect Priority-High Component-Mondrian Milestone-4.6
New issue 698 by tudor.gi...(a)gmail.com: Mondrian does not properly raise
MOElementSelection
http://code.google.com/p/moose-technology/issues/detail?id=698
When in Glamour, often when selecting a Mondrian element does not populate
the selection because the MOCanvas does not raise MOElementSelection.
The reason for this seems to be a race condition due to changes in the
announcement framework. In the new announcement framework from Pharo 1.3,
the order of announcements is not guaranteed.
The issue seems to be due to the logic of the announcement:
MOCanvas>>mouseUp:
..
(lastEnteredGraphElement isNil not and: [
(lastEnteredGraphElement class ~~ MORoot and: [
lastEnteredGraphElement isNotSelected ])])
ifTrue: [
selectionEvent := MOElementSelection event: anEvent on:
lastEnteredGraphElement.
anEvent commandKeyPressed ifTrue: [ selectionEvent setAsMultiple ].
self announce: selectionEvent.
anEvent wasHandled: true.
^ self ].
Sometimes, "lastEnteredGraphElement isNotSelected" returns false because
somehow the element gets selected beforehand. This is most likely related
to the fact that the selection of a node actually happens by handling the
same MOElementSelection announcement:
MOCanvas>>announce: anAnnouncement
...
anAnnouncement element isNil ifFalse: [
anAnnouncement element announcer announce: anAnnouncement ].
self announcer announce: anAnnouncement.
MOViewRenderer>>setUsefulHandlersForNodes
...
self interaction on: MOElementSelection
do: [:ann |
ann isUnique
ifTrue: [ self root allSelectedNodes
do: [ :node |
node
deselect;
announce: (MOElementDeselection new) ] ].
ann element select.
self updateWindow ].