public abstract static class WindowUtils.NativeWindowUtils
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
protected class |
WindowUtils.NativeWindowUtils.TransparentContentPane |
Constructor and Description |
---|
NativeWindowUtils() |
Modifier and Type | Method and Description |
---|---|
protected java.util.List<DesktopWindow> |
getAllWindows(boolean onlyVisibleWindows)
Requests a list of all currently available Desktop windows.
|
java.awt.GraphicsConfiguration |
getAlphaCompatibleGraphicsConfiguration()
Return the default graphics configuration.
|
protected java.awt.Dimension |
getIconSize(WinDef.HICON hIcon)
Detects the size of an icon.
|
protected java.lang.String |
getProcessFilePath(WinDef.HWND hwnd)
Detects the full file path of the process associated with the specified
window handle.
|
protected java.awt.Window |
getWindow(java.awt.Component c) |
protected java.awt.image.BufferedImage |
getWindowIcon(WinDef.HWND hwnd)
Obtains the set icon for the window associated with the specified
window handle.
|
protected java.awt.Rectangle |
getWindowLocationAndSize(WinDef.HWND hwnd)
Requests the location and size of the window associated with the
specified window handle.
|
protected java.lang.String |
getWindowTitle(WinDef.HWND hwnd)
Tries to obtain the Window's title which belongs to the specified
window handle.
|
boolean |
isWindowAlphaSupported()
Default: no support.
|
protected void |
setDoubleBuffered(java.awt.Component root,
boolean buffered) |
protected void |
setForceHeavyweightPopups(java.awt.Window w,
boolean force)
Use this method to ensure heavyweight popups are used in
conjunction with a given window.
|
protected void |
setLayersTransparent(java.awt.Window w,
boolean transparent) |
protected void |
setMask(java.awt.Component c,
java.awt.image.Raster raster)
Override this method to provide bitmap masking of the given
heavyweight component.
|
void |
setWindowAlpha(java.awt.Window w,
float alpha)
Set the overall alpha transparency of the window.
|
void |
setWindowMask(java.awt.Component w,
javax.swing.Icon mask)
Set the window mask based on an Icon.
|
protected void |
setWindowMask(java.awt.Component w,
java.awt.image.Raster raster)
Set the window mask based on the given Raster, which should
be treated as a bitmap (zero/nonzero values only).
|
void |
setWindowMask(java.awt.Component w,
java.awt.Shape mask)
Set the window mask based on a
Shape . |
void |
setWindowTransparent(java.awt.Window w,
boolean transparent)
Set the window to be transparent.
|
protected java.awt.image.Raster |
toRaster(java.awt.Component c,
javax.swing.Icon mask) |
protected java.awt.image.Raster |
toRaster(java.awt.Shape mask) |
protected java.awt.Shape |
toShape(java.awt.image.Raster raster) |
protected void |
whenDisplayable(java.awt.Component w,
java.lang.Runnable action)
Execute the given action when the given window becomes
displayable.
|
protected java.awt.Window getWindow(java.awt.Component c)
protected void whenDisplayable(java.awt.Component w, java.lang.Runnable action)
protected java.awt.image.Raster toRaster(java.awt.Shape mask)
protected java.awt.image.Raster toRaster(java.awt.Component c, javax.swing.Icon mask)
protected java.awt.Shape toShape(java.awt.image.Raster raster)
public void setWindowAlpha(java.awt.Window w, float alpha)
public boolean isWindowAlphaSupported()
public java.awt.GraphicsConfiguration getAlphaCompatibleGraphicsConfiguration()
public void setWindowTransparent(java.awt.Window w, boolean transparent)
protected void setDoubleBuffered(java.awt.Component root, boolean buffered)
protected void setLayersTransparent(java.awt.Window w, boolean transparent)
protected void setMask(java.awt.Component c, java.awt.image.Raster raster)
protected void setWindowMask(java.awt.Component w, java.awt.image.Raster raster)
null
means to remove the mask.public void setWindowMask(java.awt.Component w, java.awt.Shape mask)
Shape
.public void setWindowMask(java.awt.Component w, javax.swing.Icon mask)
protected void setForceHeavyweightPopups(java.awt.Window w, boolean force)
protected java.awt.image.BufferedImage getWindowIcon(WinDef.HWND hwnd)
hwnd
- The concerning window handle.null
if an error
occurred.java.lang.UnsupportedOperationException
- Thrown if this method wasn't yet implemented for the
current platform.protected java.awt.Dimension getIconSize(WinDef.HICON hIcon)
hIcon
- The icon handle type.Dimension
instance of (0, 0)
.java.lang.UnsupportedOperationException
- Thrown if this method wasn't yet implemented for the
current platform.protected java.util.List<DesktopWindow> getAllWindows(boolean onlyVisibleWindows)
onlyVisibleWindows
- Specifies whether only currently visible windows will be
considered (true
). That are windows which are not
minimized. The WS_VISIBLE
flag will be checked
(see: User32.IsWindowVisible(HWND)).java.lang.UnsupportedOperationException
- Thrown if this method wasn't yet implemented for the
current platform.protected java.lang.String getWindowTitle(WinDef.HWND hwnd)
hwnd
- The concerning window handle.java.lang.UnsupportedOperationException
- Thrown if this method wasn't yet implemented for theprotected java.lang.String getProcessFilePath(WinDef.HWND hwnd)
hwnd
- The concerning window handle for which the PE file path is
required.java.lang.UnsupportedOperationException
- Thrown if this method wasn't yet implemented for theprotected java.awt.Rectangle getWindowLocationAndSize(WinDef.HWND hwnd)
hwnd
- The concerning window handle.java.lang.UnsupportedOperationException
- Thrown if this method wasn't yet implemented for the