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/06/25 12:17:05 UTC

TablePane concept...

(Sorry for posting here, but I am currently unable to post to
pivot-user@. Raised INFRA-2109 about it)

Guys,

I am struggling with TablePane, as it consistently refuse to work in a
fashion that I find "natural".

If I add() the ImageView instances to it, they all show up in cell
[0,0], and if I call setCellComponent() I get a
IndexOutOfBoundsException, even though I have added 2 columns and 1
row (in that order) before trying to set the cell.

But before starting on the real deal, I created an example where the
Rows were added before the Columns, and that worked.

How is it really intended to work?

Looking at the code, If one adds a Row, then all Components found in
the Row is added to the Pane, but I one adds a Column this is not
done.
Why do I need to bother with these kinds of details at all? Shouldn't
it be so much more natural to just have an indicator on how many rows
and columns one want, and a easier way to insert a new empty row or
column?
I just don't understand the thinking here...

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: TablePane concept and tutorials and wiki

Posted by Niclas Hedhman <ni...@hedhman.org>.
On Fri, Jun 26, 2009 at 5:37 AM, Martijn
Dashorst<ma...@gmail.com> wrote:
> Without getting hugs from nice girls in a night club I was able to add
> grandinj to the dev group.
>
> Now we only need an answer to the question: what the hell are you
> doing reading this list when you can get hugs from girls *in a
> nightclub*? :-P

To prove that I am a dedicated Mentor ;-)

Well, seriously, I have this annoying phone that keeps notifying me of
incoming mails... If the Subject looks interesting, I just can't stay
away...

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: TablePane concept and tutorials and wiki

Posted by Martijn Dashorst <ma...@gmail.com>.
Without getting hugs from nice girls in a night club I was able to add
grandinj to the dev group.

Now we only need an answer to the question: what the hell are you
doing reading this list when you can get hugs from girls *in a
nightclub*? :-P

Martijn

On Thu, Jun 25, 2009 at 7:39 PM, Greg Brown<gk...@mac.com> wrote:
> Lovely. Enjoy!
>
> On Jun 25, 2009, at 1:22 PM, Niclas Hedhman wrote:
>
>> That happens when you get hugged. I was going to say if Martijn doesn't
>> beat
>> me to it, I'll do it tomorrow...
>>
>> Niclas
>>
>> On Jun 25, 2009 11:42 PM, "Greg Brown" <gk...@mac.com> wrote:
>>
>> You should have access to it if you have been added to the
>> pivot-developers
>> group, so I'm guessing that you have not. Unfortunately, this is not
>> something I have permission to manage. Niclas/Martijn, please remind me -
>> what is the correct way to request that Noel be added to this group? Do I
>> submit a JIRA request to the Infrastructure project, or is there another
>> way? Do either of you have permission to make this change?
>>
>> Thanks,
>> Greg
>>
>> On Jun 25, 2009, at 11:05 AM, Noel Grandin wrote: > > When I see these
>> kinds
>> of emails bouncing ...
>
>



-- 
Become a Wicket expert, learn from the best: http://wicketinaction.com
Apache Wicket 1.3.5 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.

Re: TablePane concept and tutorials and wiki

Posted by Greg Brown <gk...@mac.com>.
Lovely. Enjoy!

On Jun 25, 2009, at 1:22 PM, Niclas Hedhman wrote:

> That happens when you get hugged. I was going to say if Martijn  
> doesn't beat
> me to it, I'll do it tomorrow...
>
> Niclas
>
> On Jun 25, 2009 11:42 PM, "Greg Brown" <gk...@mac.com> wrote:
>
> You should have access to it if you have been added to the pivot- 
> developers
> group, so I'm guessing that you have not. Unfortunately, this is not
> something I have permission to manage. Niclas/Martijn, please remind  
> me -
> what is the correct way to request that Noel be added to this group?  
> Do I
> submit a JIRA request to the Infrastructure project, or is there  
> another
> way? Do either of you have permission to make this change?
>
> Thanks,
> Greg
>
> On Jun 25, 2009, at 11:05 AM, Noel Grandin wrote: > > When I see  
> these kinds
> of emails bouncing ...


Re: TablePane concept and tutorials and wiki

Posted by Niclas Hedhman <ni...@hedhman.org>.
That happens when you get hugged. I was going to say if Martijn doesn't beat
me to it, I'll do it tomorrow...

Niclas

On Jun 25, 2009 11:42 PM, "Greg Brown" <gk...@mac.com> wrote:

You should have access to it if you have been added to the pivot-developers
group, so I'm guessing that you have not. Unfortunately, this is not
something I have permission to manage. Niclas/Martijn, please remind me -
what is the correct way to request that Noel be added to this group? Do I
submit a JIRA request to the Infrastructure project, or is there another
way? Do either of you have permission to make this change?

Thanks,
Greg

On Jun 25, 2009, at 11:05 AM, Noel Grandin wrote: > > When I see these kinds
of emails bouncing ...

Re: TablePane concept and tutorials and wiki

Posted by Niclas Hedhman <ni...@hedhman.org>.
We can do, but not when I'm half drunk in night club with a couple of lovely
ladies. If it

On Jun 25, 2009 11:42 PM, "Greg Brown" <gk...@mac.com> wrote:

You should have access to it if you have been added to the pivot-developers
group, so I'm guessing that you have not. Unfortunately, this is not
something I have permission to manage. Niclas/Martijn, please remind me -
what is the correct way to request that Noel be added to this group? Do I
submit a JIRA request to the Infrastructure project, or is there another
way? Do either of you have permission to make this change?

Thanks,
Greg

On Jun 25, 2009, at 11:05 AM, Noel Grandin wrote: > > When I see these kinds
of emails bouncing ...

Re: TablePane concept and tutorials and wiki

Posted by Greg Brown <gk...@mac.com>.
You should have access to it if you have been added to the pivot- 
developers group, so I'm guessing that you have not. Unfortunately,  
this is not something I have permission to manage. Niclas/Martijn,  
please remind me - what is the correct way to request that Noel be  
added to this group? Do I submit a JIRA request to the Infrastructure  
project, or is there another way? Do either of you have permission to  
make this change?

Thanks,
Greg


On Jun 25, 2009, at 11:05 AM, Noel Grandin wrote:

>
> When I see these kinds of emails bouncing back and forth, I start
> thinking maybe we need an equivalent of the Swing Tutorial for Pivot.
> I know that I spent an awful lot of time in there when I was  
> learning swing.
>
> http://java.sun.com/docs/books/tutorial/uiswing/TOC.html
>
> Creating something similar in the Pivot wiki by cut'n'pasting from the
> mailing list would be a good way to start.
>
> Ah, I see we have one already. I was going to add Greg's reply to the
> wiki at
>  http://cwiki.apache.org/confluence/display/PIVOT/Table+Panes
> but my newly created account does not seem to have permission  
> (username:
> grandinj)
>
> Can someone grant me edit access to the Pivot wiki?
>
> Thanks, Noel.
>
>
> Niclas Hedhman wrote:
>> It does.
>> Thanks.
>>
>> On Jun 25, 2009 8:56 PM, "Greg Brown" <gk...@mac.com> wrote:
>>
>> TablePane has a "columns" collection and a "rows" collection. In  
>> WTKX, you
>> might define a table pane as follows:
>>
>> <TablePane>
>>   <columns>
>>       <TablePane.Column width="120"/>
>>       <TablePane.Column width="240"/>
>>   </columns>
>>   <rows>
>>       <TablePane.Row height="80">
>>           <ImageView image="a.png"/>
>>           <ImageView image="b.png"/>
>>       </TablePane.Row>
>>       <TablePane.Row height="160">
>>           <ImageView image="c.png"/>
>>           <ImageView image="d.png"/>
>>       </TablePane.Row>
>>   </rows>
>> </TablePane>
>>
>> This table pane would contain 4 ImageView cells, with column widths  
>> and row
>> heights as specified. It is analogous to defining a table in HTML,  
>> only we
>> require you to define your columns up front (so we don't have to  
>> infer them)
>> and we don't require the equivalent of <td> tags (any component can  
>> be a
>> cell).
>>
>> In Java, it would look like this:
>>
>> TablePane tablePane = new TablePane();
>> tablePane.getColumns().add(new TablePane.Column(120));
>> tablePane.getColumns().add(new TablePane.Column(240));
>>
>> TablePane.Row row1 = new TablePane.Row(80);
>> row1.add(new ImageView(Image.load(getClass().getResource("a.png"))));
>> row1.add(new ImageView(Image.load(getClass().getResource("b.png"))));
>> tablePane.getRows().add(row1);
>>
>> TablePane.Row row2 = new TablePane.Row(160);
>> row2.add(new ImageView(Image.load(getClass().getResource("c.png"))));
>> row2.add(new ImageView(Image.load(getClass().getResource("d.png"))));
>> tablePane.getRows().add(row2);
>>
>> Hope this helps.
>>
>> On Jun 25, 2009, at 6:17 AM, Niclas Hedhman wrote: > (Sorry for  
>> posting
>> here, but I am currently...
>>
>>
>


TablePane concept and tutorials and wiki

Posted by Noel Grandin <no...@gmail.com>.
When I see these kinds of emails bouncing back and forth, I start
thinking maybe we need an equivalent of the Swing Tutorial for Pivot.
I know that I spent an awful lot of time in there when I was learning swing.

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

Creating something similar in the Pivot wiki by cut'n'pasting from the
mailing list would be a good way to start.

Ah, I see we have one already. I was going to add Greg's reply to the
wiki at
  http://cwiki.apache.org/confluence/display/PIVOT/Table+Panes
but my newly created account does not seem to have permission (username:
grandinj)

Can someone grant me edit access to the Pivot wiki?

Thanks, Noel.


Niclas Hedhman wrote:
> It does.
> Thanks.
>
> On Jun 25, 2009 8:56 PM, "Greg Brown" <gk...@mac.com> wrote:
>
> TablePane has a "columns" collection and a "rows" collection. In WTKX, you
> might define a table pane as follows:
>
> <TablePane>
>    <columns>
>        <TablePane.Column width="120"/>
>        <TablePane.Column width="240"/>
>    </columns>
>    <rows>
>        <TablePane.Row height="80">
>            <ImageView image="a.png"/>
>            <ImageView image="b.png"/>
>        </TablePane.Row>
>        <TablePane.Row height="160">
>            <ImageView image="c.png"/>
>            <ImageView image="d.png"/>
>        </TablePane.Row>
>    </rows>
> </TablePane>
>
> This table pane would contain 4 ImageView cells, with column widths and row
> heights as specified. It is analogous to defining a table in HTML, only we
> require you to define your columns up front (so we don't have to infer them)
> and we don't require the equivalent of <td> tags (any component can be a
> cell).
>
> In Java, it would look like this:
>
> TablePane tablePane = new TablePane();
> tablePane.getColumns().add(new TablePane.Column(120));
> tablePane.getColumns().add(new TablePane.Column(240));
>
> TablePane.Row row1 = new TablePane.Row(80);
> row1.add(new ImageView(Image.load(getClass().getResource("a.png"))));
> row1.add(new ImageView(Image.load(getClass().getResource("b.png"))));
> tablePane.getRows().add(row1);
>
> TablePane.Row row2 = new TablePane.Row(160);
> row2.add(new ImageView(Image.load(getClass().getResource("c.png"))));
> row2.add(new ImageView(Image.load(getClass().getResource("d.png"))));
> tablePane.getRows().add(row2);
>
> Hope this helps.
>
> On Jun 25, 2009, at 6:17 AM, Niclas Hedhman wrote: > (Sorry for posting
> here, but I am currently...
>
>   


Re: TablePane concept...

Posted by Niclas Hedhman <ni...@hedhman.org>.
It does.
Thanks.

On Jun 25, 2009 8:56 PM, "Greg Brown" <gk...@mac.com> wrote:

TablePane has a "columns" collection and a "rows" collection. In WTKX, you
might define a table pane as follows:

<TablePane>
   <columns>
       <TablePane.Column width="120"/>
       <TablePane.Column width="240"/>
   </columns>
   <rows>
       <TablePane.Row height="80">
           <ImageView image="a.png"/>
           <ImageView image="b.png"/>
       </TablePane.Row>
       <TablePane.Row height="160">
           <ImageView image="c.png"/>
           <ImageView image="d.png"/>
       </TablePane.Row>
   </rows>
</TablePane>

This table pane would contain 4 ImageView cells, with column widths and row
heights as specified. It is analogous to defining a table in HTML, only we
require you to define your columns up front (so we don't have to infer them)
and we don't require the equivalent of <td> tags (any component can be a
cell).

In Java, it would look like this:

TablePane tablePane = new TablePane();
tablePane.getColumns().add(new TablePane.Column(120));
tablePane.getColumns().add(new TablePane.Column(240));

TablePane.Row row1 = new TablePane.Row(80);
row1.add(new ImageView(Image.load(getClass().getResource("a.png"))));
row1.add(new ImageView(Image.load(getClass().getResource("b.png"))));
tablePane.getRows().add(row1);

TablePane.Row row2 = new TablePane.Row(160);
row2.add(new ImageView(Image.load(getClass().getResource("c.png"))));
row2.add(new ImageView(Image.load(getClass().getResource("d.png"))));
tablePane.getRows().add(row2);

Hope this helps.

On Jun 25, 2009, at 6:17 AM, Niclas Hedhman wrote: > (Sorry for posting
here, but I am currently...

Re: TablePane concept...

Posted by Greg Brown <gk...@mac.com>.
TablePane has a "columns" collection and a "rows" collection. In WTKX,  
you might define a table pane as follows:

<TablePane>
     <columns>
         <TablePane.Column width="120"/>
         <TablePane.Column width="240"/>
     </columns>
     <rows>
         <TablePane.Row height="80">
             <ImageView image="a.png"/>
             <ImageView image="b.png"/>
         </TablePane.Row>
         <TablePane.Row height="160">
             <ImageView image="c.png"/>
             <ImageView image="d.png"/>
         </TablePane.Row>
     </rows>
</TablePane>

This table pane would contain 4 ImageView cells, with column widths  
and row heights as specified. It is analogous to defining a table in  
HTML, only we require you to define your columns up front (so we don't  
have to infer them) and we don't require the equivalent of <td> tags  
(any component can be a cell).

In Java, it would look like this:

TablePane tablePane = new TablePane();
tablePane.getColumns().add(new TablePane.Column(120));
tablePane.getColumns().add(new TablePane.Column(240));

TablePane.Row row1 = new TablePane.Row(80);
row1.add(new ImageView(Image.load(getClass().getResource("a.png"))));
row1.add(new ImageView(Image.load(getClass().getResource("b.png"))));
tablePane.getRows().add(row1);

TablePane.Row row2 = new TablePane.Row(160);
row2.add(new ImageView(Image.load(getClass().getResource("c.png"))));
row2.add(new ImageView(Image.load(getClass().getResource("d.png"))));
tablePane.getRows().add(row2);

Hope this helps.


On Jun 25, 2009, at 6:17 AM, Niclas Hedhman wrote:

> (Sorry for posting here, but I am currently unable to post to
> pivot-user@. Raised INFRA-2109 about it)
>
> Guys,
>
> I am struggling with TablePane, as it consistently refuse to work in a
> fashion that I find "natural".
>
> If I add() the ImageView instances to it, they all show up in cell
> [0,0], and if I call setCellComponent() I get a
> IndexOutOfBoundsException, even though I have added 2 columns and 1
> row (in that order) before trying to set the cell.
>
> But before starting on the real deal, I created an example where the
> Rows were added before the Columns, and that worked.
>
> How is it really intended to work?
>
> Looking at the code, If one adds a Row, then all Components found in
> the Row is added to the Pane, but I one adds a Column this is not
> done.
> Why do I need to bother with these kinds of details at all? Shouldn't
> it be so much more natural to just have an indicator on how many rows
> and columns one want, and a easier way to insert a new empty row or
> column?
> I just don't understand the thinking here...
>
> 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