List layout and excess space [message #478877] |
Fri, 07 August 2009 10:45 |
Tobias Messages: 18 Registered: July 2009 |
Junior Member |
|
|
Hello,
in my editor I have a compartment using a list layout. Now I want the
elements in this compartment to grab the excess vertical space, so the
compartment is always completely covered by its children. The default
behaviour seems to be that the children are always as small as possible.
While this is surely adequate for many cases, it's not if the list
items are to hold a freeform compartment.
So, to summarize, for all but the last elements in the list-layouted
compartment the layout is fine, making them as slim as possible, but the
last element should extend to the end of the compartment.
Alternatively, it would also be ok (if not even better) if the excess
space would be equally distributed to all the children in the list
compartment.
Any ideas?
Regards,
Tobias
|
|
|
Re: List layout and excess space [message #478926 is a reply to message #478877] |
Fri, 07 August 2009 14:16 |
Tobias Messages: 18 Registered: July 2009 |
Junior Member |
|
|
Problem solved. ^^;;
For those who are interested: It's, of course, the stretchMajorAxis
attribute of the list compartment's ConstrainedToolbarLayout:
(in compartment edit part)
public IFigure createFigure() {
ResizableCompartmentFigure result = (ResizableCompartmentFigure)
super.createFigure();
ConstrainedToolbarLayout layout = (ConstrainedToolbarLayout)
result.getContentPane().getLayoutManager();
layout.setStretchMajorAxis(true);
return result;
}
My mistake was that I tried to do this with the result's layout manager,
and not the result's content pane's layout manager -- which are, most
confusingly, even of the same type.
Regards,
tobias
Tobias schrieb:
> Hello,
>
> in my editor I have a compartment using a list layout. Now I want the
> elements in this compartment to grab the excess vertical space, so the
> compartment is always completely covered by its children. The default
> behaviour seems to be that the children are always as small as possible.
> While this is surely adequate for many cases, it's not if the list
> items are to hold a freeform compartment.
>
> So, to summarize, for all but the last elements in the list-layouted
> compartment the layout is fine, making them as slim as possible, but the
> last element should extend to the end of the compartment. Alternatively,
> it would also be ok (if not even better) if the excess space would be
> equally distributed to all the children in the list compartment.
>
> Any ideas?
>
> Regards,
> Tobias
|
|
|
|
Re: List layout and excess space [message #480450 is a reply to message #480346] |
Mon, 17 August 2009 08:28 |
Tobias Messages: 18 Registered: July 2009 |
Junior Member |
|
|
Hi Ivo,
I do most of my settings in the generated code, and not in gmfgraph and
genmodel, so I'm afraid I can not help you here... :-(
But giving it a try: Regarding the freeform-layout it should be enough
setting the compartment's ListLayout property to false in the gmfgen.
Then you could try to set the rectangles layout (list layout, I guess)
to stretch the mayor axis, so the freeform compartment takes the
remaining place. Finally, you could set the maximum size of the labels,
so they do not take too much space, but as I said, that's just a guess...
Hope this helps,
Tobias
Ivo Petkov schrieb:
> Hi Tobias,
>
> I have similar requirements (One composite rectangle figure with 2
> labels and one compartment).
>
> I want to have the compartment fill all left space, but after many
> attempts I cannot manage to get it working.
>
> Can you please share more information about layout settings at gmfgraph
> and gmfgen levels?
>
> In my case I need the figures placed in the compartment to have
> FreeFormLayoutEx.
>
> Thanks in advance,
> Ivo
>
|
|
|
Powered by
FUDForum. Page generated in 0.02584 seconds