|
Groovy Documentation | |||||||
| FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectgriffon.swing.SwingUtils
public class SwingUtils extends Object
Additional utilities for Swing based applications.
| Constructor Summary | |
SwingUtils()
|
|
| Method Summary | |
|---|---|
static void
|
centerOnScreen(Window window)
Centers a Window on the screen |
static void
|
centerOnScreen(JInternalFrame internalFrame)
Centers a JInternalFrame on the screen |
static Window
|
createApplicationFrame(GriffonApplication app)
Creates a Window based on the application's configuration. |
static Component
|
findComponentByName(String name, Container root)
Searches a component by name in a particular component hierarchy. |
static float
|
getWindowOpacity(Window window)
Returns the window's current opacity value. |
static boolean
|
isTranslucencySupported()
Finds out if translucency is supported by the current platform. |
private static Class
|
loadClass(String className)
|
static void
|
setWindowOpacity(Window window, float opacity)
Sets the value for the window's opacity. |
static Image
|
takeSnapshot(Component component)
Takes a snapshot of the target component. |
static Image
|
takeSnapshot(Component component, boolean usePrint)
|
| Methods inherited from class Object | |
|---|---|
| wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |
| Constructor Detail |
|---|
SwingUtils()
| Method Detail |
|---|
public static void centerOnScreen(Window window)
Sets the window on the top left corner if the window's dimensions are bigger than the screen's.
window - a Window object
public static void centerOnScreen(JInternalFrame internalFrame)
Sets the internal frame on the top left corner if the frame's dimensions are bigger than the desktop's.
internalFrame - a JInternalFrame object
public static Window createApplicationFrame(GriffonApplication app)
Class lookup order is
app - the current running application
public static Component findComponentByName(String name, Container root)
A component must have a value for its name property if it's
to be found with this method.
This method performs a depth-first search.
name - the value of the component's name propertyroot - the root of the component hierarchy from where searching
searching should start
public static float getWindowOpacity(Window window)
window - the window on which the opacity will be queried
public static boolean isTranslucencySupported()
private static Class loadClass(String className)
public static void setWindowOpacity(Window window, float opacity)
window - the window on which the opacity will be setopacity - the new opacity value
public static Image takeSnapshot(Component component)
component - the component to draw
public static Image takeSnapshot(Component component, boolean usePrint)
Groovy Documentation