Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 06:09
No real name is currently offline No real nameFriend
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?
*/
}
}
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 Apr 25 01:57:44 GMT 2024

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

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

Back to the top