Enum CellAlignment
- java.lang.Object
-
- java.lang.Enum<CellAlignment>
-
- net.sf.jguiraffe.gui.layout.CellAlignment
-
- All Implemented Interfaces:
Serializable
,Comparable<CellAlignment>
public enum CellAlignment extends Enum<CellAlignment>
An enumeration class that defines the possible alignments of components in the cells of a percent layout.
The alignment determines how components are positioned in the cell(s) they are contained. For instance, they can be configured to fill the whole cell. If the size of the hosting container changes, the sizes of the components are adapted to fit into the new cell size. It is also possible to specify that components should keep their original size. Then they can be aligned at the start of the cell, the end of the cell, or its center.
The alignment constants defined here work for both columns and rows. Therefore generic names like
START
orEND
are used rather than column- or row-specific terms like left, right, or top. Nevertheless, the meaning should be obvious. TheCellConstraints
class defines a property of this class.- Version:
- $Id: CellAlignment.java 205 2012-01-29 18:29:57Z oheger $
- Author:
- Oliver Heger
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static CellAlignment
valueOf(String name)
Returns the enum constant of this type with the specified name.static CellAlignment[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
START
public static final CellAlignment START
The alignment start. This alignment means that components are positioned at the beginning of the cell they belong to, i.e. at the left side for columns and at the top for rows.
-
CENTER
public static final CellAlignment CENTER
The alignment center. This alignment means that components are centered in the cell they belong to (either in X or in Y direction, depending on the type of constraint).
-
END
public static final CellAlignment END
The alignment end. This alignment means that components are positioned at the end of the cell they belong to, i.e. at the right side for columns and at the bottom for rows.
-
FULL
public static final CellAlignment FULL
The alignment full. This alignment means that components always fill the whole cell they belong to (either in X or in Y direction, depending on the type of constraint). If the size of the cell in the corresponding direction changes, the size of the component is adjusted, too.
-
-
Method Detail
-
values
public static CellAlignment[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (CellAlignment c : CellAlignment.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static CellAlignment valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
-