Horizontal?!? FlowLayout [message #145461] |
Thu, 29 July 2004 08:53  |
Eclipse User |
|
|
|
I'm new to GEF and just spent hours debugging a first attempt at the
Figure for an EditPart.
I was trying to create a Figure that was a composite of a Label and a
RectangleFigure. So I used this for the Figure before I added the children:
setLayoutManager(new FlowLayout());
Since I wanted this layout to appear-->
Label RectangleFigure
(ie. laid out horizontally across the screen) I used the default
FlowLayout constructor since the documentation said it would give a
"horizontal orientation".
Turns out if I want the Label and RectangleFigure laid out "horizontally",
have to use this: new FlowLayout(false).
Isn't the documentation wrong? Asking for Horizontal Layout got me this:
Label
RectangleFigure
It took hours to debug, since the EditPart refreshVisuals() was setting a
layout constraint based on a Rectangle that assumes the Figure were laid
out horizontally.
So I never saw the RectangleFigure since it was below the height
constraint.
Am I missing something? Is the FlowLayout() documentation wrong?
|
|
|
|
|
Re: Horizontal?!? FlowLayout [message #145686 is a reply to message #145513] |
Fri, 30 July 2004 08:51  |
Eclipse User |
|
|
|
Pratik Shah wrote:
> No, the documentation is correct. If you say new FlowLayout(false), you are
> constructing a vertical flowlayout. Now, here's the thing to keep in mind.
> This layout wraps figures. So, for the horizontal layout, if there's not
> enough room on the right of the label to fit the RectangleFigure, it will
> put that figure on the next line. Perhaps that is what was happening and
> made you think the orientation was reversed.
Thanks, You were right - I was getting the wrap to the next vertical
column.
|
|
|
Powered by
FUDForum. Page generated in 0.04009 seconds