bb.gui
Class ContainerUtil

java.lang.Object
  extended by bb.gui.ContainerUtil

public final class ContainerUtil
extends Object

Provides static utility methods that deal with Containers.

Like typical Java GUI code, this class is not multithread safe: it expects to only be called by EventQueue's dispatch thread. This threading limitation is checked in every public method.

Author:
Brent Boyer

Constructor Summary
private ContainerUtil()
          This sole private constructor suppresses the default (public) constructor, ensuring non-instantiability outside of this class.
 
Method Summary
static int getAvailableHeight(Container container)
          Returns the height which is available for child Components (i.e. takes container's Insets into account).
static int getAvailableWidth(Container container)
          Returns the width which is available for child Components (i.e. takes container's Insets into account).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContainerUtil

private ContainerUtil()
This sole private constructor suppresses the default (public) constructor, ensuring non-instantiability outside of this class.

Method Detail

getAvailableWidth

public static int getAvailableWidth(Container container)
                             throws IllegalArgumentException,
                                    IllegalStateException
Returns the width which is available for child Components (i.e. takes container's Insets into account).

Throws:
IllegalArgumentException - if container == null
IllegalStateException - if calling thread is not EventQueue's dispatch thread
See Also:
JFrame

getAvailableHeight

public static int getAvailableHeight(Container container)
                              throws IllegalArgumentException,
                                     IllegalStateException
Returns the height which is available for child Components (i.e. takes container's Insets into account).

Throws:
IllegalArgumentException - if container == null
IllegalStateException - if calling thread is not EventQueue's dispatch thread
See Also:
JFrame