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 the possible alignments of components in
21 * the cells of a <em>percent layout</em>.
22 * </p>
23 * <p>
24 * The alignment determines how components are positioned in the cell(s) they
25 * are contained. For instance, they can be configured to fill the whole cell.
26 * If the size of the hosting container changes, the sizes of the components are
27 * adapted to fit into the new cell size. It is also possible to specify that
28 * components should keep their original size. Then they can be aligned at the
29 * start of the cell, the end of the cell, or its center.
30 * </p>
31 * <p>
32 * The alignment constants defined here work for both columns and rows.
33 * Therefore generic names like {@code START} or {@code END} are used rather
34 * than column- or row-specific terms like <em>left</em>, <em>right</em>, or
35 * <em>top</em>. Nevertheless, the meaning should be obvious. The
36 * {@link CellConstraints} class defines a property of this class.
37 * </p>
38 *
39 * @author Oliver Heger
40 * @version $Id: CellAlignment.java 205 2012-01-29 18:29:57Z oheger $
41 */
42 public enum CellAlignment
43 {
44 /**
45 * The alignment <em>start</em>. This alignment means that components are
46 * positioned at the beginning of the cell they belong to, i.e. at the left
47 * side for columns and at the top for rows.
48 */
49 START,
50
51 /**
52 * The alignment <em>center</em>. This alignment means that components are
53 * centered in the cell they belong to (either in X or in Y direction,
54 * depending on the type of constraint).
55 */
56 CENTER,
57
58 /**
59 * The alignment <em>end</em>. This alignment means that components are
60 * positioned at the end of the cell they belong to, i.e. at the right side
61 * for columns and at the bottom for rows.
62 */
63 END,
64
65 /**
66 * The alignment <em>full</em>. This alignment means that components always
67 * fill the whole cell they belong to (either in X or in Y direction,
68 * depending on the type of constraint). If the size of the cell in the
69 * corresponding direction changes, the size of the component is adjusted,
70 * too.
71 */
72 FULL
73 }