com.sun.jna.examples
Class WindowUtils.NativeWindowUtils
public abstract static
class
WindowUtils.NativeWindowUtils
extends Object
Window utilities with differing native implementations.
Method Summary |
GraphicsConfiguration | getAlphaCompatibleGraphicsConfiguration() Return the default graphics configuration. |
protected Window | getWindow(Component c) |
boolean | isWindowAlphaSupported() Default: no support. |
protected void | setDoubleBuffered(Component root, boolean buffered) |
protected void | setForceHeavyweightPopups(Window w, boolean force)
Use this method to ensure heavyweight popups are used in
conjunction with a given window. |
protected void | setLayersTransparent(Window w, boolean transparent) |
protected void | setMask(Component c, Raster raster) Override this method to provide bitmap masking of the given
heavyweight component. |
void | setWindowAlpha(Window w, float alpha)
Set the overall alpha transparency of the window. |
protected void | setWindowMask(Component w, Raster raster)
Set the window mask based on the given Raster, which should
be treated as a bitmap (zero/nonzero values only). |
void | setWindowMask(Component w, Shape mask) Set the window mask based on a Shape. |
void | setWindowMask(Component w, Icon mask)
Set the window mask based on an Icon. |
void | setWindowTransparent(Window w, boolean transparent)
Set the window to be transparent. |
protected Raster | toRaster(Shape mask) |
protected Raster | toRaster(Component c, Icon mask) |
protected Shape | toShape(Raster raster) |
protected void | whenDisplayable(Component w, Runnable action)
Execute the given action when the given window becomes
displayable. |
public GraphicsConfiguration getAlphaCompatibleGraphicsConfiguration()
Return the default graphics configuration.
protected Window getWindow(Component c)
public boolean isWindowAlphaSupported()
Default: no support.
protected void setDoubleBuffered(Component root, boolean buffered)
protected void setForceHeavyweightPopups(Window w, boolean force)
Use this method to ensure heavyweight popups are used in
conjunction with a given window. This prevents the window's
alpha setting or mask region from being applied to the popup.
protected void setLayersTransparent(Window w, boolean transparent)
protected void setMask(Component c, Raster raster)
Override this method to provide bitmap masking of the given
heavyweight component.
public void setWindowAlpha(Window w, float alpha)
Set the overall alpha transparency of the window. An alpha of
1.0 is fully opaque, 0.0 is fully transparent.
protected void setWindowMask(Component w, Raster raster)
Set the window mask based on the given Raster, which should
be treated as a bitmap (zero/nonzero values only). A value of
null
means to remove the mask.
public void setWindowMask(Component w, Shape mask)
Set the window mask based on a Shape.
public void setWindowMask(Component w, Icon mask)
Set the window mask based on an Icon. All non-transparent
pixels will be included in the mask.
public void setWindowTransparent(Window w, boolean transparent)
Set the window to be transparent. Only explicitly painted
pixels will be non-transparent. All pixels will be composited
with whatever is under the window using their alpha values.
protected Raster toRaster(Shape mask)
protected Raster toRaster(Component c, Icon mask)
protected Shape toShape(Raster raster)
protected void whenDisplayable(Component w, Runnable action)
Execute the given action when the given window becomes
displayable.
Copyright © 2007-2009 Timothy Wall. All Rights Reserved.