fi.hut.tml.xsmiles.gui.components.awt
Class StackedLayout

java.lang.Object
  extended byfi.hut.tml.xsmiles.gui.components.awt.StackedLayout
All Implemented Interfaces:
java.awt.LayoutManager

public class StackedLayout
extends java.lang.Object
implements java.awt.LayoutManager

This layout manager places all of the components the same size and places them at the same position. This is an appropriate layout manager for a JLayeredPane.

Version:
$Id: StackedLayout.java 4936 2004-03-26 10:50:06Z honkkis $
Author:
Charles Loomis

Constructor Summary
StackedLayout()
          Create a new StackedLayout manager.
 
Method Summary
 void addLayoutComponent(java.lang.String name, java.awt.Component comp)
          Adds the specified component with the specified name to the layout.
protected  java.awt.Dimension getLayoutSize(java.awt.Container parent, boolean isPreferred)
          Scan the list of components and pick out the largest width and height.
 void layoutContainer(java.awt.Container parent)
          Lays out the components in the specified container.
 java.awt.Dimension minimumLayoutSize(java.awt.Container parent)
          Calculates the minimum size dimensions for the specified panel given the components in the specified parent container.
 java.awt.Dimension preferredLayoutSize(java.awt.Container parent)
          Calculates the preferred size dimensions for the specified panel given the components in the specified parent container.
 void removeLayoutComponent(java.awt.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
 

Constructor Detail

StackedLayout

public StackedLayout()
Create a new StackedLayout manager.

Method Detail

addLayoutComponent

public void addLayoutComponent(java.lang.String name,
                               java.awt.Component comp)
Adds the specified component with the specified name to the layout. (This method actually does nothing since the component list is obtained from the container directly.)

Specified by:
addLayoutComponent in interface java.awt.LayoutManager
Parameters:
name - the name of the component
comp - the component to add

removeLayoutComponent

public void removeLayoutComponent(java.awt.Component comp)
Removes the specified component from the layout. (This method actually does nothing since the component list is obtained from the container directly.)

Specified by:
removeLayoutComponent in interface java.awt.LayoutManager
Parameters:
comp - the component to be removed

preferredLayoutSize

public java.awt.Dimension preferredLayoutSize(java.awt.Container parent)
Calculates the preferred size dimensions for the specified panel given the components in the specified parent container.

Specified by:
preferredLayoutSize in interface java.awt.LayoutManager
Parameters:
parent - the component to be laid out
See Also:
minimumLayoutSize(java.awt.Container)

minimumLayoutSize

public java.awt.Dimension minimumLayoutSize(java.awt.Container parent)
Calculates the minimum size dimensions for the specified panel given the components in the specified parent container.

Specified by:
minimumLayoutSize in interface java.awt.LayoutManager
Parameters:
parent - the component to be laid out
See Also:
preferredLayoutSize(java.awt.Container)

getLayoutSize

protected java.awt.Dimension getLayoutSize(java.awt.Container parent,
                                           boolean isPreferred)
Scan the list of components and pick out the largest width and height.

Parameters:
parent - the container in which to do the layout.
isPreferred - true for calculating preferred size, false for calculating minimum size.
Returns:
the largest width and height needed

layoutContainer

public void layoutContainer(java.awt.Container parent)
Lays out the components in the specified container.

Specified by:
layoutContainer in interface java.awt.LayoutManager
Parameters:
parent - the component which needs to be laid out


X-Smiles 1.2