01: /*
02: * @(#)LayoutManager2.java 1.14 06/10/10
03: *
04: * Copyright 1990-2006 Sun Microsystems, Inc. All Rights Reserved.
05: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
06: *
07: * This program is free software; you can redistribute it and/or
08: * modify it under the terms of the GNU General Public License version
09: * 2 only, as published by the Free Software Foundation.
10: *
11: * This program is distributed in the hope that it will be useful, but
12: * WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * General Public License version 2 for more details (a copy is
15: * included at /legal/license.txt).
16: *
17: * You should have received a copy of the GNU General Public License
18: * version 2 along with this work; if not, write to the Free Software
19: * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20: * 02110-1301 USA
21: *
22: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
23: * Clara, CA 95054 or visit www.sun.com if you need additional
24: * information or have any questions.
25: *
26: */
27: package java.awt;
28:
29: /**
30: * Defines an interface for classes that know how to layout Containers
31: * based on a layout constraints object.
32: *
33: * This interface extends the LayoutManager interface to deal with layouts
34: * explicitly in terms of constraint objects that specify how and where
35: * components should be added to the layout.
36: * <p>
37: * This minimal extension to LayoutManager is intended for tool
38: * providers who wish to the creation of constraint-based layouts.
39: * It does not yet provide full, general support for custom
40: * constraint-based layout managers.
41: *
42: * @see LayoutManager
43: * @see Container
44: *
45: * @version 1.10, 08/19/02
46: * @author Jonni Kanerva
47: */
48: public interface LayoutManager2 extends LayoutManager {
49: /**
50: * Adds the specified component to the layout, using the specified
51: * constraint object.
52: * @param comp the component to be added
53: * @param constraints where/how the component is added to the layout.
54: */
55: void addLayoutComponent(Component comp, Object constraints);
56:
57: /**
58: * Returns the maximum size of this component.
59: * @see java.awt.Component#getMinimumSize()
60: * @see java.awt.Component#getPreferredSize()
61: * @see LayoutManager
62: */
63: public Dimension maximumLayoutSize(Container target);
64:
65: /**
66: * Returns the alignment along the x axis. This specifies how
67: * the component would like to be aligned relative to other
68: * components. The value should be a number between 0 and 1
69: * where 0 represents alignment along the origin, 1 is aligned
70: * the furthest away from the origin, 0.5 is centered, etc.
71: */
72: public float getLayoutAlignmentX(Container target);
73:
74: /**
75: * Returns the alignment along the y axis. This specifies how
76: * the component would like to be aligned relative to other
77: * components. The value should be a number between 0 and 1
78: * where 0 represents alignment along the origin, 1 is aligned
79: * the furthest away from the origin, 0.5 is centered, etc.
80: */
81: public float getLayoutAlignmentY(Container target);
82:
83: /**
84: * Invalidates the layout, indicating that if the layout manager
85: * has cached information it should be discarded.
86: */
87: public void invalidateLayout(Container target);
88: }
|