com.sun.jna.examples

Class WindowUtils.NativeWindowUtils

public abstract static class WindowUtils.NativeWindowUtils extends Object

Window utilities with differing native implementations.
Nested Class Summary
protected abstract classWindowUtils.NativeWindowUtils.TransparentContentPane
Method Summary
GraphicsConfigurationgetAlphaCompatibleGraphicsConfiguration()
Return the default graphics configuration.
protected WindowgetWindow(Component c)
booleanisWindowAlphaSupported()
Default: no support.
protected voidsetDoubleBuffered(Component root, boolean buffered)
protected voidsetForceHeavyweightPopups(Window w, boolean force)
Use this method to ensure heavyweight popups are used in conjunction with a given window.
protected voidsetLayersTransparent(Window w, boolean transparent)
protected voidsetMask(Component c, Raster raster)
Override this method to provide bitmap masking of the given heavyweight component.
voidsetWindowAlpha(Window w, float alpha)
Set the overall alpha transparency of the window.
protected voidsetWindowMask(Component w, Raster raster)
Set the window mask based on the given Raster, which should be treated as a bitmap (zero/nonzero values only).
voidsetWindowMask(Component w, Shape mask)
Set the window mask based on a Shape.
voidsetWindowMask(Component w, Icon mask)
Set the window mask based on an Icon.
voidsetWindowTransparent(Window w, boolean transparent)
Set the window to be transparent.
protected RastertoRaster(Shape mask)
protected RastertoRaster(Component c, Icon mask)
protected ShapetoShape(Raster raster)
protected voidwhenDisplayable(Component w, Runnable action)
Execute the given action when the given window becomes displayable.

Method Detail

getAlphaCompatibleGraphicsConfiguration

public GraphicsConfiguration getAlphaCompatibleGraphicsConfiguration()
Return the default graphics configuration.

getWindow

protected Window getWindow(Component c)

isWindowAlphaSupported

public boolean isWindowAlphaSupported()
Default: no support.

setDoubleBuffered

protected void setDoubleBuffered(Component root, boolean buffered)

setForceHeavyweightPopups

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.

setLayersTransparent

protected void setLayersTransparent(Window w, boolean transparent)

setMask

protected void setMask(Component c, Raster raster)
Override this method to provide bitmap masking of the given heavyweight component.

setWindowAlpha

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.

setWindowMask

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.

setWindowMask

public void setWindowMask(Component w, Shape mask)
Set the window mask based on a Shape.

setWindowMask

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.

setWindowTransparent

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.

toRaster

protected Raster toRaster(Shape mask)

toRaster

protected Raster toRaster(Component c, Icon mask)

toShape

protected Shape toShape(Raster raster)

whenDisplayable

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.