Class OfficialApi
- java.lang.Object
-
- ch.swingfx.window.translucentandshaped.OfficialApi
-
- All Implemented Interfaces:
ITranslucentAndShapedWindowApi
public class OfficialApi extends java.lang.Object implements ITranslucentAndShapedWindowApi
Wrapper around the official API for creating translucent and shaped windows. As of JRE 7 there is official support for these types of windows.
You shouldn't use this class directly. Instead useTranslucentAndShapedWindowApiFactoryto 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.MethodgetWindowOpacityprivate static java.lang.reflect.MethodgetWindowShapeprivate static booleanisSupportedtrue if we support this APIprivate static java.lang.reflect.MethodisTranslucencyCapableprivate static java.lang.reflect.MethodisTranslucencySupportedprivate static intNOT_OPAQUEprivate static intOPAQUEprivate static java.lang.ObjectPERPIXEL_TRANSLUCENTprivate static java.lang.ObjectPERPIXEL_TRANSPARENTenum constants from java.awt.GraphicsDevice$WindowTranslucencyprivate static java.lang.reflect.MethodsetWindowOpacityprivate static java.lang.reflect.MethodsetWindowShapeprivate static java.lang.ObjectTRANSLUCENT
-
Constructor Summary
Constructors Constructor Description OfficialApi()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ApiTypegetApiType()floatgetWindowOpacity(java.awt.Window window)java.awt.ShapegetWindowShape(java.awt.Window window)static booleanisSupported()booleanisTranslucencyCapable(java.awt.GraphicsConfiguration gc)booleanisTranslucencySupported(Translucency translucencyKind, java.awt.GraphicsDevice gd)booleanisWindowOpaque(java.awt.Window window)voidsetWindowOpacity(java.awt.Window window, float opacity)voidsetWindowOpaque(java.awt.Window window, boolean isOpaque)voidsetWindowShape(java.awt.Window window, java.awt.Shape shape)
-
-
-
Field Detail
-
OPAQUE
private static final int OPAQUE
- See Also:
- Constant Field Values
-
NOT_OPAQUE
private static final int NOT_OPAQUE
- See Also:
- Constant Field Values
-
isSupported
private static boolean isSupported
true if we support this API
-
PERPIXEL_TRANSPARENT
private static java.lang.Object PERPIXEL_TRANSPARENT
enum constants from java.awt.GraphicsDevice$WindowTranslucency
-
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
-
isTranslucencyCapable
private static java.lang.reflect.Method isTranslucencyCapable
-
-
Method Detail
-
isSupported
public static boolean isSupported()
-
isTranslucencySupported
public boolean isTranslucencySupported(Translucency translucencyKind, java.awt.GraphicsDevice gd)
- Specified by:
isTranslucencySupportedin interfaceITranslucentAndShapedWindowApi
-
setWindowOpacity
public void setWindowOpacity(java.awt.Window window, float opacity)- Specified by:
setWindowOpacityin interfaceITranslucentAndShapedWindowApi
-
getWindowOpacity
public float getWindowOpacity(java.awt.Window window)
- Specified by:
getWindowOpacityin interfaceITranslucentAndShapedWindowApi
-
setWindowShape
public void setWindowShape(java.awt.Window window, java.awt.Shape shape)- Specified by:
setWindowShapein interfaceITranslucentAndShapedWindowApi
-
getWindowShape
public java.awt.Shape getWindowShape(java.awt.Window window)
- Specified by:
getWindowShapein interfaceITranslucentAndShapedWindowApi
-
setWindowOpaque
public void setWindowOpaque(java.awt.Window window, boolean isOpaque)- Specified by:
setWindowOpaquein interfaceITranslucentAndShapedWindowApi
-
isWindowOpaque
public boolean isWindowOpaque(java.awt.Window window)
- Specified by:
isWindowOpaquein interfaceITranslucentAndShapedWindowApi
-
isTranslucencyCapable
public boolean isTranslucencyCapable(java.awt.GraphicsConfiguration gc)
- Specified by:
isTranslucencyCapablein interfaceITranslucentAndShapedWindowApi
-
getApiType
public ApiType getApiType()
- Specified by:
getApiTypein interfaceITranslucentAndShapedWindowApi
-
-