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

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

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

Lays out components as though they were pinned to a bulletin board, meaning:

Components are moved to the location that was set by calling or setBounds(). Components are sized according to the size that was set by calls to either setSize() or setBounds(). If either the width or height of the component is 0, the component is sized to its preferred size. AWT Caveats: Buttons, Labels, Checkboxes and Choices do not take kindly to being resized - it is better to let them take on their preferred sizes instead. Lists must be moved and shaped only after their peers are created. Choices can only be moved after their peers are created.

Version:
1.0, Apr 1, 1996, 1.1, Oct 24, 1996, 1.15, Oct 23, 2001 Fixed bug that reported wrong preferred and minimum sizes. layoutContainer() now reshapes components according to their actual sizes. If a component has a zero width or height, then its preferred size is used to reshape. The purpose of the hashtable is not clear. All it accomplishes is to extend the lifetime of the layouted components until the BulletinLayout is finalized, and would make the layouts "slide" every time layoutContainer() is called...
Author:
David Geary, modified by Juha Vierinen & Jukka Santala

Constructor Summary
BulletinLayout()
           
 
Method Summary
 void addLayoutComponent(java.lang.String s, java.awt.Component comp)
           
 void layoutContainer(java.awt.Container target)
           
 java.awt.Dimension minimumLayoutSize(java.awt.Container target)
           
 java.awt.Dimension preferredLayoutSize(java.awt.Container target)
           
 void removeLayoutComponent(java.awt.Component comp)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BulletinLayout

public BulletinLayout()
Method Detail

addLayoutComponent

public void addLayoutComponent(java.lang.String s,
                               java.awt.Component comp)
Specified by:
addLayoutComponent in interface java.awt.LayoutManager

removeLayoutComponent

public void removeLayoutComponent(java.awt.Component comp)
Specified by:
removeLayoutComponent in interface java.awt.LayoutManager

preferredLayoutSize

public java.awt.Dimension preferredLayoutSize(java.awt.Container target)
Specified by:
preferredLayoutSize in interface java.awt.LayoutManager

minimumLayoutSize

public java.awt.Dimension minimumLayoutSize(java.awt.Container target)
Specified by:
minimumLayoutSize in interface java.awt.LayoutManager

layoutContainer

public void layoutContainer(java.awt.Container target)
Specified by:
layoutContainer in interface java.awt.LayoutManager


X-Smiles 1.2