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 defaultGridBagFormulas forGridBagBuilder.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description BUTTON_GROUPConstraints for a button group (aBoxor aJPanel).CHECK_BOXConstraints for aJCheckBox.LEFT_LABELLabel constraints forTEXT_FIELD.LISTConstraints for aJList.PANELConstraints for aJPanel.TABLEConstraints for aJTable.TEXT_AREAConstraints for aJTextArea.TEXT_FIELDConstraints for aJTextField.TOP_LABEL
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description GridBagFormulagetLabelConstraints()Get the constraints to use for the label associated with the current component.java.awt.GridBagConstraintssetConstraints(java.awt.GridBagConstraints gbc)Apply the constraints for the current component.static FormElementvalueOf(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_AREAandBUTTON_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 (aBoxor 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:GridBagFormulaGet the constraints to use for the label associated with the current component.- Specified by:
getLabelConstraintsin interfaceGridBagFormula
-
setConstraints
public java.awt.GridBagConstraints setConstraints(java.awt.GridBagConstraints gbc)
Description copied from interface:GridBagFormulaApply the constraints for the current component.- Specified by:
setConstraintsin interfaceGridBagFormula- Parameters:
gbc- the constraints to be updated- Returns:
- the updated
gbcparameter
-
-