org.fife.util
Class TranslucencyUtil

java.lang.Object
  extended by org.fife.util.TranslucencyUtil

public abstract class TranslucencyUtil
extends java.lang.Object

Utilities for translucent windows in Java 6 update 10 and newer.

Version:
1.0
Author:
Robert Futrell

Constructor Summary
TranslucencyUtil()
           
 
Method Summary
static TranslucencyUtil get()
          Returns the singleton instance of this class.
abstract  float getOpacity(java.awt.Window w)
          Returns the opacity of a (fully, not per-pixel, translucent) window.
abstract  boolean isTranslucencySupported(boolean perPixel)
          Returns whether translucency is supported by this JVM.
abstract  boolean setOpacity(java.awt.Window w, float value)
          Toggles the opacity of an entire window (i.e., non-per-pixel opacity).
abstract  boolean setOpaque(java.awt.Window w, boolean opaque)
          Toggles whether a window is fully opaque (e.g., toggles per-pixel translucency).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TranslucencyUtil

public TranslucencyUtil()
Method Detail

get

public static TranslucencyUtil get()
Returns the singleton instance of this class.

Returns:
The singleton instance, or null if something went horribly wrong.

getOpacity

public abstract float getOpacity(java.awt.Window w)
Returns the opacity of a (fully, not per-pixel, translucent) window.

Parameters:
w - The window.
Returns:
The opacity of the window. A value of 1.0f means the window is fully opaque.
See Also:
setOpacity(Window, float)

isTranslucencySupported

public abstract boolean isTranslucencySupported(boolean perPixel)
Returns whether translucency is supported by this JVM.

Parameters:
perPixel - Whether to check for per-pixel translucency (vs. just translucency of an entire window, which is cheaper).
Returns:
Whether translucency is supported.

setOpacity

public abstract boolean setOpacity(java.awt.Window w,
                                   float value)
Toggles the opacity of an entire window (i.e., non-per-pixel opacity).

Parameters:
w - The window to modify.
value - The opacity.
Returns:
Whether the operation was successful.
See Also:
getOpacity(Window), setOpaque(Window, boolean)

setOpaque

public abstract boolean setOpaque(java.awt.Window w,
                                  boolean opaque)
Toggles whether a window is fully opaque (e.g., toggles per-pixel translucency). To set the translucency of an entire window, on a non-per-pixel basis (which is cheaper), use setOpacity(Window, float).

Parameters:
w - The window to modify.
opaque - Whether the window should be fully opaque (versus per-pixel translucent).
Returns:
Whether the operation was successful.
See Also:
setOpacity(Window, float)