KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > java > awt > LayoutManager


1 /*
2  * @(#)LayoutManager.java 1.25 03/12/19
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7 package java.awt;
8
9 /**
10  * Defines the interface for classes that know how to lay out
11  * <code>Container</code>s.
12  *
13  * @see Container
14  *
15  * @version 1.25, 12/19/03
16  * @author Sami Shaio
17  * @author Arthur van Hoff
18  */

19 public interface LayoutManager {
20     /**
21      * If the layout manager uses a per-component string,
22      * adds the component <code>comp</code> to the layout,
23      * associating it
24      * with the string specified by <code>name</code>.
25      *
26      * @param name the string to be associated with the component
27      * @param comp the component to be added
28      */

29     void addLayoutComponent(String JavaDoc name, Component JavaDoc comp);
30
31     /**
32      * Removes the specified component from the layout.
33      * @param comp the component to be removed
34      */

35     void removeLayoutComponent(Component JavaDoc comp);
36
37     /**
38      * Calculates the preferred size dimensions for the specified
39      * container, given the components it contains.
40      * @param parent the container to be laid out
41      *
42      * @see #minimumLayoutSize
43      */

44     Dimension JavaDoc preferredLayoutSize(Container JavaDoc parent);
45
46     /**
47      * Calculates the minimum size dimensions for the specified
48      * container, given the components it contains.
49      * @param parent the component to be laid out
50      * @see #preferredLayoutSize
51      */

52     Dimension JavaDoc minimumLayoutSize(Container JavaDoc parent);
53
54     /**
55      * Lays out the specified container.
56      * @param parent the container to be laid out
57      */

58     void layoutContainer(Container JavaDoc parent);
59 }
60
Popular Tags