net.wotonomy.ui.swing.components
Class BetterRootLayout

java.lang.Object
  extended by java.awt.BorderLayout
      extended by net.wotonomy.ui.swing.components.BetterRootLayout
All Implemented Interfaces:
java.awt.LayoutManager, java.awt.LayoutManager2, java.io.Serializable

public class BetterRootLayout
extends java.awt.BorderLayout

A custom layout for a JRootPane that handles the the layout of a JRootPane's layeredPane, glassPane, and menuBar, and in addition handles four decorative components arranged in a border layout. Add the decorative components to the JRootPane using the directional constants; CENTER is reserved for the content pane and menu bar.

Version:
$Revision: 904 $
Author:
michael@mpowers.net
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.awt.BorderLayout
AFTER_LAST_LINE, AFTER_LINE_ENDS, BEFORE_FIRST_LINE, BEFORE_LINE_BEGINS, CENTER, EAST, LINE_END, LINE_START, NORTH, PAGE_END, PAGE_START, SOUTH, WEST
 
Constructor Summary
BetterRootLayout()
           
 
Method Summary
 void addLayoutComponent(java.awt.Component comp, java.lang.Object constraints)
          Passes NORTH, SOUTH, EAST, WEST and CENTER to super implementation, and ignores all others.
 void layoutContainer(java.awt.Container parent)
          Instructs the layout manager to perform the layout for the specified container.
 java.awt.Dimension maximumLayoutSize(java.awt.Container target)
          Returns the maximum amount of space the layout can use.
 java.awt.Dimension minimumLayoutSize(java.awt.Container parent)
          Returns the minimum amount of space the layout needs.
 java.awt.Dimension preferredLayoutSize(java.awt.Container parent)
          Returns the amount of space the layout would like to have.
 
Methods inherited from class java.awt.BorderLayout
addLayoutComponent, getConstraints, getHgap, getLayoutAlignmentX, getLayoutAlignmentY, getLayoutComponent, getLayoutComponent, getVgap, invalidateLayout, removeLayoutComponent, setHgap, setVgap, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BetterRootLayout

public BetterRootLayout()
Method Detail

preferredLayoutSize

public java.awt.Dimension preferredLayoutSize(java.awt.Container parent)
Returns the amount of space the layout would like to have.

Specified by:
preferredLayoutSize in interface java.awt.LayoutManager
Overrides:
preferredLayoutSize in class java.awt.BorderLayout
Parameters:
the - Container for which this layout manager is being used
Returns:
a Dimension object containing the layout's preferred size
Throws:
java.lang.ClassCastException - if parent is not a JRootPane

minimumLayoutSize

public java.awt.Dimension minimumLayoutSize(java.awt.Container parent)
Returns the minimum amount of space the layout needs.

Specified by:
minimumLayoutSize in interface java.awt.LayoutManager
Overrides:
minimumLayoutSize in class java.awt.BorderLayout
Parameters:
the - Container for which this layout manager is being used
Returns:
a Dimension object containing the layout's minimum size
Throws:
java.lang.ClassCastException - if parent is not a JRootPane

maximumLayoutSize

public java.awt.Dimension maximumLayoutSize(java.awt.Container target)
Returns the maximum amount of space the layout can use.

Specified by:
maximumLayoutSize in interface java.awt.LayoutManager2
Overrides:
maximumLayoutSize in class java.awt.BorderLayout
Parameters:
the - Container for which this layout manager is being used
Returns:
a Dimension object containing the layout's maximum size
Throws:
java.lang.ClassCastException - if parent is not a JRootPane

layoutContainer

public void layoutContainer(java.awt.Container parent)
Instructs the layout manager to perform the layout for the specified container.

Specified by:
layoutContainer in interface java.awt.LayoutManager
Overrides:
layoutContainer in class java.awt.BorderLayout
Parameters:
the - Container for which this layout manager is being used
Throws:
java.lang.ClassCastException - if parent is not a JRootPane

addLayoutComponent

public void addLayoutComponent(java.awt.Component comp,
                               java.lang.Object constraints)
Passes NORTH, SOUTH, EAST, WEST and CENTER to super implementation, and ignores all others.

Specified by:
addLayoutComponent in interface java.awt.LayoutManager2
Overrides:
addLayoutComponent in class java.awt.BorderLayout


Copyright © 2006 null. All Rights Reserved.