public class WindowMover
extends java.lang.Object
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.magnetization
.Constructor and Description |
---|
WindowMover(ScreenDockWindow window)
Creates a new mover
|
Modifier and Type | Method and Description |
---|---|
protected void |
convertPointToScreen(java.awt.Point point,
java.awt.Component component)
Converts 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 droppable 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 droppable stop is found.
|
public WindowMover(ScreenDockWindow window)
window
- the window which is to be moved, must not be null
public void setElement(DockElementRepresentative element)
element
- the element that is shown, can be null
public void setAllowDragAndDrop(boolean allowDragAndDrop)
allowDragAndDrop
- whether to allow drag and drop operationspublic boolean isAllowDragAndDrop()
public void setResetOnDropable(boolean resetOnDropable)
resetOnDropable
- whether the window can jump back to its starting positionpublic boolean isResetOnDropable()
protected void convertPointToScreen(java.awt.Point point, java.awt.Component component)
point
on component
to screen coordinates.point
- the point to convertcomponent
- the current coordinate system of the point