bibliothek.gui.dock.station.screen.window
Class ScreenWindowShapeAdapter

java.lang.Object
  extended by bibliothek.gui.dock.station.screen.window.ScreenWindowShapeAdapter

public class ScreenWindowShapeAdapter
extends Object

The ScreenWindowShapeAdapter makes a connection between a ScreenDockWindow and a ScreenWindowShape forwarding events and calls from one of the to the other.

Author:
Benjamin Sigg

Constructor Summary
ScreenWindowShapeAdapter(ScreenDockWindow screenDockWindow, Window window)
          Creates a new adapter.
 
Method Summary
 void disable()
          Disables this adapater, the ScreenWindowShape is set to null by this method.
 ScreenDockWindow getScreenDockWindow()
          Gets the ScreenDockWindow whose shape is changed.
 Window getWindow()
          Gets the Window whose shape is changed.
 boolean isEnabled()
          Whether this adapter actually forwards the shapes.
 void setShape(ScreenWindowShape shape)
          Sets the shape to apply, this method does nothing if this adapter is not enabled.
protected  void setShape(Shape shape)
          Sets the shape of the window.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScreenWindowShapeAdapter

public ScreenWindowShapeAdapter(ScreenDockWindow screenDockWindow,
                                Window window)
Creates a new adapter.

Parameters:
screenDockWindow - the window representing window
window - the window whose shape is changed
Method Detail

getScreenDockWindow

public ScreenDockWindow getScreenDockWindow()
Gets the ScreenDockWindow whose shape is changed.

Returns:
the window, not null

getWindow

public Window getWindow()
Gets the Window whose shape is changed.

Returns:
the window, not null

isEnabled

public boolean isEnabled()
Whether this adapter actually forwards the shapes.

Returns:
whether the adapter is enabled

disable

public void disable()
Disables this adapater, the ScreenWindowShape is set to null by this method.


setShape

public void setShape(ScreenWindowShape shape)
Sets the shape to apply, this method does nothing if this adapter is not enabled.

Parameters:
shape - the shape to apply or null

setShape

protected void setShape(Shape shape)
Sets the shape of the window. This method calls Workarounds.setTransparent(Window, Shape), if transparency cannot be set then disable() is called.

Parameters:
shape - the shape to set, not null