| 
| Proper usage of diagram node selection and subsequent command processing [message #64725] | Tue, 17 October 2006 17:44  |  | 
| Eclipse User  |  |  |  |  | Hi, 
 due to some bug that has turned out to be quite mysterious, I would like
 to clarify some things:
 
 (1)
 Why get methods like e.g. PackageEditHelper.getMoveCommand(MoveRequest
 req) executed 3-5 times in a row when I do a drag'n'drop operation (with
 a single diagram element!) in my diagram?
 Not only I wonder why that method is called multiple times, but also the
 fact that the number of subsequent calls varies.
 
 Further, I do expect that method to be called not earlier then the
 "release mouse button event". Instead, it's called on mouse hover (with
 dragged elements glued to the mouse pointer).
 
 (2)
 I feel that there are some things to know concerning proper selection of
 multiple diagram nodes. In particular, how do I access the set of
 currently active diagram elements?
 
 (3, as a consequence of 1+2)
 When will the runtime documentation and related docs be reviewed to
 cover these nasty things?
 
 Thanks a lot for your advice,
 
 Martin Herbort
 |  |  |  | 
| 
| Re: Proper usage of diagram node selection and subsequent command processing [message #64750 is a reply to message #64725] | Tue, 17 October 2006 18:39  |  | 
| Eclipse User  |  |  |  |  | Originally posted by: vcciubot.uwaterloo.ca 
 > (1)
 > Why get methods like e.g. PackageEditHelper.getMoveCommand(MoveRequest
 > req) executed 3-5 times in a row when I do a drag'n'drop operation (with
 > a single diagram element!) in my diagram?
 > Not only I wonder why that method is called multiple times, but also the
 > fact that the number of subsequent calls varies.
 
 Tools/Actions etc call getCommand() on an EditPart to update the mouse
 pointer or their icon (enabled/disabled). As such, when you drag the tool
 updates the target edit part and calls getCommand() on that edit part
 which in turn calls the semantic policy which calls your edit helper.
 
 
 >
 > Further, I do expect that method to be called not earlier then the
 > "release mouse button event". Instead, it's called on mouse hover (with
 > dragged elements glued to the mouse pointer).
 
 Those commands are checked for being executable but are only executed when
 the dragging ends.
 
 >
 > (2)
 > I feel that there are some things to know concerning proper selection of
 > multiple diagram nodes. In particular, how do I access the set of
 > currently active diagram elements?
 
 EditPartViewer#getSelection
 
 You can get the viewer from an edit part.
 
 
 >
 > (3, as a consequence of 1+2)
 > When will the runtime documentation and related docs be reviewed to
 > cover these nasty things?
 
 It's hard at the beginning :)
 
 Some of these topics have already been covered in the GEF programmer's
 manual.
 |  |  |  | 
Powered by 
FUDForum. Page generated in 0.03701 seconds