Class GroupLayout.SequentialGroup
- Enclosing class:
GroupLayout
A Group that lays out its elements sequentially, one
after another. This class has no public constructor, use the
createSequentialGroup method to create one.
See also
- #createSequentialGroup()
-
Method Summary
Modifier and TypeMethodDescriptionAdds aComponentto thisGroup.Adds aComponentto thisGroupwith the specified size.add(boolean useAsBaseline, GroupLayout.Group group) Adds aGroupto thisGroup.add(int pref) Adds a rigid gap.add(int min, int pref, int max) Adds a gap with the specified size.Adds the specified Component.Adds the specifiedComponent.add(GroupLayout.Group group) Adds the specifiedGroupto thisSequentialGroupAdds an element representing the preferred gap between one edge of the container and the next/previous Component.addContainerGap(int pref, int max) Adds an element representing the preferred gap between one edge of the container and the next/previous Component.addPreferredGap(int type) Adds an element representing the preferred gap between the nearest components.addPreferredGap(int type, int pref, int max) Adds an element for the preferred gap between the nearest components.addPreferredGap(Component comp1, Component comp2, int type) Adds an element representing the preferred gap between the two components.addPreferredGap(Component comp1, Component comp2, int type, boolean canGrow) Adds an element representing the preferred gap between the two components.
-
Method Details
-
add
Adds the specified
Groupto thisSequentialGroupParameters
group: the Group to add
Returns
this Group
-
add
Adds a
Groupto thisGroup.Parameters
-
group: theGroupto add -
useAsBaseline: @param useAsBaseline whether the specifiedGroupshould be used to calculate the baseline for thisGroup
Returns
this
Group -
-
add
Adds the specified Component. If the Component's min/max are different from its pref than the component will be resizable.
Parameters
component: the Component to add
Returns
this
SequentialGroup -
add
Adds a
Componentto thisGroup.Parameters
-
useAsBaseline: @param useAsBaseline whether the specifiedComponentshould be used to calculate the baseline for thisGroup -
component: theComponentto add
Returns
this
Group -
-
add
Adds the specified
Component. Min, pref and max can be absolute values, or they can be one ofDEFAULT_SIZEorPREFERRED_SIZE. For example, the following:add(component, PREFERRED_SIZE, PREFERRED_SIZE, 1000);Forces a max of 1000, with the min and preferred equalling that of the preferred size of
component.Parameters
-
component: the Component to add -
min: the minimum size -
pref: the preferred size -
max: the maximum size
Returns
this
SequentialGroupThrows
IllegalArgumentException: @throws IllegalArgumentException if min, pref or max are not positive and not one of PREFERRED_SIZE or DEFAULT_SIZE
-
-
add
public GroupLayout.SequentialGroup add(boolean useAsBaseline, Component component, int min, int pref, int max) Adds a
Componentto thisGroupwith the specified size.Parameters
-
useAsBaseline: @param useAsBaseline whether the specifiedComponentshould be used to calculate the baseline for thisGroup -
component: theComponentto add -
min: @param min the minimum size or one ofDEFAULT_SIZEorPREFERRED_SIZE -
pref: @param pref the preferred size or one ofDEFAULT_SIZEorPREFERRED_SIZE -
max: @param max the maximum size or one ofDEFAULT_SIZEorPREFERRED_SIZE
Returns
this
Group -
-
add
Adds a rigid gap.
Parameters
pref: the size of the gap
Returns
this
SequentialGroupThrows
IllegalArgumentException: @throws IllegalArgumentException if min < 0 or pref < 0 or max < 0 or the following is not meant min <= pref <= max
-
add
Adds a gap with the specified size.
Parameters
-
min: the minimum size of the gap, or PREFERRED_SIZE -
pref: the preferred size of the gap -
max: the maximum size of the gap, or PREFERRED_SIZE
Returns
this
SequentialGroupThrows
IllegalArgumentException: @throws IllegalArgumentException if min < 0 or pref < 0 or max < 0 or the following is not meant min <= pref <= max
-
-
addPreferredGap
Adds an element representing the preferred gap between the two components.
Parameters
-
comp1: the first component -
comp2: the second component -
type: @param type the type of gap; one of the constants defined by LayoutStyle
Returns
this
SequentialGroupThrows
IllegalArgumentException: @throws IllegalArgumentException iftypeis not a valid LayoutStyle constant
See also
- LayoutStyle
-
-
addPreferredGap
public GroupLayout.SequentialGroup addPreferredGap(Component comp1, Component comp2, int type, boolean canGrow) Adds an element representing the preferred gap between the two components.
Parameters
-
comp1: the first component -
comp2: the second component -
type: @param type the type of gap; one of the constants defined by LayoutStyle -
canGrow: @param canGrow true if the gap can grow if more space is available
Returns
this
SequentialGroupThrows
IllegalArgumentException: @throws IllegalArgumentException iftypeis not a valid LayoutStyle constant
See also
- LayoutStyle
-
-
addPreferredGap
Adds an element representing the preferred gap between the nearest components. That is, during layout the neighboring components are found, and the min, pref and max of this element is set based on the preferred gap between the components. If no neighboring components are found the min, pref and max are set to 0.
Parameters
type: the type of gap; one of the LayoutStyle constants
Returns
this SequentialGroup
Throws
IllegalArgumentException: @throws IllegalArgumentException if type is not one ofLayoutStyle.RELATEDorLayoutStyle.UNRELATED
See also
- LayoutStyle
-
addPreferredGap
Adds an element for the preferred gap between the nearest components. That is, during layout the neighboring components are found, and the min of this element is set based on the preferred gap between the components. If no neighboring components are found the min is set to 0. This method allows you to specify the preferred and maximum size by way of the
prefandmaxarguments. These can either be a value >= 0, in which case the preferred or max is the max of the argument and the preferred gap, of DEFAULT_VALUE in which case the value is the same as the preferred gap.Parameters
-
type: @param type the type of gap; one of LayoutStyle.RELATED or LayoutStyle.UNRELATED -
pref: the preferred size; one of DEFAULT_SIZE or a value > 0 -
max: @param max the maximum size; one of DEFAULT_SIZE, PREFERRED_SIZE or a value > 0
Returns
this SequentialGroup
Throws
IllegalArgumentException: @throws IllegalArgumentException if type is not one ofLayoutStyle.RELATEDorLayoutStyle.UNRELATEDor pref/max is != DEFAULT_SIZE and max
See also
- LayoutStyle
-
-
addContainerGap
Adds an element representing the preferred gap between one edge of the container and the next/previous Component. This will have no effect if the next/previous element is not a Component and does not touch one edge of the parent container.
Returns
this
SequentialGroup. -
addContainerGap
Adds an element representing the preferred gap between one edge of the container and the next/previous Component. This will have no effect if the next/previous element is not a Component and does not touch one edge of the parent container.
Parameters
-
pref: the preferred size; one of DEFAULT_SIZE or a value > 0 -
max: @param max the maximum size; one of DEFAULT_SIZE, PREFERRED_SIZE or a value > 0.
Returns
this
SequentialGroupThrows
IllegalArgumentException: @throws IllegalArgumentException if pref/max is != DEFAULT_SIZE and max
-
-