| 237 | } |
| 238 | |
| 239 | void setClassTree( Class clas ) { |
| 240 | if ( clas == null ) { |
| 241 | tree.setModel( null ); |
| 242 | return; |
| 243 | } |
| 244 | |
| 245 | MutableTreeNode bottom = null, top = null; |
| 246 | DefaultMutableTreeNode up; |
| 247 | do { |
| 248 | up= new DefaultMutableTreeNode( clas.toString() ); |
| 249 | if ( top != null ) |
| 250 | up.add( top ); |
| 251 | else |
| 252 | bottom = up; |
| 253 | top = up; |
| 254 | } while ( (clas = clas.getSuperclass()) != null ); |
| 255 | tree.setModel( new DefaultTreeModel(top) ); |
| 256 | |
| 257 | TreeNode tn = bottom.getParent(); |
| 258 | if ( tn != null ) { |
| 259 | TreePath tp = new TreePath ( |
| 260 | ((DefaultTreeModel)tree.getModel()).getPathToRoot( tn ) ); |
| 261 | tree.expandPath( tp ); |
| 262 | } |
| 263 | } |
| 264 | |
| 265 | JPanel labeledPane( JComponent comp, String label ) { |
| 266 | JPanel jp = new JPanel( new BorderLayout() ); |