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

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

public class WindowMover
extends Object

The WindowMover can be used by any ScreenDockWindow showing a DockElementRepresentative. The mover adds a listener to the element and moves the entire window if the element is dragged. The mover also ensures that drag and drop still works.
This class also supports magnetization.

Author:
Benjamin Sigg

Constructor Summary
WindowMover(ScreenDockWindow window)
          Creates a new mover
 
Method Summary
protected  void convertPointToScreen(Point point, Component component)
          Converst the point point on component to screen coordinates.
 boolean isAllowDragAndDrop()
          Tells whether drag and drop operations are allowed even if the window is moved around.
 boolean isResetOnDropable()
          Tells whether the window jumps back to its starting position if a dropable stop is found.
 void setAllowDragAndDrop(boolean allowDragAndDrop)
          Sets whether drag and drop operations are still allowed even if the window is moved around.
 void setElement(DockElementRepresentative element)
          Sets the element which is currently shown by the window.
 void setResetOnDropable(boolean resetOnDropable)
          Sets whether the window jumps back to its starting position if a dropable stop is found.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WindowMover

public WindowMover(ScreenDockWindow window)
Creates a new mover

Parameters:
window - the window which is to be moved, must not be null
Method Detail

setElement

public void setElement(DockElementRepresentative element)
Sets the element which is currently shown by the window.

Parameters:
element - the element that is shown, can be null

setAllowDragAndDrop

public void setAllowDragAndDrop(boolean allowDragAndDrop)
Sets whether drag and drop operations are still allowed even if the window is moved around.

Parameters:
allowDragAndDrop - whether to allow drag and drop operations

isAllowDragAndDrop

public boolean isAllowDragAndDrop()
Tells whether drag and drop operations are allowed even if the window is moved around.

Returns:
whether to allow drag and drop operations

setResetOnDropable

public void setResetOnDropable(boolean resetOnDropable)
Sets whether the window jumps back to its starting position if a dropable stop is found.

Parameters:
resetOnDropable - whether the window can jump back to its starting position

isResetOnDropable

public boolean isResetOnDropable()
Tells whether the window jumps back to its starting position if a dropable stop is found.

Returns:
whether the window can jump back

convertPointToScreen

protected void convertPointToScreen(Point point,
                                    Component component)
Converst the point point on component to screen coordinates.

Parameters:
point - the point to convert
component - the current coordinate system of the point