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

java.lang.Object
  extended by bibliothek.gui.dock.station.screen.window.AbstractScreenWindowShape
All Implemented Interfaces:
ScreenWindowShape

public abstract class AbstractScreenWindowShape
extends Object
implements ScreenWindowShape

This implementation of ScreenWindowShape does nothing on its own, but keeps track of the ScreenWindowShapeCallback.
Subclasses should call reshape() to update the Shape of the ScreenDockWindow.

Author:
Benjamin Sigg

Constructor Summary
AbstractScreenWindowShape()
           
 
Method Summary
 ScreenWindowShapeCallback getCallback()
          Gets information about the window whose shape is changed.
protected abstract  Shape getShape()
          Calculates the current shape of the window.
 void onResize()
          Called by the ScreenDockWindow if its size has changed, can lead to a call to ScreenWindowShapeCallback.setShape(java.awt.Shape)
 void onShown()
          Called by the ScreenDockWindow if it was made visible, can lead to a call to ScreenWindowShapeCallback.setShape(java.awt.Shape)
 void reshape()
          First checks that the callback is not null, then calls getShape() and sets the result.
 void setCallback(ScreenWindowShapeCallback callback)
          Informs this shape about the ScreenDockWindow that can be configured by this.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractScreenWindowShape

public AbstractScreenWindowShape()
Method Detail

setCallback

public void setCallback(ScreenWindowShapeCallback callback)
Description copied from interface: ScreenWindowShape
Informs this shape about the ScreenDockWindow that can be configured by this. The methods of callback should be called by the EDT.
To set the shape this class can call ScreenWindowShapeCallback.setShape(java.awt.Shape) at any time.

Specified by:
setCallback in interface ScreenWindowShape
Parameters:
callback - the window, or null

getCallback

public ScreenWindowShapeCallback getCallback()
Gets information about the window whose shape is changed.

Returns:
the callback or null

reshape

public void reshape()
First checks that the callback is not null, then calls getShape() and sets the result.


getShape

protected abstract Shape getShape()
Calculates the current shape of the window.

Returns:
the current shape, can be null

onResize

public void onResize()
Description copied from interface: ScreenWindowShape
Called by the ScreenDockWindow if its size has changed, can lead to a call to ScreenWindowShapeCallback.setShape(java.awt.Shape)

Specified by:
onResize in interface ScreenWindowShape

onShown

public void onShown()
Description copied from interface: ScreenWindowShape
Called by the ScreenDockWindow if it was made visible, can lead to a call to ScreenWindowShapeCallback.setShape(java.awt.Shape)

Specified by:
onShown in interface ScreenWindowShape