home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 November / Chip_1998-11_cd.bin / tema / Cafe / main.bin / LayoutManager2.java < prev    next >
Text File  |  1997-05-20  |  3KB  |  86 lines

  1. /*
  2.  * @(#)LayoutManager2.java    1.5 97/02/12
  3.  * 
  4.  * Copyright (c) 1995, 1996 Sun Microsystems, Inc. All Rights Reserved.
  5.  * 
  6.  * This software is the confidential and proprietary information of Sun
  7.  * Microsystems, Inc. ("Confidential Information").  You shall not
  8.  * disclose such Confidential Information and shall use it only in
  9.  * accordance with the terms of the license agreement you entered into
  10.  * with Sun.
  11.  * 
  12.  * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
  13.  * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  14.  * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
  15.  * PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES
  16.  * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
  17.  * THIS SOFTWARE OR ITS DERIVATIVES.
  18.  * 
  19.  * CopyrightVersion 1.1_beta
  20.  * 
  21.  */
  22. package java.awt;
  23.  
  24. /** 
  25.  * Defines an interface for classes that know how to layout Containers
  26.  * based on a layout constraints object.
  27.  *
  28.  * This interface extends the LayoutManager interface to deal with layouts
  29.  * explicitly in terms of constraint objects that specify how and where
  30.  * components should be added to the layout.
  31.  * <p>
  32.  * This minimal extension to LayoutManager is intended for tool
  33.  * providers who wish to the creation of constraint-based layouts.
  34.  * It does not yet provide full, general support for custom
  35.  * constraint-based layout managers.
  36.  *
  37.  * @see LayoutManager
  38.  * @see Container
  39.  *
  40.  * @version    1.5, 02/12/97
  41.  * @author     Jonni Kanerva
  42.  */
  43. public interface LayoutManager2 extends LayoutManager {
  44.  
  45.     /**
  46.      * Adds the specified component to the layout, using the specified
  47.      * constraint object.
  48.      * @param comp the component to be added
  49.      * @param constraints  where/how the component is added to the layout.
  50.      */
  51.     void addLayoutComponent(Component comp, Object constraints);
  52.  
  53.     /** 
  54.      * Returns the maximum size of this component.
  55.      * @see java.awt.Component#getMinimumSize()
  56.      * @see java.awt.Component#getPreferredSize()
  57.      * @see LayoutManager
  58.      */
  59.     public Dimension maximumLayoutSize(Container target);
  60.  
  61.     /**
  62.      * Returns the alignment along the x axis.  This specifies how
  63.      * the component would like to be aligned relative to other 
  64.      * components.  The value should be a number between 0 and 1
  65.      * where 0 represents alignment along the origin, 1 is aligned
  66.      * the furthest away from the origin, 0.5 is centered, etc.
  67.      */
  68.     public float getLayoutAlignmentX(Container target);
  69.  
  70.     /**
  71.      * Returns the alignment along the y axis.  This specifies how
  72.      * the component would like to be aligned relative to other 
  73.      * components.  The value should be a number between 0 and 1
  74.      * where 0 represents alignment along the origin, 1 is aligned
  75.      * the furthest away from the origin, 0.5 is centered, etc.
  76.      */
  77.     public float getLayoutAlignmentY(Container target);
  78.  
  79.     /**
  80.      * Invalidates the layout, indicating that if the layout manager
  81.      * has cached information it should be discarded.
  82.      */
  83.     public void invalidateLayout(Container target);
  84.  
  85. }
  86.