You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pivot.apache.org by Alex Ryzhov <ar...@gmail.com> on 2011/08/01 06:43:40 UTC

BorderLayout

This is my first message to the user group and I'd like to thank the Pivot
team for a great Swing successor. Now to the topic:

It appears that there is no equivalent of BorderLayout in Pivot. I tried
BoxPane, TablePane but they aren't equivalent. For example, I'd like
component A at the top and B in the center - can't do that. I was able to
write my own component which I called FillPane. It accepts 2 children and
puts one of them at the specified side (TOP, RIGHT, BOTTOM, or LEFT), and
the other one in the center. Using this primitive component I can simulate
BorderLayout. Do you think this is something that could make its way into
the library?

Thanks,
Alex

Re: BorderLayout

Posted by Chris Bartlett <cb...@gmail.com>.
Alex,

Are you referring to java.awt.BorderLayout?

On 1 August 2011 11:43, Alex Ryzhov <ar...@gmail.com> wrote:
> This is my first message to the user group and I'd like to thank the Pivot
> team for a great Swing successor. Now to the topic:
>
> It appears that there is no equivalent of BorderLayout in Pivot. I tried
> BoxPane, TablePane but they aren't equivalent. For example, I'd like
> component A at the top and B in the center - can't do that. I was able to
> write my own component which I called FillPane. It accepts 2 children and
> puts one of them at the specified side (TOP, RIGHT, BOTTOM, or LEFT), and
> the other one in the center. Using this primitive component I can simulate
> BorderLayout. Do you think this is something that could make its way into
> the library?
>
> Thanks,
> Alex

Re: BorderLayout

Posted by Greg Brown <gk...@verizon.net>.
> I think I tried that. What didn't work specifically is a ScrollPane in the center -- it wasn't constrained.

That's probably true - the center pane wouldn't be constrained, but a scroll pane in the center should still be able to constrain its own content.

> I'll try again later tonight and will report back.

OK, great.




Re: BorderLayout

Posted by Alex Ryzhov <ar...@gmail.com>.
I think I tried that. What didn't work specifically is a ScrollPane in the
center -- it wasn't constrained. I'll try again later tonight and will
report back.

Re: BorderLayout

Posted by Greg Brown <gk...@verizon.net>.
Hi Alex,

There is no direct equivalent to BorderLayout in Pivot. However, you should be able to use TablePane for this purpose. Create a TablePane with three rows and three columns defined as follows:

<columns>
  <TablePane.Column width="-1"/>
  <TablePane.Column width="1*"/>
  <TablePane.Column width="-1"/>
</columns>

<rows>
  <TablePane.Row height="-1">...</TablePane.Row>
  <TablePane.Row height="1*">...</TablePane.Row>
  <TablePane.Row height="-1">...</TablePane.Row>
</rows>

The first and last rows should contain a single component with TablePane.columnSpan="3". These represent the "north" and "south" regions. The middle row should contain three components for "west", "center", and "east", respectively.

I haven't tried this myself so I'm curious to know how it turns out.

G

On Aug 1, 2011, at 12:43 AM, Alex Ryzhov wrote:

> This is my first message to the user group and I'd like to thank the Pivot team for a great Swing successor. Now to the topic:
> 
> It appears that there is no equivalent of BorderLayout in Pivot. I tried BoxPane, TablePane but they aren't equivalent. For example, I'd like component A at the top and B in the center - can't do that. I was able to write my own component which I called FillPane. It accepts 2 children and puts one of them at the specified side (TOP, RIGHT, BOTTOM, or LEFT), and the other one in the center. Using this primitive component I can simulate BorderLayout. Do you think this is something that could make its way into the library?
> 
> Thanks,
> Alex