Skip to main content

JXTreeTable Updates

No replies
Joined: 2006-06-08

I have just commited updates for bugs 218, 219, and 220.

JXTreeTable no longer uses AbstractTreeTableModel.hierarchicalColumnClass to determine which column is the tree column. The field is deprecated and should be used only for as long as it takes to upgrade the TreeTableModel to utilize the newer codebase.

I have altered the way the AbstractTreeTableModel and DefaultTreeTableModel work. The Abstract no longer assumes any type of node. It only implements method that require no real knowledge of the tree. I have made corresponding updates to FileSystemModel to demonstrate how to create a TreeTableModel that extends AbstractTreeTableModel, but does not use TreeNodes (as the old version expected). Some methods migrate into the Abstract and some out of it.

The DefaultTreeTableModel now expects the tree objects to be TreeTableNodes. A TreeTableNode is a TreeNode that contains extra methods for handling the tabular structure of the JXTreeTable. The TreeTableNode hierarchy has several interfaces and class. Most likely you will extends AbstractTreeTableNode, which requires you to define getValueAt. There is a DefaultTreeTableNode, for a quick and dirty implementation. This node returns the toString of the contained user object and supports only one column.

This is a brief overview of the new code. I have attempted to document the code significantly with JavaDoc. Please refer to the documentation first. If it is unclear, please post your problems with it, so I can address them. If you have any questions, please post.