/** * Display the tree rooted at node tn in the graph as a dendogram. * * @param tn the root node of the tree to display */ private void display(TreeNode tn) { double[] segs = dendogram(tn); double distance = 10.; if (tn instanceof Cluster) { distance = ((Cluster) tn).getSimilarity(); } else { distance = ((DefaultMutableTreeNode) tn).getDepth(); } gs.setData(segs, GraphDataModel.FORMAT_XY); graph.getXAxis().setMin(distance); graph.getXAxis().setMax(0.); graph.getYAxis().setMin(tm.getRowCount() - .5); graph.getYAxis().setMax(-.5); repaint(); }