|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.abstractics.utils.swing.SwingUtils
Various static method utilities for dealing with Swing related tasks.
Method Summary | |
static void |
applyKeyListenerToEverything(java.awt.Component component,
java.awt.event.KeyListener l)
Given a component and a key listener to apply, this method applies the listener to the component and to all of its decendant children if it is a java.awt.Container object. |
static void |
centerWindowToScreen(java.awt.Window window)
Given a Window object, this method will set it's top/left corner
so that the window is centered to the screen using its preferred size. |
static int |
convertStringAlign(java.lang.String str,
int defaultAlign)
Converts String alignments (left, right, north, middle, etc.) into SwingConstants compass alignment values (NORTH, SOUTH, CENTER, etc.) |
static java.awt.Component |
getChildNamed(java.lang.String name,
java.awt.Container container)
Recursively searches through the contained components of the container parameter until a child with the name specified is found. |
static java.util.List |
getChildOfType(java.lang.Class clazz,
java.awt.Container container)
Recursively searches through the contained components of the container parameter and returns a List of components that are instances of the class given. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static java.awt.Component getChildNamed(java.lang.String name, java.awt.Container container)
name
- container
-
public static int convertStringAlign(java.lang.String str, int defaultAlign)
SwingConstants
compass alignment values (NORTH, SOUTH, CENTER, etc.)
str
- String to convertdefaultAlign
- The default alignment value to return if conversion is
not possible
public static java.util.List getChildOfType(java.lang.Class clazz, java.awt.Container container)
clazz
- The Class type to search forcontainer
- The top level container to search in
public static void centerWindowToScreen(java.awt.Window window)
Window
object, this method will set it's top/left corner
so that the window is centered to the screen using its preferred size. If
the window is larger than the screen, then the top/left corner is set to
(0,0), but no resizing is done.
window
- Window object to centerpublic static void applyKeyListenerToEverything(java.awt.Component component, java.awt.event.KeyListener l)
java.awt.Container
object.
component
- l
-
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |