Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » How can I get the position from a model.
How can I get the position from a model. [message #639326] Tue, 16 November 2010 01:09
Eclipse UserFriend
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?
*/
}
}
Previous Topic:Fixed source and target for connection
Next Topic:I don't have enough information about OCL in GMF
Goto Forum:
  


Current Time: Thu Jul 03 18:42:08 EDT 2025

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

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

Back to the top