|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.wotonomy.ui.swing.util.WindowUtilities
public class WindowUtilities
A collection of window-related utilities.
Field Summary | |
---|---|
static int |
CASCADE
Place lower and to the right of the last window placed in this manner. |
static int |
CENTER
Place frame at center (vertically and horizontally) of screen. |
static int |
CENTER_PARENT
Center dialog on frame area of parent, if any. |
Constructor Summary | |
---|---|
WindowUtilities()
|
Method Summary | |
---|---|
protected static void |
addAllChildComponents(java.awt.Container aContainer,
java.util.Collection aCollection)
Adds all children of the specified container to the specified collection. |
static void |
cascade(java.awt.Window aWindow)
Place lower and to the right of the last window placed in this manner. |
static void |
center(java.awt.Window aWindow)
Place the window in the center of the screen. |
static void |
dumpComponents(java.awt.Container aContainer)
Prints out a list of all components to System.out. |
protected static void |
dumpComponents(java.awt.Container aContainer,
java.lang.String padding)
|
static void |
dumpNamedChildComponents(java.awt.Container aContainer)
|
static void |
dumpSortedChildComponents(java.awt.Container aContainer)
|
static void |
enableComponents(java.awt.Container aContainer,
boolean isEnabled)
Sets the enabled state of a container and all of its components. |
static java.util.Collection |
getAllChildComponents(java.awt.Container aContainer)
Gets all children of the specified container. |
static java.util.Map |
getComponentToNameMap(java.awt.Container aContainer)
Generates a deterministically unique name for each component in a container. |
static java.util.Map |
getNameToComponentMap(java.awt.Container aContainer)
Maps a deterministically unique name to a component in a container. |
static java.util.List |
getSortedChildComponents(java.awt.Container aContainer)
Gets a list of all children of a specified container, sorted by position. |
static java.util.Map |
getUniqueNameMap(java.util.List anObjectList)
Generates a unique name for each object in a list and returns a map that maps the objects to the names. |
static java.awt.Window |
getWindowForComponent(java.awt.Component c)
Returns the first parent Window of the specified component. |
static java.lang.String |
incrementString(java.lang.String aString)
Numerically increments a string. |
static void |
labelComponents(java.awt.Container aContainer)
Sets each child component's tooltip to show the name generated from getComponentNameMap(). |
static void |
labelComponents(java.awt.Container aContainer,
java.util.Map aNameMap)
Sets each child component's tooltip to show a given string retrieved from a map using the component's generated name as a key. |
static void |
nameComponents(java.awt.Container aContainer)
Sets the tooltips of all components in a container to the respective names of those components. |
protected static void |
nameComponents(java.awt.Container aContainer,
java.lang.String path)
|
static void |
place(java.awt.Window aWindow,
int location)
Place the window in the specified location. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int CENTER
public static final int CENTER_PARENT
public static final int CASCADE
Constructor Detail |
---|
public WindowUtilities()
Method Detail |
---|
public static void center(java.awt.Window aWindow)
aWindow
- The window to be centered.place(java.awt.Window, int)
public static void cascade(java.awt.Window aWindow)
aWindow
- The window to be cascaded.place(java.awt.Window, int)
public static void place(java.awt.Window aWindow, int location)
aWindow
- The window to be placed.location
- Where on screen to place the frame.public static java.awt.Window getWindowForComponent(java.awt.Component c)
c
- the Component whose parent will be found.
public static void dumpComponents(java.awt.Container aContainer)
aContainer
- the Container whose components will be listed.protected static void dumpComponents(java.awt.Container aContainer, java.lang.String padding)
public static java.util.List getSortedChildComponents(java.awt.Container aContainer)
aContainer
- The container whose children are to be returned.public static void dumpSortedChildComponents(java.awt.Container aContainer)
public static void dumpNamedChildComponents(java.awt.Container aContainer)
public static java.util.Map getUniqueNameMap(java.util.List anObjectList)
anObjectList
- A List of objects.
public static java.lang.String incrementString(java.lang.String aString)
aString
- a String to be incremented.
public static java.util.Collection getAllChildComponents(java.awt.Container aContainer)
aContainer
- the Container to be searched.
protected static void addAllChildComponents(java.awt.Container aContainer, java.util.Collection aCollection)
aContainer
- the Container to be searched.aCollection
- the Collection to which the child components will be added.public static void labelComponents(java.awt.Container aContainer)
aContainer
- the Container whose components will be labeled.public static void labelComponents(java.awt.Container aContainer, java.util.Map aNameMap)
aContainer
- the Container whose components will be labeled.aNameMap
- a Map of generated names to string values.public static java.util.Map getComponentToNameMap(java.awt.Container aContainer)
aContainer
- the Container whose components will named.
public static java.util.Map getNameToComponentMap(java.awt.Container aContainer)
aContainer
- the Container whose components will named.
public static void nameComponents(java.awt.Container aContainer)
aContainer
- the Container whose components will be labeled.protected static void nameComponents(java.awt.Container aContainer, java.lang.String path)
public static void enableComponents(java.awt.Container aContainer, boolean isEnabled)
aContainer
- the Container whose components will be enabled.isEnabled
- True if enabled, false id disabled.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |