Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Tree-table component

Reply
Thread Tools

Tree-table component

 
 
Patrick
Guest
Posts: n/a
 
      11-19-2008
Hello,

Is it possible to have a tree-table component with the tree spanning
over all columns? I mean, each branch level in a different column?
Something like this:

-A1 | | |
| -A2 | |
| | A3 |
| +B2 | |
| -C2 | |
| | B3 |
| | C3 |

My priority target is SWT, but I'd also like to know what exists in Swing.
Thanks in advance!

--
Patrick
 
Reply With Quote
 
 
 
 
Stefan Rybacki
Guest
Posts: n/a
 
      11-19-2008
Patrick schrieb:
> Hello,
>
> Is it possible to have a tree-table component with the tree spanning
> over all columns? I mean, each branch level in a different column?
> Something like this:
>
> -A1 | | |
> | -A2 | |
> | | A3 |
> | +B2 | |
> | -C2 | |
> | | B3 |
> | | C3 |
>
> My priority target is SWT, but I'd also like to know what exists in Swing.
> Thanks in advance!
>


There is definitely something in SWT (TreeTable) but nothing comparable in
Swing. I'm aware though of an article series how to write a TreeTable in Swing
which dates way back to Java 1.3 times I think. And if I remember correct wasn't
the best way of implementing a TreeTable. But the guys from Netbeans created a
more sophisticated tree table component called Outline. You might want to have a
look at it.

Stefan
 
Reply With Quote
 
 
 
 
Patrick
Guest
Posts: n/a
 
      11-19-2008
Le 19/11/2008 11:23, Stefan Rybacki a écrit :
> Patrick schrieb:
>> Hello,
>>
>> Is it possible to have a tree-table component with the tree spanning
>> over all columns? I mean, each branch level in a different column?
>> Something like this:
>>
>> -A1 | | |
>> | -A2 | |
>> | | A3 |
>> | +B2 | |
>> | -C2 | |
>> | | B3 |
>> | | C3 |
>>
>> My priority target is SWT, but I'd also like to know what exists in
>> Swing.
>> Thanks in advance!
>>

>
> There is definitely something in SWT (TreeTable) but nothing comparable
> in Swing. I'm aware though of an article series how to write a TreeTable
> in Swing which dates way back to Java 1.3 times I think. And if I
> remember correct wasn't the best way of implementing a TreeTable. But
> the guys from Netbeans created a more sophisticated tree table component
> called Outline. You might want to have a look at it.


Thanks, but this is not what I'm looking for.
SWT TreeTable, and Outline component, only have a tree limited to the
first column, followed by normal table columns, like this:

-A1 | 2 | 3 |
-A2 | 2 | 3 |
A3 | 2 | 3 |
+B2 | 2 | 3 |
-C2 | 2 | 3 |
B3 | 2 | 3 |
C3 | 2 | 3 |

But I want tree branches spanned over different columns, like this:

-A1 | | | 4 | 5 |
| -A2 | | 4 | 5 |
| | A3 | 4 | 5 |
| +B2 | | 4 | 5 |
| -C2 | | 4 | 5 |
| | B3 | 4 | 5 |
| | C3 | 4 | 5 |

Other suggestions?

--
Patrick
 
Reply With Quote
 
Bent C Dalager
Guest
Posts: n/a
 
      11-19-2008
On 2008-11-19, Patrick <(E-Mail Removed)> wrote:
>
> Thanks, but this is not what I'm looking for.
> SWT TreeTable, and Outline component, only have a tree limited to the
> first column, followed by normal table columns, like this:
>
> -A1 | 2 | 3 |
> -A2 | 2 | 3 |
> A3 | 2 | 3 |
> +B2 | 2 | 3 |
> -C2 | 2 | 3 |
> B3 | 2 | 3 |
> C3 | 2 | 3 |
>
> But I want tree branches spanned over different columns, like this:
>
> -A1 | | | 4 | 5 |
> | -A2 | | 4 | 5 |
> | | A3 | 4 | 5 |
> | +B2 | | 4 | 5 |
> | -C2 | | 4 | 5 |
> | | B3 | 4 | 5 |
> | | C3 | 4 | 5 |
>
> Other suggestions?
>


I think the primary difficulty with such a component is in defining
the behaviour when expanding one of the deepest shown nodes. That is,
if you have

-A1 | | | 4 | 5 |
| -A2 | | 4 | 5 |
| | +A3 | 4 | 5 |
| +B2 | | 4 | 5 |
| -C2 | | 4 | 5 |
| | B3 | 4 | 5 |
| | C3 | 4 | 5 |

and you expand A3, what should happen? Should a new column magically
appear or should there already have been an empty column there in
anticipation of the potential future expansion event?

As for Swing, once this behaviour has been defined your requirement
appears to be relatively easily adaptable from the existing
only-one-tree-column JTreeTable component. Basically all you need to
do is spread the cropped cell renderers and editors across multiple
columns rather than just the one.

Cheers,
Bent D
--
Bent Dalager - http://www.velocityreviews.com/forums/(E-Mail Removed) - http://www.pvv.org/~bcd
powered by emacs
 
Reply With Quote
 
John B. Matthews
Guest
Posts: n/a
 
      11-19-2008
In article <4923f122$0$4912$(E-Mail Removed)>,
Patrick <(E-Mail Removed)> wrote:

[...]
> SWT TreeTable, and Outline component, only have a tree limited to the
> first column, followed by normal table columns, like this:
>
> -A1 | 2 | 3 |
> -A2 | 2 | 3 |
> A3 | 2 | 3 |
> +B2 | 2 | 3 |
> -C2 | 2 | 3 |
> B3 | 2 | 3 |
> C3 | 2 | 3 |
>
> But I want tree branches spanned over different columns, like this:
>
> -A1 | | | 4 | 5 |
> | -A2 | | 4 | 5 |
> | | A3 | 4 | 5 |
> | +B2 | | 4 | 5 |
> | -C2 | | 4 | 5 |
> | | B3 | 4 | 5 |
> | | C3 | 4 | 5 |
>
> Other suggestions?


This article, cited in another thread, mentions indenting as a function
of depth:

<http://www.jroller.com/santhosh/entry/tree_inside_jcombobox>

--
John B. Matthews
trashgod at gmail dot com
http://home.roadrunner.com/~jbmatthews/
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Remoting Component --> Com+ Component: Karuppasamy ASP .Net 0 01-15-2004 10:21 AM
com+ component and Component Service Karuppasamy ASP .Net 1 01-14-2004 11:30 PM
com+ component and Component Service Karuppasamy ASP .Net 0 01-13-2004 06:09 PM
using client-side component keeps calling component's init Jim Hammond ASP .Net 1 11-12-2003 08:13 PM
Re: Calling a .NET component from a COM component remotely Soni ASP .Net 0 07-25-2003 04:33 AM



Advertisments