Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » [EOL] Change Nodes Resize Constraint
[EOL] Change Nodes Resize Constraint [message #1032971] Wed, 03 April 2013 17:49 Go to next message
Phil H is currently offline Phil HFriend
Messages: 267
Registered: November 2012
Senior Member
Hi,

I would liek to set the node Resize Constraint to none via an eol transformation.
I tried this so far, but have not really clue what is the right way:

operation customizeResize(){	
	var fmFigure = findNode('FeatureModel');
	fmFigure.resizeConstraint := GmfGraph!Direction#None;
}

operation findNode(name : String) {
  return GmfGraph!Node.all.selectOne(s|s.name = name);
}



Can someone tell how to do this?
Re: [EOL] Change Nodes Resize Constraint [message #1032976 is a reply to message #1032971] Wed, 03 April 2013 17:59 Go to previous messageGo to next message
Antonio Garcia-Dominguez is currently offline Antonio Garcia-DominguezFriend
Messages: 594
Registered: January 2010
Location: Birmingham, UK
Senior Member

If you want to make the node not resizable, we have recently added an Eugenia annotation for just that:

@gmf.node(..., resizable="false")
class X {
  ...
}

It's only available on a very recent interim release. We haven't had much time to try it before making it the official interim release, but you might want to try it out. It is available at this update site for now (we'll move it to the proper interim URL in a few weeks if all goes well):

http://download.eclipse.org/epsilon/interim-very-new/

If you want to stay with Epsilon 1.0, you may want to adapt the EOL code that we use to implement this annotation:

var figureClass = node.name + 'Figure';
var figure_viewmaps = GmfGen!InnerClassViewmap.all.select(r|r.className = figureClass);

for (figure_viewmap in figure_viewmaps) {
  -- Resize constraint which forbids resizing
  -- NORTH (1), SOUTH (4), EAST (8) and WEST (16): all handles are not resizable
  var resizeconstraint_not_resizable = new GmfGen!ResizeConstraints;
  resizeconstraint_not_resizable.nonResizeHandles := 31;
  figure_viewmap.attributes.add(resizeconstraint_not_resizable);
}


[Updated on: Wed, 03 April 2013 18:00]

Report message to a moderator

Re: [EOL] Change Nodes Resize Constraint [message #1033098 is a reply to message #1032976] Wed, 03 April 2013 21:15 Go to previous messageGo to next message
Phil H is currently offline Phil HFriend
Messages: 267
Registered: November 2012
Senior Member
Thanks for the quick response !! I tried out the new release and it's working with Juno Service Release 2 Wink

Is there an overview about the new annotations?

Cheers,
Phil
Re: [EOL] Change Nodes Resize Constraint [message #1033913 is a reply to message #1033098] Thu, 04 April 2013 20:00 Go to previous message
Antonio Garcia-Dominguez is currently offline Antonio Garcia-DominguezFriend
Messages: 594
Registered: January 2010
Location: Birmingham, UK
Senior Member

Glad it worked Smile.

All annotations should be listed in the official GMF tutorial [1], but if you want to see only the new ones, they're in the bug report at [2].

[1]: http://eclipse.org/epsilon/doc/articles/eugenia-gmf-tutorial/
[2]: https://bugs.eclipse.org/bugs/show_bug.cgi?id=400569
Previous Topic:[EGL] Interfaces and Generalizations
Next Topic:[Flock] UnresolvedReference
Goto Forum:
  


Current Time: Tue Apr 16 23:28:06 GMT 2024

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

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

Back to the top