bibliothek.gui.dock.station.screen
Class DisplayerScreenDockWindow

java.lang.Object
  extended by bibliothek.gui.dock.station.screen.DisplayerScreenDockWindow
All Implemented Interfaces:
ScreenDockWindow
Direct Known Subclasses:
AbstractScreenDockWindow

public abstract class DisplayerScreenDockWindow
extends Object
implements ScreenDockWindow

A window that uses a DockableDisplayer to show the Dockable.

Author:
Benjamin Sigg

Constructor Summary
DisplayerScreenDockWindow(ScreenDockStation station)
          Creates a new window
 
Method Summary
 DockController getController()
          Gets the controller in whose realm this window is used.
 Dockable getDockable()
          Gets the Dockable which is currently shown in this window.
 Point getOffsetDrop()
          Gets an offset that will be added to the location when dropping a window.
A value of null indicates that no such offset is available.
 Point getOffsetMove()
          Gets an offset that will be subtracted from the location when moving the window around.
 ScreenDockStation getStation()
          Gets the station for which this window is used.
protected abstract  Component getWindowComponent()
          Gets the component on which ScreenDockWindow.setWindowBounds(java.awt.Rectangle) is applied.
 boolean inCombineArea(int x, int y)
          Checks what would happen if a Dockable is dropped at point x/y.
 boolean isShowTitle()
          Tells whether the DockTitle is generally shown.
 void setController(DockController controller)
          Sets the controller in whose realm this window will be used.
 void setDockable(Dockable dockable)
          Sets the Dockable which should be shown on this window.
 void setShowTitle(boolean showTitle)
          Sets whether the DockTitle should be shown or not.
protected abstract  void showDisplayer(DockableDisplayer displayer)
          Forces the subclass of this window to show displayer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface bibliothek.gui.dock.station.screen.ScreenDockWindow
checkWindowBounds, destroy, getDockableInsets, getWindowBounds, setPaintCombining, setVisible, setWindowBounds, toFront, validate
 

Constructor Detail

DisplayerScreenDockWindow

public DisplayerScreenDockWindow(ScreenDockStation station)
Creates a new window

Parameters:
station - the owner of this window, not null
Method Detail

showDisplayer

protected abstract void showDisplayer(DockableDisplayer displayer)
Forces the subclass of this window to show displayer. Only one displayer should be shown at any time. A new displayer replaces an old one.

Parameters:
displayer - the displayer to show or null to remove the current displayer

getWindowComponent

protected abstract Component getWindowComponent()
Gets the component on which ScreenDockWindow.setWindowBounds(java.awt.Rectangle) is applied.

Returns:
the base component

setShowTitle

public void setShowTitle(boolean showTitle)
Sets whether the DockTitle should be shown or not.

Parameters:
showTitle - true if the title should be visible, false otherwise

isShowTitle

public boolean isShowTitle()
Tells whether the DockTitle is generally shown.

Returns:
true if the title is shown

getDockable

public Dockable getDockable()
Description copied from interface: ScreenDockWindow
Gets the Dockable which is currently shown in this window.

Specified by:
getDockable in interface ScreenDockWindow
Returns:
the current element, can be null
See Also:
ScreenDockWindow.setDockable(Dockable)

setDockable

public void setDockable(Dockable dockable)
Description copied from interface: ScreenDockWindow
Sets the Dockable which should be shown on this window.

Specified by:
setDockable in interface ScreenDockWindow
Parameters:
dockable - the new element, can be null to remove an old Dockable

setController

public void setController(DockController controller)
Description copied from interface: ScreenDockWindow
Sets the controller in whose realm this window will be used. This method will be called after the controller of the owning ScreenDockStation was set, so AbstractDockStation.getController() will always return the same value as controller. This also implies that any method of the station called from this method already uses the new controller.

Specified by:
setController in interface ScreenDockWindow
Parameters:
controller - the new controller, can be null

getOffsetDrop

public Point getOffsetDrop()
Description copied from interface: ScreenDockWindow
Gets an offset that will be added to the location when dropping a window.
A value of null indicates that no such offset is available.

Specified by:
getOffsetDrop in interface ScreenDockWindow
Returns:
the offset or null

getOffsetMove

public Point getOffsetMove()
Description copied from interface: ScreenDockWindow
Gets an offset that will be subtracted from the location when moving the window around. The offset should be equal to the point 0/0 on the DockTitle of the Dockable shown in this window. The value null can be returned to indicate that such an offset is not available.

Specified by:
getOffsetMove in interface ScreenDockWindow
Returns:
the offset or null

inCombineArea

public boolean inCombineArea(int x,
                             int y)
Description copied from interface: ScreenDockWindow
Checks what would happen if a Dockable is dropped at point x/y.

Specified by:
inCombineArea in interface ScreenDockWindow
Parameters:
x - an x coordinate in the screen
y - an y coordinate in the screen
Returns:
true if dropping a Dockable at x/y should lead to a combination of the dropped element and the element in this window, false otherwise

getController

public DockController getController()
Gets the controller in whose realm this window is used.

Returns:
the controller, can be null

getStation

public ScreenDockStation getStation()
Gets the station for which this window is used.

Returns:
the owner, never null