You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pivot.apache.org by Niclas Hedhman <ni...@hedhman.org> on 2009/08/06 12:17:28 UTC

Spring component

Gang,

When laying out many forms, one needs to 'push' components in vertical
or horizontal directions. They are supposed to 'fill all possible
space'. I don't think that this is available in Pivot, and I think it
would be reasonable to have it.


Cheers
-- 
Niclas Hedhman, Software Developer
http://www.qi4j.org - New Energy for Java

I  live here; http://tinyurl.com/2qq9er
I  work here; http://tinyurl.com/2ymelc
I relax here; http://tinyurl.com/2cgsug

Re: Spring component

Posted by Noel Grandin <no...@gmail.com>.
I think you're looking for TablePane.

Niclas Hedhman wrote:
> Gang,
>
> When laying out many forms, one needs to 'push' components in vertical
> or horizontal directions. They are supposed to 'fill all possible
> space'. I don't think that this is available in Pivot, and I think it
> would be reasonable to have it.
>
>
> Cheers
>   


Re: Spring component

Posted by Greg Brown <gk...@mac.com>.
OTOH, after having looked at this:

http://java.sun.com/docs/books/tutorial/uiswing/layout/spring.html

I think that SpringPane may be a bit too complicated for Pivot:

"SpringLayout is...very low-level and as such you really should only  
use it with a GUI builder, rather than attempting to code a spring  
layout manager by hand."

Pivot may one day support a GUI builder, but you should still always  
be able to code your UI by hand using WTKX (or Java). Since TablePane  
already does what you describe, a SpringPane container may just be  
superfluous.

G


On Aug 6, 2009, at 8:37 AM, Greg Brown wrote:

>>> TablePane facilitates this behavior.
>>
>> You guys are sooooo HTML oriented :-)
>
> Yeah. That's intentional.  :-)  HTML is good for layout, and most  
> developers are familiar with it. Tables are great for a lot of  
> different layout requirements, and AWT/Swing has never provided one  
> that is really easy to use. We wanted to make sure that we brought  
> HTML's ease of tabular layout to Pivot.
>
>> Could I recommend you to take a stab at trying the GUI designer in
>> IDEA?? Springs are really neat.
>
> I'm familiar with SpringLayout, though I have never actually used it  
> myself. We have lots of other container classes that parallel AWT  
> layout managers, so adding SpringPane would not be a stretch.
>
> Feel free to enter a JIRA ticket for it (and assign it to yourself  
> as well, if desired).  :-)
>


Re: Spring component

Posted by Greg Brown <gk...@mac.com>.
> Well the way I see it, it is not a Layout, but a very very light- 
> weight
> components, that all containers know how to treat.

I'd be reluctant to bake knowledge of a particular component type into  
every container. That seems to pretty strongly go against good OO  
design principles...


Re: Spring component

Posted by Niclas Hedhman <ni...@hedhman.org>.
(Sorry for not inlining answer, the GMail client on Android doesn't allow
it... now at home...)

Well the way I see it, it is not a Layout, but a very very light-weight
components, that all containers know how to treat.

-- Niclas

On Aug 6, 2009 8:38 PM, "Greg Brown" <gk...@mac.com> wrote:

>> TablePane facilitates this behavior. > > > You guys are sooooo HTML
oriented :-)
Yeah. That's intentional.  :-)  HTML is good for layout, and most developers
are familiar with it. Tables are great for a lot of different layout
requirements, and AWT/Swing has never provided one that is really easy to
use. We wanted to make sure that we brought HTML's ease of tabular layout to
Pivot.

> Could I recommend you to take a stab at trying the GUI designer in >
IDEA?? Springs are really n...
I'm familiar with SpringLayout, though I have never actually used it myself.
We have lots of other container classes that parallel AWT layout managers,
so adding SpringPane would not be a stretch.

Feel free to enter a JIRA ticket for it (and assign it to yourself as well,
if desired).  :-)

Re: Spring component

Posted by Greg Brown <gk...@mac.com>.
>> TablePane facilitates this behavior.
>
> You guys are sooooo HTML oriented :-)

Yeah. That's intentional.  :-)  HTML is good for layout, and most  
developers are familiar with it. Tables are great for a lot of  
different layout requirements, and AWT/Swing has never provided one  
that is really easy to use. We wanted to make sure that we brought  
HTML's ease of tabular layout to Pivot.

> Could I recommend you to take a stab at trying the GUI designer in
> IDEA?? Springs are really neat.

I'm familiar with SpringLayout, though I have never actually used it  
myself. We have lots of other container classes that parallel AWT  
layout managers, so adding SpringPane would not be a stretch.

Feel free to enter a JIRA ticket for it (and assign it to yourself as  
well, if desired).  :-)


Re: Spring component

Posted by Niclas Hedhman <ni...@hedhman.org>.
On Thu, Aug 6, 2009 at 8:05 PM, Greg Brown<gk...@mac.com> wrote:
> TablePane facilitates this behavior.

You guys are sooooo HTML oriented :-)

Could I recommend you to take a stab at trying the GUI designer in
IDEA?? Springs are really neat.
And you might pick up more ideas while you are at it...


Cheers
-- 
Niclas Hedhman, Software Developer
http://www.qi4j.org - New Energy for Java

I  live here; http://tinyurl.com/2qq9er
I  work here; http://tinyurl.com/2ymelc
I relax here; http://tinyurl.com/2cgsug

Re: Spring component

Posted by Greg Brown <gk...@mac.com>.
TablePane facilitates this behavior. However, I think we need to add  
an inner component class to TablePane to support the empty space (I  
ran into the need for this the other day myself). Because of the way  
row contents are defined in WTK (and HTML, for that matter), you  
always need to define a component for a cell, even when you don't want  
anything in that cell (in HTML, it amounts to creating an empty <td>  
tag). We don't currently provide that, so you have to use a Label with  
no text, or something similar. We should include a TablePane.EmptyCell  
class that just takes up the empty space.

However, we could consider adding a SpringPane class to handle this  
case - maybe TablePane is too big a hammer for this particular job.

Thoughts?


On Aug 6, 2009, at 6:17 AM, Niclas Hedhman wrote:

> Gang,
>
> When laying out many forms, one needs to 'push' components in vertical
> or horizontal directions. They are supposed to 'fill all possible
> space'. I don't think that this is available in Pivot, and I think it
> would be reasonable to have it.
>
>
> Cheers
> -- 
> Niclas Hedhman, Software Developer
> http://www.qi4j.org - New Energy for Java
>
> I  live here; http://tinyurl.com/2qq9er
> I  work here; http://tinyurl.com/2ymelc
> I relax here; http://tinyurl.com/2cgsug