[jug-discussion] Tree with multiple expandable "roots"?

2004-08-23 Thread Tim Colson

A standard tree looks like so:
--
-root 
 + item1
 + item2
  - sub a
  - sub b
 + item3

I'd prefer to NOT show the root node, but have the others.
-
+ item1
+ item2
 - sub a
 - sub b
+ item3

I tried : tree.setRootVisible(false); 

It hid the root like I wanted and 1st level kids are shown; however, none of
the kids are expandable. 

What'd I miss?
TLC



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: [jug-discussion] Create a Tree from unordered files

2004-08-23 Thread Tim Colson
> My first thought is to create a HashMap of the data, register 
> the children with their parents, and then build the tree from the root on
down. 

Perhaps not the most elegant, but that approach worked. Still curious if
others have alternative suggestions.

Now the tree needs sorted.  

Question: 
a) Sort before loading into the tree? 
 or
b) Sort after the tree is loaded?

I can do (a) relatively easily by having each item return the list of
children in sorted order.

But (b) has appeal since I could theorhetically add more items anywhere, and
then have the tree resort itself. It does not look like the API has anything
ready-built for this... seems I'd have to manually remove and insert nodes
to sort them. Am I missing any convenience stuff, or just a case of "it is
what it is"?

-Tim
P.S. For the curious, I'm parsing FAQ-O-Matic data files.









-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]