bibliothek.util.workarounds
Class Java6Workaround

java.lang.Object
  extended by bibliothek.util.workarounds.Java6Workaround
All Implemented Interfaces:
Workaround
Direct Known Subclasses:
Java7Workaround

public class Java6Workaround
extends Object
implements Workaround

Workarounds necessary for Java 1.6.

Author:
Benjamin Sigg

Constructor Summary
Java6Workaround()
           
 
Method Summary
static boolean isPrintWarnings()
          Tells whether all Java6Workarounds are allowed to print warnings.
 void markAsGlassPane(Component component)
          Called for any Component which is used as glass pane (as invisible panel).
static void setPrintWarnings(boolean printWarnings)
          Sets whether the methods of the Java6Workaround can print warnings or not.
 boolean setTranslucent(Window window)
          Makes the window window translucent.
 boolean setTransparent(Window window, Shape shape)
          Makes the window window transparent in all the regions that are not inside shape.
 void setup(DockController controller)
          Called whenever a new DockController is created, the Workaround may modify the controller in any way it likes (e.g.
 boolean supportsPerpixelTranslucency(Window window)
          Tells whether this Workaround has the abbility to make window translucent.
 boolean supportsPerpixelTransparency(Window window)
          Tells whether this Workaround has the abbility to make window transparent.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Java6Workaround

public Java6Workaround()
Method Detail

setPrintWarnings

public static void setPrintWarnings(boolean printWarnings)
Sets whether the methods of the Java6Workaround can print warnings or not. Calling this method affects all workarounds. The default behavior is not to print warnings.

Parameters:
printWarnings - whether to print warnings

isPrintWarnings

public static boolean isPrintWarnings()
Tells whether all Java6Workarounds are allowed to print warnings.

Returns:
whether to print warnings
See Also:
setPrintWarnings(boolean)

setup

public void setup(DockController controller)
Description copied from interface: Workaround
Called whenever a new DockController is created, the Workaround may modify the controller in any way it likes (e.g. install specialied factories).

Specified by:
setup in interface Workaround
Parameters:
controller - the DockController which was just created and initialized

markAsGlassPane

public void markAsGlassPane(Component component)
Description copied from interface: Workaround
Called for any Component which is used as glass pane (as invisible panel).

Specified by:
markAsGlassPane in interface Workaround
Parameters:
component - the component that is invisible

supportsPerpixelTranslucency

public boolean supportsPerpixelTranslucency(Window window)
Description copied from interface: Workaround
Tells whether this Workaround has the abbility to make window translucent. Translucent means that each pixel of the window can have its own alpha value.

Specified by:
supportsPerpixelTranslucency in interface Workaround
Parameters:
window - the window to test
Returns:
whether translucency is an option

supportsPerpixelTransparency

public boolean supportsPerpixelTransparency(Window window)
Description copied from interface: Workaround
Tells whether this Workaround has the abbility to make window transparent. Transparent means that some pixels of the window cannot be seen.

Specified by:
supportsPerpixelTransparency in interface Workaround
Parameters:
window - the widnow to test
Returns:
whether transparency is an option

setTranslucent

public boolean setTranslucent(Window window)
Description copied from interface: Workaround
Makes the window window translucent. See Workarounds.setTranslucent(Window) for a more detailed description.

Specified by:
setTranslucent in interface Workaround
Parameters:
window - the window that should be transparent
Returns:
whether translucency is supported for window

setTransparent

public boolean setTransparent(Window window,
                              Shape shape)
Description copied from interface: Workaround
Makes the window window transparent in all the regions that are not inside shape.

Specified by:
setTransparent in interface Workaround
Parameters:
window - the window that should be transparent
shape - the shape of the window, or null if the window should not be transparent
Returns:
whether transparency is supported for window