Orbital library

orbital.awt
Class UIUtilities

java.lang.Object
  extended by orbital.awt.UIUtilities

public final class UIUtilities
extends java.lang.Object

Utilities for User-Interface.

Author:
André Platzer
See Also:
Utility, SwingUtilities
Stereotype:
Utilities

Method Summary
static void addLookAndFeelMenuItems(java.awt.Component root, javax.swing.JMenu view)
          Adds pluggable look-and-feel menu items to a menu.
static void drawCenteredString(java.awt.Graphics g, java.lang.String text, int cx, int cy)
          draws a centered String.
static java.awt.Frame getParentalFrame(java.awt.Component n)
          Deprecated. Use SwingUtilities.getAncestorOfClass(Frame.class, n) instead.
static java.awt.Window getParentalWindow(java.awt.Component n)
          Deprecated. Use SwingUtilities.getAncestorOfClass(Window.class, n) instead.
static java.lang.String info(java.beans.FeatureDescriptor desc)
          Get Information on a feature descriptor.
static java.lang.String info(java.beans.PropertyDescriptor desc)
          Get Information on a property descriptor.
static void printBean(java.lang.Class beanClass)
           
static void printBean(java.lang.Class beanClass, java.io.PrintStream ps)
          Print Information on a bean.
static void setCenter(java.awt.Component comp)
          Center a component on the screen.
static void setCenter(java.awt.Component comp, java.awt.Component parent)
          Center a component within a parental component.
static void setDefaultLookAndFeel()
          Set the system default look and feel.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setCenter

public static void setCenter(java.awt.Component comp,
                             java.awt.Component parent)
Center a component within a parental component.

Parameters:
comp - the component to be centered.
parent - center relative to what. null to center relative to screen.
See Also:
setCenter(Component)

setCenter

public static void setCenter(java.awt.Component comp)
Center a component on the screen.

Parameters:
comp - the component to be centered relative to the screen. It must already have its final size set.
Preconditions:
comp.getSize() as on screen.

drawCenteredString

public static void drawCenteredString(java.awt.Graphics g,
                                      java.lang.String text,
                                      int cx,
                                      int cy)
draws a centered String.


getParentalWindow

public static java.awt.Window getParentalWindow(java.awt.Component n)
Deprecated. Use SwingUtilities.getAncestorOfClass(Window.class, n) instead.

Get the Window a Component is contained in.

Traverses parents until a Window is found.

Returns:
the first parent window or null if none.
See Also:
SwingUtilities.windowForComponent(java.awt.Component), SwingUtilities.getAncestorOfClass(Class, Component)

getParentalFrame

public static java.awt.Frame getParentalFrame(java.awt.Component n)
Deprecated. Use SwingUtilities.getAncestorOfClass(Frame.class, n) instead.

Get the Frame a Component is contained in.

Traverses parents until a Frame is found.

Returns:
the first parent frame or null if none.
See Also:
SwingUtilities.getAncestorOfClass(Class, Component)

addLookAndFeelMenuItems

public static void addLookAndFeelMenuItems(java.awt.Component root,
                                           javax.swing.JMenu view)
Adds pluggable look-and-feel menu items to a menu.

Parameters:
root - which root component to set the look and feel for.
view - the menu to add the Look and Feel chooser items.

setDefaultLookAndFeel

public static void setDefaultLookAndFeel()
Set the system default look and feel.

See Also:
UIManager

printBean

public static void printBean(java.lang.Class beanClass)

printBean

public static void printBean(java.lang.Class beanClass,
                             java.io.PrintStream ps)
Print Information on a bean.


info

public static java.lang.String info(java.beans.FeatureDescriptor desc)
Get Information on a feature descriptor.


info

public static java.lang.String info(java.beans.PropertyDescriptor desc)
Get Information on a property descriptor.


Orbital library
1.3.0: 11 Apr 2009

Copyright © 1996-2009 André Platzer
All Rights Reserved.