Package io.github.jonestimd.swing.layout
Enum FormElement
- java.lang.Object
-
- java.lang.Enum<FormElement>
-
- io.github.jonestimd.swing.layout.FormElement
-
- All Implemented Interfaces:
GridBagFormula
,java.io.Serializable
,java.lang.Comparable<FormElement>
public enum FormElement extends java.lang.Enum<FormElement> implements GridBagFormula
The defaultGridBagFormula
s forGridBagBuilder
.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description BUTTON_GROUP
Constraints for a button group (aBox
or aJPanel
).CHECK_BOX
Constraints for aJCheckBox
.LEFT_LABEL
Label constraints forTEXT_FIELD
.LIST
Constraints for aJList
.PANEL
Constraints for aJPanel
.TABLE
Constraints for aJTable
.TEXT_AREA
Constraints for aJTextArea
.TEXT_FIELD
Constraints for aJTextField
.TOP_LABEL
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description GridBagFormula
getLabelConstraints()
Get the constraints to use for the label associated with the current component.java.awt.GridBagConstraints
setConstraints(java.awt.GridBagConstraints gbc)
Apply the constraints for the current component.static FormElement
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static FormElement[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
TOP_LABEL
public static final FormElement TOP_LABEL
Label constraints forTABLE
,LIST
,TEXT_AREA
andBUTTON_GROUP
. The label is placed on the row above the component.
-
LEFT_LABEL
public static final FormElement LEFT_LABEL
Label constraints forTEXT_FIELD
. The label is placed in the column to the left of the field.
-
BUTTON_GROUP
public static final FormElement BUTTON_GROUP
Constraints for a button group (aBox
or aJPanel
). Two columns wide and no vertical growth.
-
CHECK_BOX
public static final FormElement CHECK_BOX
Constraints for aJCheckBox
.
-
TEXT_FIELD
public static final FormElement TEXT_FIELD
Constraints for aJTextField
.
-
TEXT_AREA
public static final FormElement TEXT_AREA
Constraints for aJTextArea
.
-
LIST
public static final FormElement LIST
Constraints for aJList
.
-
TABLE
public static final FormElement TABLE
Constraints for aJTable
.
-
PANEL
public static final FormElement PANEL
Constraints for aJPanel
.
-
-
Method Detail
-
values
public static FormElement[] 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 (FormElement c : FormElement.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static FormElement valueOf(java.lang.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:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
getLabelConstraints
public GridBagFormula getLabelConstraints()
Description copied from interface:GridBagFormula
Get the constraints to use for the label associated with the current component.- Specified by:
getLabelConstraints
in interfaceGridBagFormula
-
setConstraints
public java.awt.GridBagConstraints setConstraints(java.awt.GridBagConstraints gbc)
Description copied from interface:GridBagFormula
Apply the constraints for the current component.- Specified by:
setConstraints
in interfaceGridBagFormula
- Parameters:
gbc
- the constraints to be updated- Returns:
- the updated
gbc
parameter
-
-