Auto resize of figures/compartments [message #202487] |
Tue, 19 August 2008 12:00  |
Eclipse User |
|
|
|
Originally posted by: fbanica.soluta.net
Hello everybody,
I need some help with this issue: I have a GMF editor which works pretty
well, but I have this request: "the figures should resize (get larger) every
time a new element is added inside of them".
In other words, I have a figure called "Item" which has two compartments,
for two other types of elements: "Attributes" and "Issues". When I add an
Attribute, its compartment resizes automatically, but when I add an Issue
this doesn't happen. I also attached some pictures to make things clear
(hope they are). On the second figure you can notice that scroll-bars appear
on both compartments, instead of resizing the "Item" (the orange rectangle).
Can anyone tell me how to make the editor resize both types of compartments,
please?
Thanks,
Floppy
Attachment: Figure2.PNG
(Size: 65.47KB, Downloaded 278 times)
Attachment: Figure1.PNG
(Size: 65.33KB, Downloaded 246 times)
|
|
|
Re: Auto resize of figures/compartments [message #202830 is a reply to message #202487] |
Thu, 21 August 2008 04:38   |
Eclipse User |
|
|
|
Originally posted by: fbanica.soluta.net
Anybody? Any idea?
"Florin Banica" <fbanica@soluta.net> wrote in message
news:g8eqnj$jik$1@build.eclipse.org...
> Hello everybody,
>
> I need some help with this issue: I have a GMF editor which works pretty
> well, but I have this request: "the figures should resize (get larger)
> every time a new element is added inside of them".
>
> In other words, I have a figure called "Item" which has two compartments,
> for two other types of elements: "Attributes" and "Issues". When I add an
> Attribute, its compartment resizes automatically, but when I add an Issue
> this doesn't happen. I also attached some pictures to make things clear
> (hope they are). On the second figure you can notice that scroll-bars
> appear on both compartments, instead of resizing the "Item" (the orange
> rectangle).
>
> Can anyone tell me how to make the editor resize both types of
> compartments, please?
>
> Thanks,
>
>
> Floppy
>
>
>
|
|
|
|
Re: Auto resize of figures/compartments [message #203897 is a reply to message #203889] |
Fri, 29 August 2008 11:22  |
Eclipse User |
|
|
|
Hi,
At the beginning your figure has a default -1, -1 size in the model, that
translates to preferred size of the figure, which is determined by the
layout manager. So compartment size is just big enough to fit all its
children. Ones you resize the compartment the size is fixed in the model
and this means that instaed of preferred size you get the one from the
model - the user specified size.
To switch the compartment to auto-size mode (preferred size) you need to
make its size -1, -1 in the notation model. There is an "Auto-Size" button
on the toolbar that does this - I believe this is the answer you're
looking for.
Now, you may disable compartment resize by installing
NonResizableEditPolicy instead of Resizable.
Hope this helps.
Cheers,
Alex
|
|
|
Powered by
FUDForum. Page generated in 0.06341 seconds