How can I store the bounds information in the model features? [message #221787] |
Wed, 18 March 2009 11:33 |
tsangpo Messages: 1 Registered: July 2009 |
Junior Member |
|
|
I want to store the bounds in the ecore model, for example, XXX.x, XXX.y,
XXX.width, XXX.height.
I found that these information is store seperately as the diagram notation.
How can I bind the bounds with my model feature, so I change the x of the
model, then will change the location of the figure displayed, and I drag
the figure will change the feature x of the model.
I'm new in gmf, is my requirement so spectial?
Thanks!
|
|
|
Re: How can I store the bounds information in the model features? [message #221811 is a reply to message #221787] |
Wed, 18 March 2009 16:24 |
Eclipse User |
|
|
|
Originally posted by: cayla_sha.gmx.net
Hello!
I did this in my editor. My node has two attributes: XPosition and
YPosition. So they´re automatically shown on the properties-tab. When
the user enters a new value for one of the attributes, the node moves
accordingly. In turn, when the user moves the node, I have to set the x
and y-values in GMF.
For that feature you have to do the following:
- when the user moves the shape, you have to catch this call and set the
X- and YPosition.
For that I overwrote the method handleNotificationEvent() in the
EditPart of the node. There I catch the call when the node was moved and
then I set the attributes X- and YPosition according to the place where
the user moved the node.
- when the user enters a value for X- or YPosition you need to move the
node.
This call is also catched in handleNotificationEvent(). I set x and y in
GMF and call refreshBounds().
To find the right events to catch please implement empty
handleNotificationEvent-Method and debug it.
Hope that helps
Best wishes
Julia
tsangpo schrieb:
> I want to store the bounds in the ecore model, for example, XXX.x,
> XXX.y, XXX.width, XXX.height. I found that these information is store
> seperately as the diagram notation.
> How can I bind the bounds with my model feature, so I change the x of
> the model, then will change the location of the figure displayed, and I
> drag the figure will change the feature x of the model.
> I'm new in gmf, is my requirement so spectial?
> Thanks!
>
|
|
|
|
Powered by
FUDForum. Page generated in 0.03141 seconds