Tree-table component

Discussion in 'Java' started by Patrick, Nov 19, 2008.

  1. Patrick

    Patrick Guest

    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
     
    Patrick, Nov 19, 2008
    #1
    1. Advertising

  2. 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
     
    Stefan Rybacki, Nov 19, 2008
    #2
    1. Advertising

  3. Patrick

    Patrick Guest

    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
     
    Patrick, Nov 19, 2008
    #3
  4. On 2008-11-19, Patrick <> 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.pvv.org/~bcd
    powered by emacs
     
    Bent C Dalager, Nov 19, 2008
    #4
  5. In article <4923f122$0$4912$>,
    Patrick <> 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/
     
    John B. Matthews, Nov 19, 2008
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Soni
    Replies:
    0
    Views:
    1,094
  2. Karuppasamy

    com+ component and Component Service

    Karuppasamy, Jan 13, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    619
    Karuppasamy
    Jan 13, 2004
  3. Karuppasamy

    com+ component and Component Service

    Karuppasamy, Jan 13, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    2,549
  4. Karuppasamy

    Remoting Component --> Com+ Component:

    Karuppasamy, Jan 15, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    667
    Karuppasamy
    Jan 15, 2004
  5. Stub

    B tree, B+ tree and B* tree

    Stub, Nov 12, 2003, in forum: C Programming
    Replies:
    3
    Views:
    10,182
Loading...

Share This Page