Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » GMFMap constraints based on canvas object
GMFMap constraints based on canvas object [message #716841] Thu, 18 August 2011 14:55 Go to next message
Christian Smietana is currently offline Christian SmietanaFriend
Messages: 11
Registered: February 2011
Junior Member
Hi all,

I would like to have a property in the canvas object, like "displayType", and have top node mappings with constraints that determine the visual display of nodes based on the canvas object. Is this somehow possible?

So, generally, constraints should be able to also evaluate the context (for example properties in the diagram/notation model?), instead of only the domain object behind a node.

A similar use case:

I want to show all related nodes (children and parent) of a node inside a compartment. A custom implemented reference is used as the children feature and returns all related nodes.
Now, parent nodes should be displayed differently from child nodes. But, one node can be parent for some nodes and child for others. So, how to do this with constraints?

Thanks for help and suggestions
Christian
Re: GMFMap constraints based on canvas object [message #726697 is a reply to message #716841] Mon, 19 September 2011 09:49 Go to previous messageGo to next message
Christian Smietana is currently offline Christian SmietanaFriend
Messages: 11
Registered: February 2011
Junior Member
No one has an idea?

Maybe another use case, perhaps the problem becomes clearer then: I want to implement a sort of display switch for a diagram that displays the nodes in two different flavors, with big and small icons. So I configure two different visual representations (top node references) for each domain object, one for each display style. Additionally, there is an attribute, say "displayStyle", in the canvas domain object, that determines the display style of the diagram. This property can be set somewhere, e.g. by a custom action or in the property view.

Now the question is - how to link everything to get the desired behaviour. To select the right top node reference in the mapping model, a constraint is needed. But how can the constraint on a node evaluate the property "displayStyle" on the canvas object?


Re: GMFMap constraints based on canvas object [message #726711 is a reply to message #726697] Mon, 19 September 2011 10:18 Go to previous message
Mickael Istria is currently offline Mickael IstriaFriend
Messages: 770
Registered: July 2009
Location: Grenoble, France
Senior Member
You could simply add a listener on the CommandStack and when you
intercept a SetCommand on your magic attribute, react to it by changing
the size of icons on all figures.

Or you could add a listener for your top-level object using the
DiagramEventBroker.
--
http://mickaelistria.wordpress.com
http://twitter.com/#!/mickaelistria
http://www.petalslink.com
Previous Topic:[solved] Connection Label from Reference Attribute
Next Topic:Change port node location whenever it is dragged and dropped on to the component node in GMF Editor
Goto Forum:
  


Current Time: Sat Nov 29 02:37:45 GMT 2014

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

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