I've been thinking about this some more, and have some questions.

What is the primary functionality that you want?
- Is it to allow for any Component to be resized by the user with the mouse?
- Or perhaps to have a Container that holds 2 Components and allows the user
to drag a 'splitter' to resize just one of the Components and the Container
itself?
- Something else?

There may be a much simpler and more generic approach that the earlier ones
I suggested.  Something along the lines of one or more mouse listeners that
can be added to any Component to add the resizing functionality.  These
would be combined with a Decorator that would paint the resize 'splitter'
when required.

Then you would simply be able to write something like
Resizer.setResizable(component, Resizer.Direction.VERTICAL)
Resizer.setResizable(component, Resizer.Direction.HORIZONTAL)
Resizer.setResizable(component, Resizer.Direction.BOTH)
Resizer.setResizable(component, Resizer.Direction.NONE)

The advantage of this is that you would be free to use any Containers for
your layout, and any Component.

I have very limited experience with the layout side of things in Pivot, so
I'm sure Greg, Todd or others can correct me if required, or suggest a
better method.

I will re-read the Component & Container tutorial and see if I change my
mind once again!  :)
http://pivot.apache.org/tutorials/component-and-container.html

Chris

2011/6/19 Piotr Kołaczkowski <[email protected]>

>
> Hi,
>
> In Pivot 2.0, is there a way  to create a component with one edge thick
> just like the splitter in the SplitPane, so that when user drags this edge,
> the component resizes appropriately, but only this component and not the
> other one that is above/below/left/right?
>
> Imagine two components, one placed over another, in a single Expander (but
> it can be a BoxPane, Border or whatever):
>
> ===================
> Expander title
> -----------------------------
>
> Vertically resizable component
>
> ------------++--------------
> Fixed size component
> ===================
>
> I want the edge denoted by ---++--- to act very much like a traditional
> SplitPane, except that
> it doesn't resize the bottom component. So of course, when the user drags
> it, the total height of the container holding the two components also
> changes.
> If it is not possible to do that with the draggable splitter in the middle,
> I would be also satisfied with a solution, that the bottom edge of the
> expander can be resized, like this:
>
> ===================
> Expander title
> -----------------------------
>
> Resizable component 1
>
> ----------------------------
> Fixed size component 2
> =======++==========
>
>
> I tried that with SplitPane, by simply setting minimum, maximum and
> preferredHeight of the bottom component to the same value, but it seems to
> ignore this, and it also doesn't resize the container. :(
>
> Thank you and best regards,
> Piotr
>
>
> --
> Piotr Kołaczkowski
> Instytut Informatyki, Politechnika Warszawska
> Nowowiejska 15/19, 00-665 Warszawa
> e-mail: [email protected]
> www: http://home.elka.pw.edu.pl/~pkolaczk/
>
>

Reply via email to