|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jdesktop.swingx.StackLayout
public class StackLayout
StackLayout is a Swing layout aimed to act as the layers
stack of most popuplar graphics editing tools like The GIMP or
Photoshop. While similar to CardLayout, this layout
displays all the components of the container. If you are using non-rectangular
components (i.e. transparent) you will see them from top to bottom of the
stack.
When using this layout, each component can be added in the container either on top of the stack or at the bootom:
JPanel panel = new JPanel(new StackLayout());
panel.add(new JLabel("On top"), StackLayout.TOP);
panel.add(new JLabel("At bottom"), StackLayout.BOTTOM);
If you don't specify the constraint, the component will be added at the top
of the components stack.
All the components managed by this layout will be given the same size as the container itself. The minimum, maximum and preferred size of the container are based upon the largest minimum, maximum and preferred size of the children components.
StackLayout works only with JSE 1.5 and Java SE 6 and
greater.
| Field Summary | |
|---|---|
static String |
BOTTOM
Use this constraint to add a component at the bottom of the stack. |
static String |
TOP
Use this contrainst to add a component at the top of the stack. |
| Constructor Summary | |
|---|---|
StackLayout()
|
|
| Method Summary | |
|---|---|
void |
addLayoutComponent(Component comp,
Object constraints)
Adds the specified component to the layout, using the specified constraint object. |
void |
addLayoutComponent(String name,
Component comp)
If the layout manager uses a per-component string, adds the component comp to the layout,
associating it
with the string specified by name. |
float |
getLayoutAlignmentX(Container target)
Returns the alignment along the x axis. |
float |
getLayoutAlignmentY(Container target)
Returns the alignment along the y axis. |
void |
invalidateLayout(Container target)
Invalidates the layout, indicating that if the layout manager has cached information it should be discarded. |
void |
layoutContainer(Container parent)
Lays out the specified container. |
Dimension |
maximumLayoutSize(Container target)
Calculates the maximum size dimensions for the specified container, given the components it contains. |
Dimension |
minimumLayoutSize(Container parent)
Calculates the minimum size dimensions for the specified container, given the components it contains. |
Dimension |
preferredLayoutSize(Container parent)
Calculates the preferred size dimensions for the specified container, given the components it contains. |
void |
removeLayoutComponent(Component comp)
Removes the specified component from the layout. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String BOTTOM
public static final String TOP
| Constructor Detail |
|---|
public StackLayout()
| Method Detail |
|---|
public void addLayoutComponent(Component comp,
Object constraints)
addLayoutComponent in interface LayoutManager2comp - the component to be addedconstraints - where/how the component is added to the layout.
public void addLayoutComponent(String name,
Component comp)
comp to the layout,
associating it
with the string specified by name.
addLayoutComponent in interface LayoutManagername - the string to be associated with the componentcomp - the component to be addedpublic void removeLayoutComponent(Component comp)
removeLayoutComponent in interface LayoutManagercomp - the component to be removedpublic float getLayoutAlignmentX(Container target)
getLayoutAlignmentX in interface LayoutManager2public float getLayoutAlignmentY(Container target)
getLayoutAlignmentY in interface LayoutManager2public void invalidateLayout(Container target)
invalidateLayout in interface LayoutManager2public Dimension preferredLayoutSize(Container parent)
preferredLayoutSize in interface LayoutManagerparent - the container to be laid outLayoutManager.minimumLayoutSize(java.awt.Container)public Dimension minimumLayoutSize(Container parent)
minimumLayoutSize in interface LayoutManagerparent - the component to be laid outLayoutManager.preferredLayoutSize(java.awt.Container)public Dimension maximumLayoutSize(Container target)
maximumLayoutSize in interface LayoutManager2Component.getMaximumSize(),
LayoutManagerpublic void layoutContainer(Container parent)
layoutContainer in interface LayoutManagerparent - the container to be laid out
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||