Skip to main content



      Home
Home » Eclipse Projects » GEF » Horizontal?!? FlowLayout
Horizontal?!? FlowLayout [message #145461] Thu, 29 July 2004 08:53 Go to next message
Eclipse UserFriend
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 #145513 is a reply to message #145461] Thu, 29 July 2004 10:49 Go to previous messageGo to next message
Eclipse UserFriend
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.

"Steve Harper" <steve_harper@adp.com> wrote in message
news:cearve$usa$1@eclipse.org...
> 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 #145522 is a reply to message #145461] Thu, 29 July 2004 11:13 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

Use ToolbarLayout, or BorderLayout instead.

"Steve Harper" <steve_harper@adp.com> wrote in message
news:cearve$usa$1@eclipse.org...
> 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 Go to previous message
Eclipse UserFriend
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.
Previous Topic:Problem with Figure and ScrollPane!
Next Topic:GEF & RCP in RTL style.
Goto Forum:
  


Current Time: Sun Jul 13 14:56:40 EDT 2025

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

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

Back to the top