junit.extensions.jfcunit.tools
Class JFCUtilities

java.lang.Object
  extended byjunit.extensions.jfcunit.tools.JFCUtilities

public final class JFCUtilities
extends java.lang.Object

JFCUtilities provides convenience methods for frequently needed GUI programming operations.

Author:
Vijay Aravamudhan : ThoughtWorks Inc.

Constructor Summary
private JFCUtilities()
          Hide the constructor.
 
Method Summary
static void center(java.awt.Window win)
          A utility method to center a Window.
static void center(java.awt.Window win, java.awt.Component comp)
          A utility method to center a Window with respect to its parent Window.
static java.awt.Component findComponentInHierarchy(java.awt.Component comp, java.lang.Class clazz)
          A utility method to find a Component in the component's parent hierarchy which is of the type specified.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JFCUtilities

private JFCUtilities()
Hide the constructor.

Method Detail

center

public static void center(java.awt.Window win)
A utility method to center a Window.

Parameters:
win - The Window to be centered.

center

public static void center(java.awt.Window win,
                          java.awt.Component comp)
A utility method to center a Window with respect to its parent Window.

Parameters:
win - The Window to be centered.
comp - The parent Component of the above Window.

findComponentInHierarchy

public static java.awt.Component findComponentInHierarchy(java.awt.Component comp,
                                                          java.lang.Class clazz)
A utility method to find a Component in the component's parent hierarchy which is of the type specified.

Parameters:
comp - The Component whose hierarchy has to be searched for the JViewport.
clazz - The type of the required parent
Returns:
The parent that contains the component or one of its parents, null if not found.


Licensed under: GNU Lesser General Public License, Ver 2.1, February 1999