Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Saving figures's constraints from layouting in notation model
Saving figures's constraints from layouting in notation model [message #1023860] Mon, 25 March 2013 10:24 Go to next message
Yves Alter is currently offline Yves AlterFriend
Messages: 11
Registered: January 2013
Junior Member
Hi

I'm looking for a way to store the figure's bounds/constraint in the notation model, whether it's set manually (through ChangeBoundsRequests/SetBoundsCommand) or automatically (through layouting, ie. the figures size is -1,-1). One use case are figures containing a line of text whose bounds are automatically changed after the size of the text changes. Does GMF support such a configuration out of the box or do I need to develop that manually (through EditPolicies?)? The diagram uses XYLayout, btw. Thanks!
Re: Saving figures's constraints from layouting in notation model [message #1024447 is a reply to message #1023860] Tue, 26 March 2013 07:58 Go to previous messageGo to next message
Thomas Beyer is currently offline Thomas BeyerFriend
Messages: 55
Registered: February 2013
Member
Hi Yves,

the notation model knows two stages:
1. width/height explicitely set to a value. The figures will try to layout to this size.
2. default size (-1/-1) which is persistet as a null entry for the layout constraints. The figures will take the preferred size, that they require to fully display their contents. So if child figures (sizes) changes, the parent changes accordingly.
Maybe this already answers your question?
You could also manually set the figures size to -1/-1.

I am not aware of a solution, that would discriminate the source of modification.
There are also other actions, that modify the size of the size automatically to specific values (MakeSameSizeAction for example).

If you want to store this kind of information in the notation model, you would have to extend it and modify all actions and commands, to reflect this modification. This yould get a cumbersome task, because if you check the call-hierarchy for SetBoundsCommand, you will find quiet some consumers, that would need to be adressed.

Regards
Thomas
Re: Saving figures's constraints from layouting in notation model [message #1024461 is a reply to message #1023860] Tue, 26 March 2013 07:58 Go to previous messageGo to next message
Thomas Beyer is currently offline Thomas BeyerFriend
Messages: 93
Registered: July 2009
Member
Hi Yves,

the notation model knows two stages:
1. width/height explicitely set to a value. The figures will try to layout to this size.
2. default size (-1/-1) which is persistet as a null entry for the layout constraints. The figures will take the preferred size, that they require to fully display their contents. So if child figures (sizes) changes, the parent changes accordingly.
Maybe this already answers your question?
You could also manually set the figures size to -1/-1.

I am not aware of a solution, that would discriminate the source of modification.
There are also other actions, that modify the size of the size automatically to specific values (MakeSameSizeAction for example).

If you want to store this kind of information in the notation model, you would have to extend it and modify all actions and commands, to reflect this modification. This yould get a cumbersome task, because if you check the call-hierarchy for SetBoundsCommand, you will find quiet some consumers, that would need to be adressed.

Regards
Thomas
Re: Saving figures's constraints from layouting in notation model [message #1028707 is a reply to message #1024461] Thu, 28 March 2013 16:33 Go to previous message
Yves Alter is currently offline Yves AlterFriend
Messages: 11
Registered: January 2013
Junior Member

Hi Thomas

Thanks for your answer! I tried to persist the outer figures (the border) bounds that is layouted automatically if the child figure (the text) size changed. So far, I created an EditPolicy that listens for changes of the bounds of the outer figure and executes a SetBoundsCommand if necessary. It works, but I'm not sure if this is an appropriate solution.

Yves
Previous Topic:Changing the position of labels and anchor
Next Topic:customizing shape look
Goto Forum:
  


Current Time: Thu Apr 25 22:32:27 GMT 2024

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

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

Back to the top