• Post Reply Bookmark Topic Watch Topic
  • New Topic

Horizontal/Sideways tree control?  RSS feed

 
John Lussmyer
Greenhorn
Posts: 2
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm looking for a tree control that looks more like a sideways Family tree design, like this:



Basically, root node at left (centered vertically), the child nodes branching to the right.

Anyone know of such a control?
(preferably to use with a Eclipse SWT app.)
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've not seen any component like your pic.

currently, under (beside) Root you have child 1,2 and 3. If there was another child at this level where would it go?

currently, under (beside) child 1 you have child 4 and 5. If there were 3 more children here, where would they go?
would they collide with (currently) child 6's space?

if the above scenario's cannot happen i.e. it is all preset per the pic, perhaps you might be able to position JLabels
on a JPanel and draw connecting lines between them. add a mouselistener to the labels to expand/collapse (visible true/false).
 
John Lussmyer
Greenhorn
Posts: 2
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's just a rough sketch.
The general idea is that the parent is centered to the left of it's children.
The vertical child spacing will vary depending on how many children/grandchildren/etc.. they have.
Yeah, I could write one, but was hoping somebody would have already done so for org charts, family trees, etc...
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!