1. /*
  2. * @(#)TreeCellRenderer.java 1.14 01/11/29
  3. *
  4. * Copyright 2002 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package javax.swing.tree;
  8. import java.awt.Component;
  9. import javax.swing.JTree;
  10. /**
  11. * Defines the requirements for an object that displays a tree node.
  12. *
  13. * @version 1.14 11/29/01
  14. * @author Rob Davis
  15. * @author Ray Ryan
  16. * @author Scott Violet
  17. */
  18. public interface TreeCellRenderer {
  19. /**
  20. * Sets the value of the current tree cell to <code>value</code>.
  21. * If <code>selected</code> is true, the cell will be drawn as if
  22. * selected. If <code>expanded</code> is true the node is currently
  23. * expanded and if <code>leaf</code> is true the node represets a
  24. * leaf anf if <code>hasFocus</code> is true the node currently has
  25. * focus. <code>tree</code> is the JTree the receiver is being
  26. * configured for.
  27. * Returns the Component that the renderer uses to draw the value.
  28. *
  29. * @return Component that the renderer uses to draw the value.
  30. */
  31. Component getTreeCellRendererComponent(JTree tree, Object value,
  32. boolean selected, boolean expanded,
  33. boolean leaf, int row, boolean hasFocus);
  34. }