How can I get the position from a model. [message #639326] |
Tue, 16 November 2010 06:09 |
No real name Messages: 1 Registered: November 2010 |
Junior Member |
|
|
I'm trying to make a layout editor using GMF.
I need to retrieve the position of the shape from a model.
I can get the value from BoundsImpl when the notifier is BoundsImpl.
But I don't know how to get the value when the notifier is EMF model.
How can I get the position from the model?
@Override
protected void handleNotificationEvent(Notification notification) {
super.handleNotificationEvent(notification);
Object feature = notification.getFeature();
Object notifier = notification.getNotifier();
if(notifier instanceof BoundsImpl){
BoundsImpl bounds = (BoundsImpl)notifier;
System.out.println("x:" + bounds.getX();
}
if(notifier instanceof ButtonImpl){
ButtonImpl button = (ButtonImpl)notifier;
/**
* How can I get the position of the button from the model?
*/
}
}
|
|
|
Powered by
FUDForum. Page generated in 0.02622 seconds