Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Proper usage of diagram node selection and subsequent command processing
Proper usage of diagram node selection and subsequent command processing [message #64725] Tue, 17 October 2006 21:44 Go to next message
Martin Herbort is currently offline Martin HerbortFriend
Messages: 30
Registered: July 2009
Member
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 22:39 Go to previous message
Eclipse UserFriend
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.
Previous Topic:How to use LeftRightProvider ?
Next Topic:Ordering of model elements based on position
Goto Forum:
  


Current Time: Sun Oct 06 08:10:34 GMT 2024

Powered by FUDForum. Page generated in 0.03311 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top