private void setPoints(TreeNode node, int depth, int thisDepth, int leaves,
			int[] sofar, Map nodeToPoint) {
		TreeNode[] children = Trees.children(node);
		float y = (float) (thisDepth + 1) / (float) (depth + 2);
		if (children.length == 0) {
			// It is a leaf!
			float x = (float) (sofar[0] + 1) / (float) (leaves + 1);
			nodeToPoint.put(node, new Point2D.Float(x, y));
			sofar[0]++;
			return;
		}
		// Not a leaf!
		for (int i = 0; i < children.length; i++)
			setPoints(children[i], depth, thisDepth + 1, leaves, sofar,
					nodeToPoint);
		Point2D leftmost = (Point2D) nodeToPoint.get(children[0]);
		Point2D rightmost = (Point2D) nodeToPoint
				.get(children[children.length - 1]);
		float x = (float) ((leftmost.getX() + rightmost.getX()) / 2.0);
		nodeToPoint.put(node, new Point2D.Float(x, y));
	}