1. /*
  2. * @(#)LayoutManager2.java 1.10 00/02/02
  3. *
  4. * Copyright 1996-2000 Sun Microsystems, Inc. All Rights Reserved.
  5. *
  6. * This software is the proprietary information of Sun Microsystems, Inc.
  7. * Use is subject to license terms.
  8. *
  9. */
  10. package java.awt;
  11. /**
  12. * Defines an interface for classes that know how to layout Containers
  13. * based on a layout constraints object.
  14. *
  15. * This interface extends the LayoutManager interface to deal with layouts
  16. * explicitly in terms of constraint objects that specify how and where
  17. * components should be added to the layout.
  18. * <p>
  19. * This minimal extension to LayoutManager is intended for tool
  20. * providers who wish to the creation of constraint-based layouts.
  21. * It does not yet provide full, general support for custom
  22. * constraint-based layout managers.
  23. *
  24. * @see LayoutManager
  25. * @see Container
  26. *
  27. * @version 1.10, 02/02/00
  28. * @author Jonni Kanerva
  29. */
  30. public interface LayoutManager2 extends LayoutManager {
  31. /**
  32. * Adds the specified component to the layout, using the specified
  33. * constraint object.
  34. * @param comp the component to be added
  35. * @param constraints where/how the component is added to the layout.
  36. */
  37. void addLayoutComponent(Component comp, Object constraints);
  38. /**
  39. * Returns the maximum size of this component.
  40. * @see java.awt.Component#getMinimumSize()
  41. * @see java.awt.Component#getPreferredSize()
  42. * @see LayoutManager
  43. */
  44. public Dimension maximumLayoutSize(Container target);
  45. /**
  46. * Returns the alignment along the x axis. This specifies how
  47. * the component would like to be aligned relative to other
  48. * components. The value should be a number between 0 and 1
  49. * where 0 represents alignment along the origin, 1 is aligned
  50. * the furthest away from the origin, 0.5 is centered, etc.
  51. */
  52. public float getLayoutAlignmentX(Container target);
  53. /**
  54. * Returns the alignment along the y axis. This specifies how
  55. * the component would like to be aligned relative to other
  56. * components. The value should be a number between 0 and 1
  57. * where 0 represents alignment along the origin, 1 is aligned
  58. * the furthest away from the origin, 0.5 is centered, etc.
  59. */
  60. public float getLayoutAlignmentY(Container target);
  61. /**
  62. * Invalidates the layout, indicating that if the layout manager
  63. * has cached information it should be discarded.
  64. */
  65. public void invalidateLayout(Container target);
  66. }