Class PrivateApi
- java.lang.Object
-
- ch.swingfx.window.translucentandshaped.PrivateApi
-
- All Implemented Interfaces:
ITranslucentAndShapedWindowApi
public class PrivateApi extends java.lang.Object implements ITranslucentAndShapedWindowApi
Wrapper around com.sun.awt.AWTUtilities API for Translucent and Shaped Window support.
As of JRE 6 update 10 there is a private API for creating these types of windows.
You shouldn't use this class directly. Instead useTranslucentAndShapedWindowApiFactory
to get the correct instance depending on your system JRE. For more details see http://download.oracle.com/javase/tutorial/uiswing/misc/trans_shaped_windows.html#6u10
Note: Only Sun/Oracle JREs support sun.awt.AWTUtilities. Other JDK/JREs (example OpenJDK) do not support the private API
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.reflect.Method
getWindowOpacity
private static java.lang.reflect.Method
getWindowShape
private static boolean
isSupported
true if we support this APIprivate static java.lang.reflect.Method
isTranslucencyCapable
private static java.lang.reflect.Method
isTranslucencySupported
private static java.lang.reflect.Method
isWindowOpaque
private static java.lang.Object
PERPIXEL_TRANSLUCENT
private static java.lang.Object
PERPIXEL_TRANSPARENT
enum constants from com.sun.awt.AWTUtilities$Translucencyprivate static java.lang.reflect.Method
setWindowOpacity
private static java.lang.reflect.Method
setWindowOpaque
private static java.lang.reflect.Method
setWindowShape
private static java.lang.Object
TRANSLUCENT
-
Constructor Summary
Constructors Constructor Description PrivateApi()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ApiType
getApiType()
float
getWindowOpacity(java.awt.Window window)
java.awt.Shape
getWindowShape(java.awt.Window window)
static boolean
isSupported()
Test if com.sun.awt.AWTUtilities (jdk 6u10) is availableboolean
isTranslucencyCapable(java.awt.GraphicsConfiguration gc)
boolean
isTranslucencySupported(Translucency translucencyKind, java.awt.GraphicsDevice gd)
boolean
isWindowOpaque(java.awt.Window window)
void
setWindowOpacity(java.awt.Window window, float opacity)
void
setWindowOpaque(java.awt.Window window, boolean isOpaque)
void
setWindowShape(java.awt.Window window, java.awt.Shape shape)
-
-
-
Field Detail
-
isSupported
private static boolean isSupported
true if we support this API
-
PERPIXEL_TRANSPARENT
private static java.lang.Object PERPIXEL_TRANSPARENT
enum constants from com.sun.awt.AWTUtilities$Translucency
-
TRANSLUCENT
private static java.lang.Object TRANSLUCENT
-
PERPIXEL_TRANSLUCENT
private static java.lang.Object PERPIXEL_TRANSLUCENT
-
isTranslucencySupported
private static java.lang.reflect.Method isTranslucencySupported
-
setWindowOpacity
private static java.lang.reflect.Method setWindowOpacity
-
getWindowOpacity
private static java.lang.reflect.Method getWindowOpacity
-
setWindowShape
private static java.lang.reflect.Method setWindowShape
-
getWindowShape
private static java.lang.reflect.Method getWindowShape
-
setWindowOpaque
private static java.lang.reflect.Method setWindowOpaque
-
isWindowOpaque
private static java.lang.reflect.Method isWindowOpaque
-
isTranslucencyCapable
private static java.lang.reflect.Method isTranslucencyCapable
-
-
Method Detail
-
isSupported
public static boolean isSupported()
Test if com.sun.awt.AWTUtilities (jdk 6u10) is available- Returns:
- true if com.sun.awt.AWTUtilities (jdk 6u10) is available
-
isTranslucencySupported
public boolean isTranslucencySupported(Translucency translucencyKind, java.awt.GraphicsDevice gd)
- Specified by:
isTranslucencySupported
in interfaceITranslucentAndShapedWindowApi
-
setWindowOpacity
public void setWindowOpacity(java.awt.Window window, float opacity)
- Specified by:
setWindowOpacity
in interfaceITranslucentAndShapedWindowApi
-
getWindowOpacity
public float getWindowOpacity(java.awt.Window window)
- Specified by:
getWindowOpacity
in interfaceITranslucentAndShapedWindowApi
-
setWindowShape
public void setWindowShape(java.awt.Window window, java.awt.Shape shape)
- Specified by:
setWindowShape
in interfaceITranslucentAndShapedWindowApi
-
getWindowShape
public java.awt.Shape getWindowShape(java.awt.Window window)
- Specified by:
getWindowShape
in interfaceITranslucentAndShapedWindowApi
-
setWindowOpaque
public void setWindowOpaque(java.awt.Window window, boolean isOpaque)
- Specified by:
setWindowOpaque
in interfaceITranslucentAndShapedWindowApi
-
isWindowOpaque
public boolean isWindowOpaque(java.awt.Window window)
- Specified by:
isWindowOpaque
in interfaceITranslucentAndShapedWindowApi
-
isTranslucencyCapable
public boolean isTranslucencyCapable(java.awt.GraphicsConfiguration gc)
- Specified by:
isTranslucencyCapable
in interfaceITranslucentAndShapedWindowApi
-
getApiType
public ApiType getApiType()
- Specified by:
getApiType
in interfaceITranslucentAndShapedWindowApi
-
-