com.alee.utils
Class ProprietaryUtils

java.lang.Object
  extended by com.alee.utils.ProprietaryUtils

public final class ProprietaryUtils
extends java.lang.Object

This utility class operates only with proprietary API calls. Their usage is inevitable, otherwise i would have replaced them with something else.

Author:
Mikle Garin

Constructor Summary
ProprietaryUtils()
           
 
Method Summary
static float getWindowOpacity(java.awt.Window window)
          Returns window opacity.
static boolean isWindowOpaque(java.awt.Window window)
          Returns whether window is opaque or not.
static boolean isWindowTransparencyAllowed()
          Returns whether window transparency is supported on current OS or not.
static void setupUIDefaults(javax.swing.UIDefaults table)
          Installs some proprietary L&F defaults for proper text rendering.
static void setWindowOpacity(java.awt.Window window, float opacity)
          Sets window opacity if that option is supported by the underlying system.
static void setWindowOpaque(java.awt.Window window, boolean opaque)
          Sets window opaque if that option is supported by the underlying system.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProprietaryUtils

public ProprietaryUtils()
Method Detail

setupUIDefaults

public static void setupUIDefaults(javax.swing.UIDefaults table)
Installs some proprietary L&F defaults for proper text rendering. Basically this method is a workaround for this simple call: table.put ( sun.swing.SwingUtilities2.AA_TEXT_PROPERTY_KEY, sun.swing.SwingUtilities2.AATextInfo.getAATextInfo ( true ) ); but it doesn't directly use any proprietary API.

Parameters:
table - defaults table

isWindowTransparencyAllowed

public static boolean isWindowTransparencyAllowed()
Returns whether window transparency is supported on current OS or not.

Returns:
true if window transparency is supported on current OS; false otherwise

setWindowOpaque

public static void setWindowOpaque(java.awt.Window window,
                                   boolean opaque)
Sets window opaque if that option is supported by the underlying system.

Parameters:
window - window to process
opaque - whether should make window opaque or not

isWindowOpaque

public static boolean isWindowOpaque(java.awt.Window window)
Returns whether window is opaque or not.

Parameters:
window - window to process
Returns:
whether window background is opaque or not

setWindowOpacity

public static void setWindowOpacity(java.awt.Window window,
                                    float opacity)
Sets window opacity if that option is supported by the underlying system.

Parameters:
window - window to process
opacity - new window opacity

getWindowOpacity

public static float getWindowOpacity(java.awt.Window window)
Returns window opacity.

Parameters:
window - window to process
Returns:
window opacity