1. /*
  2. * @(#)LayoutManager.java 1.24 03/01/23
  3. *
  4. * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package java.awt;
  8. /**
  9. * Defines the interface for classes that know how to lay out
  10. * <code>Container</code>s.
  11. *
  12. * @see Container
  13. *
  14. * @version 1.24, 01/23/03
  15. * @author Sami Shaio
  16. * @author Arthur van Hoff
  17. */
  18. public interface LayoutManager {
  19. /**
  20. * If the layout manager uses a per-component string,
  21. * adds the component <code>comp</code> to the layout,
  22. * associating it
  23. * with the string specified by <code>name</code>.
  24. *
  25. * @param name the string to be associated with the component
  26. * @param comp the component to be added
  27. */
  28. void addLayoutComponent(String name, Component comp);
  29. /**
  30. * Removes the specified component from the layout.
  31. * @param comp the component to be removed
  32. */
  33. void removeLayoutComponent(Component comp);
  34. /**
  35. * Calculates the preferred size dimensions for the specified
  36. * container, given the components it contains.
  37. * @param parent the container to be laid out
  38. *
  39. * @see #minimumLayoutSize
  40. */
  41. Dimension preferredLayoutSize(Container parent);
  42. /**
  43. * Calculates the minimum size dimensions for the specified
  44. * container, given the components it contains.
  45. * @param parent the component to be laid out
  46. * @see #preferredLayoutSize
  47. */
  48. Dimension minimumLayoutSize(Container parent);
  49. /**
  50. * Lays out the specified container.
  51. * @param parent the container to be laid out
  52. */
  53. void layoutContainer(Container parent);
  54. }