Saving figures's constraints from layouting in notation model [message #1023860] |
Mon, 25 March 2013 06:24  |
Eclipse User |
|
|
|
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 03:58   |
Eclipse User |
|
|
|
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 03:58   |
Eclipse User |
|
|
|
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 12:33  |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.03379 seconds