View Javadoc

1   /*
2    * Copyright 2006-2016 The JGUIraffe Team.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License")
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *     http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package net.sf.jguiraffe.gui.layout;
17  
18  /**
19   * <p>
20   * An enumeration class that defines possible sizes for the cells of a
21   * <em>percent layout</em>.
22   * </p>
23   * <p>
24   * A constant defined by this enumeration class is used to specify the sizing
25   * behavior of cells in the layout. It is evaluated to calculate the optimum
26   * size of the container to layout. The constants represent different strategies
27   * for querying the sizes of contained components. Based on these sizes the
28   * required space is calculated.
29   * </p>
30   * <p>
31   * The {@link CellConstraints} class has a property of this type.
32   * </p>
33   *
34   * @author Oliver Heger
35   * @version $Id: CellSize.java 205 2012-01-29 18:29:57Z oheger $
36   */
37  public enum CellSize
38  {
39      /**
40       * The size constant <em>preferred</em>. To determine the optimum size of a
41       * cell the preferred size of the contained component is evaluated.
42       */
43      PREFERRED,
44  
45      /**
46       * The size constant <em>minimum</em>. To determine the optimum size of a
47       * cell the minimum size of the contained component is evaluated.
48       */
49      MINIMUM,
50  
51      /**
52       * The size constant <em>none</em>. This means that the size of a component
53       * contained in this cell is ignored. This is appropriate for cells that do
54       * not contain components, but act as delimiters between other cells (e.g. a
55       * column that separates labels from their associated input fields).
56       * Typically these cells are assigned a fix size, so that no size
57       * calculation is required.
58       */
59      NONE
60  }