FreeHEP API
Version current

org.freehep.swing.layout
Class StackedLayout

java.lang.Object
  extended byorg.freehep.swing.layout.StackedLayout
All Implemented Interfaces:
LayoutManager

public class StackedLayout
extends Object
implements 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,v 1.1 2000/10/20 13:39:31 loomis Exp $
Author:
Charles Loomis
Source Code:
StackedLayout.java

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

Constructor Detail

StackedLayout

public StackedLayout()
Create a new StackedLayout manager.

Method Detail

addLayoutComponent

public void addLayoutComponent(String name,
                               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 LayoutManager
Parameters:
name - the name of the component
comp - the component to add

removeLayoutComponent

public void removeLayoutComponent(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 LayoutManager
Parameters:
comp - the component to be removed

preferredLayoutSize

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

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

minimumLayoutSize

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

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

getLayoutSize

protected Dimension getLayoutSize(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(Container parent)
Lays out the components in the specified container.

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

FreeHEP API
Version current

Copyright © 2000-2004 FreeHEP, All Rights Reserved.