GroupLayout.SequentialGroup (Java Platform SE 6) (original) (raw)
javax.swing
Class GroupLayout.SequentialGroup
java.lang.Object
javax.swing.GroupLayout.Group
javax.swing.GroupLayout.SequentialGroup
Enclosing class:
public class GroupLayout.SequentialGroup
extends GroupLayout.Group
A Group
that positions and sizes its elements sequentially, one after another. This class has no public constructor, use the createSequentialGroup
method to create one.
In order to align a SequentialGroup
along the baseline of a baseline aligned ParallelGroup
you need to specify which of the elements of the SequentialGroup
is used to determine the baseline. The element used to calculate the baseline is specified using one of the add
methods that take a boolean
. The last element added with a value oftrue
for useAsBaseline
is used to calculate the baseline.
Since:
1.6
See Also:
GroupLayout.createSequentialGroup()
Method Summary | |
---|---|
GroupLayout.SequentialGroup | [addComponent](../../javax/swing/GroupLayout.SequentialGroup.html#addComponent%28boolean, java.awt.Component%29)(boolean useAsBaseline,Component component) Adds a Component to this Group. |
GroupLayout.SequentialGroup | [addComponent](../../javax/swing/GroupLayout.SequentialGroup.html#addComponent%28boolean, java.awt.Component, int, int, int%29)(boolean useAsBaseline,Component component, int min, int pref, int max) Adds a Component to this Group with the specified size. |
GroupLayout.SequentialGroup | addComponent(Component component) Adds a Component to this Group. |
GroupLayout.SequentialGroup | [addComponent](../../javax/swing/GroupLayout.SequentialGroup.html#addComponent%28java.awt.Component, int, int, int%29)(Component component, int min, int pref, int max) Adds a Component to this Group with the specified size. |
GroupLayout.SequentialGroup | addContainerGap() Adds an element representing the preferred gap between an edge the container and components that touch the border of the container. |
GroupLayout.SequentialGroup | [addContainerGap](../../javax/swing/GroupLayout.SequentialGroup.html#addContainerGap%28int, int%29)(int pref, int max) Adds an element representing the preferred gap between one edge of the container and the next or previous Component with the specified size. |
GroupLayout.SequentialGroup | addGap(int size) Adds a rigid gap to this Group. |
GroupLayout.SequentialGroup | [addGap](../../javax/swing/GroupLayout.SequentialGroup.html#addGap%28int, int, int%29)(int min, int pref, int max) Adds a gap to this Group with the specified size. |
GroupLayout.SequentialGroup | [addGroup](../../javax/swing/GroupLayout.SequentialGroup.html#addGroup%28boolean, javax.swing.GroupLayout.Group%29)(boolean useAsBaseline,GroupLayout.Group group) Adds a Group to this Group. |
GroupLayout.SequentialGroup | addGroup(GroupLayout.Group group) Adds a Group to this Group. |
GroupLayout.SequentialGroup | [addPreferredGap](../../javax/swing/GroupLayout.SequentialGroup.html#addPreferredGap%28javax.swing.JComponent, javax.swing.JComponent, javax.swing.LayoutStyle.ComponentPlacement%29)(JComponent comp1,JComponent comp2,LayoutStyle.ComponentPlacement type) Adds an element representing the preferred gap between two components. |
GroupLayout.SequentialGroup | [addPreferredGap](../../javax/swing/GroupLayout.SequentialGroup.html#addPreferredGap%28javax.swing.JComponent, javax.swing.JComponent, javax.swing.LayoutStyle.ComponentPlacement, int, int%29)(JComponent comp1,JComponent comp2,LayoutStyle.ComponentPlacement type, int pref, int max) Adds an element representing the preferred gap between two components. |
GroupLayout.SequentialGroup | addPreferredGap(LayoutStyle.ComponentPlacement type) Adds an element representing the preferred gap between the nearest components. |
GroupLayout.SequentialGroup | [addPreferredGap](../../javax/swing/GroupLayout.SequentialGroup.html#addPreferredGap%28javax.swing.LayoutStyle.ComponentPlacement, int, int%29)(LayoutStyle.ComponentPlacement type, int pref, int max) Adds an element representing the preferred gap between the nearest components. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, [wait](../../java/lang/Object.html#wait%28long, int%29) |
Method Detail |
---|
addGroup
public GroupLayout.SequentialGroup addGroup(GroupLayout.Group group)
Adds a Group
to this Group
.
Overrides:
[addGroup](../../javax/swing/GroupLayout.Group.html#addGroup%28javax.swing.GroupLayout.Group%29)
in class [GroupLayout.Group](../../javax/swing/GroupLayout.Group.html "class in javax.swing")
Parameters:
group
- the Group
to add
Returns:
this Group
addGroup
public GroupLayout.SequentialGroup addGroup(boolean useAsBaseline, GroupLayout.Group group)
Adds a Group
to this Group
.
Parameters:
group
- the Group
to add
useAsBaseline
- whether the specified Group
should be used to calculate the baseline for this Group
Returns:
this Group
addComponent
public GroupLayout.SequentialGroup addComponent(Component component)
Adds a Component
to this Group
.
Overrides:
[addComponent](../../javax/swing/GroupLayout.Group.html#addComponent%28java.awt.Component%29)
in class [GroupLayout.Group](../../javax/swing/GroupLayout.Group.html "class in javax.swing")
Parameters:
component
- the Component
to add
Returns:
this Group
addComponent
public GroupLayout.SequentialGroup addComponent(boolean useAsBaseline, Component component)
Adds a Component
to this Group
.
Parameters:
useAsBaseline
- whether the specified Component
should be used to calculate the baseline for this Group
component
- the Component
to add
Returns:
this Group
addComponent
public GroupLayout.SequentialGroup addComponent(Component component, int min, int pref, int max)
Adds a Component
to this Group
with the specified size.
Overrides:
[addComponent](../../javax/swing/GroupLayout.Group.html#addComponent%28java.awt.Component, int, int, int%29)
in class [GroupLayout.Group](../../javax/swing/GroupLayout.Group.html "class in javax.swing")
Parameters:
component
- the Component
to add
min
- the minimum size or one of DEFAULT_SIZE
orPREFERRED_SIZE
pref
- the preferred size or one of DEFAULT_SIZE
orPREFERRED_SIZE
max
- the maximum size or one of DEFAULT_SIZE
orPREFERRED_SIZE
Returns:
this Group
addComponent
public GroupLayout.SequentialGroup addComponent(boolean useAsBaseline, Component component, int min, int pref, int max)
Adds a Component
to this Group
with the specified size.
Parameters:
useAsBaseline
- whether the specified Component
should be used to calculate the baseline for this Group
component
- the Component
to add
min
- the minimum size or one of DEFAULT_SIZE
orPREFERRED_SIZE
pref
- the preferred size or one of DEFAULT_SIZE
orPREFERRED_SIZE
max
- the maximum size or one of DEFAULT_SIZE
orPREFERRED_SIZE
Returns:
this Group
addGap
public GroupLayout.SequentialGroup addGap(int size)
Adds a rigid gap to this Group
.
Overrides:
[addGap](../../javax/swing/GroupLayout.Group.html#addGap%28int%29)
in class [GroupLayout.Group](../../javax/swing/GroupLayout.Group.html "class in javax.swing")
Parameters:
size
- the size of the gap
Returns:
this Group
addGap
public GroupLayout.SequentialGroup addGap(int min, int pref, int max)
Adds a gap to this Group
with the specified size.
Overrides:
[addGap](../../javax/swing/GroupLayout.Group.html#addGap%28int, int, int%29)
in class [GroupLayout.Group](../../javax/swing/GroupLayout.Group.html "class in javax.swing")
Parameters:
min
- the minimum size of the gap
pref
- the preferred size of the gap
max
- the maximum size of the gap
Returns:
this Group
addPreferredGap
public GroupLayout.SequentialGroup addPreferredGap(JComponent comp1, JComponent comp2, LayoutStyle.ComponentPlacement type)
Adds an element representing the preferred gap between two components. The element created to represent the gap is not resizable.
Parameters:
comp1
- the first component
comp2
- the second component
type
- the type of gap; one of the constants defined byLayoutStyle
Returns:
this SequentialGroup
Throws:
[IllegalArgumentException](../../java/lang/IllegalArgumentException.html "class in java.lang")
- if type
, comp1
orcomp2
is null
See Also:
addPreferredGap
public GroupLayout.SequentialGroup addPreferredGap(JComponent comp1, JComponent comp2, LayoutStyle.ComponentPlacement type, int pref, int max)
Adds an element representing the preferred gap between two components.
Parameters:
comp1
- the first component
comp2
- the second component
type
- the type of gap
pref
- the preferred size of the grap; one ofDEFAULT_SIZE
or a value >= 0
max
- the maximum size of the gap; one ofDEFAULT_SIZE
, PREFERRED_SIZE
or a value >= 0
Returns:
this SequentialGroup
Throws:
[IllegalArgumentException](../../java/lang/IllegalArgumentException.html "class in java.lang")
- if type
, comp1
orcomp2
is null
See Also:
addPreferredGap
public GroupLayout.SequentialGroup addPreferredGap(LayoutStyle.ComponentPlacement type)
Adds an element representing the preferred gap between the nearest components. During layout, neighboring components are found, and the size of the added gap is set based on the preferred gap between the components. If no neighboring components are found the gap has a size of 0
.
The element created to represent the gap is not resizable.
Parameters:
type
- the type of gap; one ofLayoutStyle.ComponentPlacement.RELATED
orLayoutStyle.ComponentPlacement.UNRELATED
Returns:
this SequentialGroup
Throws:
[IllegalArgumentException](../../java/lang/IllegalArgumentException.html "class in java.lang")
- if type
is not one ofLayoutStyle.ComponentPlacement.RELATED
orLayoutStyle.ComponentPlacement.UNRELATED
See Also:
addPreferredGap
public GroupLayout.SequentialGroup addPreferredGap(LayoutStyle.ComponentPlacement type, int pref, int max)
Adds an element representing the preferred gap between the nearest components. During layout, neighboring components are found, and the minimum of this gap is set based on the size of the preferred gap between the neighboring components. If no neighboring components are found the minimum size is set to 0.
Parameters:
type
- the type of gap; one ofLayoutStyle.ComponentPlacement.RELATED
orLayoutStyle.ComponentPlacement.UNRELATED
pref
- the preferred size of the grap; one ofDEFAULT_SIZE
or a value >= 0
max
- the maximum size of the gap; one ofDEFAULT_SIZE
, PREFERRED_SIZE
or a value >= 0
Returns:
this SequentialGroup
Throws:
[IllegalArgumentException](../../java/lang/IllegalArgumentException.html "class in java.lang")
- if type
is not one ofLayoutStyle.ComponentPlacement.RELATED
orLayoutStyle.ComponentPlacement.UNRELATED
See Also:
addContainerGap
public GroupLayout.SequentialGroup addContainerGap()
Adds an element representing the preferred gap between an edge the container and components that touch the border of the container. This has no effect if the added gap does not touch an edge of the parent container.
The element created to represent the gap is not resizable.
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 or previous Component
with the specified size. This has no effect if the next or 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
- the maximum size; one of DEFAULT_SIZE
,PREFERRED_SIZE
or a value >= 0
Returns:
this SequentialGroup
Submit a bug or feature
For further API reference and developer documentation, see Java SE Developer Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2015, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.
Scripting on this page tracks web page traffic, but does not change the content in any way.