Package org.jdesktop.layout
Class GroupLayout.SequentialGroup
- java.lang.Object
-
- org.jdesktop.layout.GroupLayout.Group
-
- org.jdesktop.layout.GroupLayout.SequentialGroup
-
- Enclosing class:
- GroupLayout
public class GroupLayout.SequentialGroup extends GroupLayout.Group
AGroup
that lays out its elements sequentially, one after another. This class has no public constructor, use thecreateSequentialGroup
method to create one.- See Also:
GroupLayout.createSequentialGroup()
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GroupLayout.SequentialGroup
add(boolean useAsBaseline, java.awt.Component component)
Adds aComponent
to thisGroup
.GroupLayout.SequentialGroup
add(boolean useAsBaseline, java.awt.Component component, int min, int pref, int max)
Adds aComponent
to thisGroup
with the specified size.GroupLayout.SequentialGroup
add(boolean useAsBaseline, GroupLayout.Group group)
Adds aGroup
to thisGroup
.GroupLayout.SequentialGroup
add(int pref)
Adds a rigid gap.GroupLayout.SequentialGroup
add(int min, int pref, int max)
Adds a gap with the specified size.GroupLayout.SequentialGroup
add(java.awt.Component component)
Adds the specified Component.GroupLayout.SequentialGroup
add(java.awt.Component component, int min, int pref, int max)
Adds the specifiedComponent
.GroupLayout.SequentialGroup
add(GroupLayout.Group group)
Adds the specifiedGroup
to thisSequentialGroup
GroupLayout.SequentialGroup
addContainerGap()
Adds an element representing the preferred gap between one edge of the container and the next/previous Component.GroupLayout.SequentialGroup
addContainerGap(int pref, int max)
Adds an element representing the preferred gap between one edge of the container and the next/previous Component.GroupLayout.SequentialGroup
addPreferredGap(int type)
Adds an element representing the preferred gap between the nearest components.GroupLayout.SequentialGroup
addPreferredGap(int type, int pref, int max)
Adds an element for the preferred gap between the nearest components.GroupLayout.SequentialGroup
addPreferredGap(javax.swing.JComponent comp1, javax.swing.JComponent comp2, int type)
Adds an element representing the preferred gap between the two components.GroupLayout.SequentialGroup
addPreferredGap(javax.swing.JComponent comp1, javax.swing.JComponent comp2, int type, boolean canGrow)
Adds an element representing the preferred gap between the two components.
-
-
-
Method Detail
-
add
public GroupLayout.SequentialGroup add(GroupLayout.Group group)
Adds the specifiedGroup
to thisSequentialGroup
- Parameters:
group
- the Group to add- Returns:
- this Group
-
add
public GroupLayout.SequentialGroup add(boolean useAsBaseline, GroupLayout.Group group)
Adds aGroup
to thisGroup
.- Parameters:
group
- theGroup
to adduseAsBaseline
- whether the specifiedGroup
should be used to calculate the baseline for thisGroup
- Returns:
- this
Group
-
add
public GroupLayout.SequentialGroup add(java.awt.Component component)
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
public GroupLayout.SequentialGroup add(boolean useAsBaseline, java.awt.Component component)
Adds aComponent
to thisGroup
.- Parameters:
useAsBaseline
- whether the specifiedComponent
should be used to calculate the baseline for thisGroup
component
- theComponent
to add- Returns:
- this
Group
-
add
public GroupLayout.SequentialGroup add(java.awt.Component component, int min, int pref, int max)
Adds the specifiedComponent
. Min, pref and max can be absolute values, or they can be one ofDEFAULT_SIZE
orPREFERRED_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 ofcomponent
.- Parameters:
component
- the Component to addmin
- the minimum sizepref
- the preferred sizemax
- the maximum size- Returns:
- this
SequentialGroup
- Throws:
java.lang.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, java.awt.Component component, int min, int pref, int max)
Adds aComponent
to thisGroup
with the specified size.- Parameters:
useAsBaseline
- whether the specifiedComponent
should be used to calculate the baseline for thisGroup
component
- theComponent
to addmin
- the minimum size or one ofDEFAULT_SIZE
orPREFERRED_SIZE
pref
- the preferred size or one ofDEFAULT_SIZE
orPREFERRED_SIZE
max
- the maximum size or one ofDEFAULT_SIZE
orPREFERRED_SIZE
- Returns:
- this
Group
-
add
public GroupLayout.SequentialGroup add(int pref)
Adds a rigid gap.- Parameters:
pref
- the size of the gap- Returns:
- this
SequentialGroup
- Throws:
java.lang.IllegalArgumentException
- if min < 0 or pref < 0 or max < 0 or the following is not meant min <= pref <= max
-
add
public GroupLayout.SequentialGroup add(int min, int pref, int max)
Adds a gap with the specified size.- Parameters:
min
- the minimum size of the gap, or PREFERRED_SIZEpref
- the preferred size of the gapmax
- the maximum size of the gap, or PREFERRED_SIZE- Returns:
- this
SequentialGroup
- Throws:
java.lang.IllegalArgumentException
- if min < 0 or pref < 0 or max < 0 or the following is not meant min <= pref <= max
-
addPreferredGap
public GroupLayout.SequentialGroup addPreferredGap(javax.swing.JComponent comp1, javax.swing.JComponent comp2, int type)
Adds an element representing the preferred gap between the two components.- Parameters:
comp1
- the first componentcomp2
- the second componenttype
- the type of gap; one of the constants defined by LayoutStyle- Returns:
- this
SequentialGroup
- Throws:
java.lang.IllegalArgumentException
- iftype
is not a valid LayoutStyle constant- See Also:
LayoutStyle
-
addPreferredGap
public GroupLayout.SequentialGroup addPreferredGap(javax.swing.JComponent comp1, javax.swing.JComponent comp2, int type, boolean canGrow)
Adds an element representing the preferred gap between the two components.- Parameters:
comp1
- the first componentcomp2
- the second componenttype
- the type of gap; one of the constants defined by LayoutStylecanGrow
- true if the gap can grow if more space is available- Returns:
- this
SequentialGroup
- Throws:
java.lang.IllegalArgumentException
- iftype
is not a valid LayoutStyle constant- See Also:
LayoutStyle
-
addPreferredGap
public GroupLayout.SequentialGroup addPreferredGap(int type)
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:
java.lang.IllegalArgumentException
- if type is not one ofLayoutStyle.RELATED
orLayoutStyle.UNRELATED
- See Also:
LayoutStyle
-
addPreferredGap
public GroupLayout.SequentialGroup addPreferredGap(int type, int pref, int max)
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 thepref
andmax
arguments. 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
- the type of gap; one of LayoutStyle.RELATED or LayoutStyle.UNRELATEDpref
- the preferred size; one of DEFAULT_SIZE or a value > 0max
- the maximum size; one of DEFAULT_SIZE, PREFERRED_SIZE or a value > 0- Returns:
- this SequentialGroup
- Throws:
java.lang.IllegalArgumentException
- if type is not one ofLayoutStyle.RELATED
orLayoutStyle.UNRELATED
or pref/max is != DEFAULT_SIZE and < 0, or pref > max- See Also:
LayoutStyle
-
addContainerGap
public GroupLayout.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.- Returns:
- this
SequentialGroup
.
-
addContainerGap
public GroupLayout.SequentialGroup addContainerGap(int pref, int max)
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 > 0max
- the maximum size; one of DEFAULT_SIZE, PREFERRED_SIZE or a value > 0.- Returns:
- this
SequentialGroup
- Throws:
java.lang.IllegalArgumentException
- if pref/max is != DEFAULT_SIZE and < 0, or pref > max
-
-