org.bibalex.daf.commongui
Class CommonGUI

java.lang.Object
  extended by org.bibalex.daf.commongui.CommonGUI

public class CommonGUI
extends java.lang.Object

This class has 2 static methods used to Enable/Disable , Hide/Show java UI components recusively.

Author:
Fadi.Edward

Constructor Summary
CommonGUI()
           
 
Method Summary
static void centerWindow(java.awt.Window win)
          Centers the given window within the screen.
static void setEnabledRecursively(java.awt.Container component, boolean enabled)
          Enables/Disables the current Component an all its predecessors recursively.
static void setVisibleRecursively(java.awt.Container component, boolean visible)
          Shows/Hides the current Component an all its predecessors recursively.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommonGUI

public CommonGUI()
Method Detail

setEnabledRecursively

public static void setEnabledRecursively(java.awt.Container component,
                                         boolean enabled)
Enables/Disables the current Component an all its predecessors recursively.

Parameters:
component - The root component to start from the Enable/Disable recusive operation.
enabled - Indicates weather to Enable or Disable, true to enable and false to disable.

setVisibleRecursively

public static void setVisibleRecursively(java.awt.Container component,
                                         boolean visible)
Shows/Hides the current Component an all its predecessors recursively.

Parameters:
component - The root component to start from the Show/Hide recusive operation.
visible - Indicates weather to Show or Hide, true to show and false to hide.

centerWindow

public static void centerWindow(java.awt.Window win)
Centers the given window within the screen. This method should be called after setting the size, or it will not be centered correctly.

Parameters:
win - the window (Dialog or Frame) thar extends Window