bibliothek.gui.dock.control.relocator
Class DefaultDockRelocatorEvent

java.lang.Object
  extended by bibliothek.gui.dock.control.relocator.DefaultDockRelocatorEvent
All Implemented Interfaces:
DockRelocatorEvent

public class DefaultDockRelocatorEvent
extends java.lang.Object
implements DockRelocatorEvent

A default implementation of DockRelocatorEvent.

Author:
Benjamin Sigg

Constructor Summary
DefaultDockRelocatorEvent(DockController controller, Dockable dockable, DockStation target)
          Creates a new event.
 
Method Summary
 void cancel()
          Cancels the entire operation, the Dockable remains at its current place and all visible indicators are removed.
 void drop()
          Advices to complete the drag and drop operation right now, this operation at least requires DockRelocatorEvent.getTarget() to be not null, otherwise this operation is equal to calling DockRelocatorEvent.cancel().
 void forbid()
          Forbids the current event to complete, depending on the state of the operation this is equivalent to calling DockRelocatorEvent.cancel().
 DockController getController()
          Gets the controller in whose realm this event was created.
 Dockable getDockable()
          Gets the Dockable which is or will be dragged.
 DockRelocator getSource()
          Gets the DockRelocator which created this event.
 DockStation getTarget()
          Gets the current target of the drag and drop operation, if the operation would finish now, the dockable would be dropped onto this station.
 boolean isCanceled()
          Tells whether this event is already canceled.
 boolean isDropping()
          Tells whether this event will result in a drop operation.
 boolean isForbidden()
          Tells whether this event is forbidden.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultDockRelocatorEvent

public DefaultDockRelocatorEvent(DockController controller,
                                 Dockable dockable,
                                 DockStation target)
Creates a new event.

Parameters:
controller - the controller in whose realm the event happens
dockable - the element that is moved around
target - the potential parent of dockable
Method Detail

cancel

public void cancel()
Description copied from interface: DockRelocatorEvent
Cancels the entire operation, the Dockable remains at its current place and all visible indicators are removed.

Specified by:
cancel in interface DockRelocatorEvent

drop

public void drop()
Description copied from interface: DockRelocatorEvent
Advices to complete the drag and drop operation right now, this operation at least requires DockRelocatorEvent.getTarget() to be not null, otherwise this operation is equal to calling DockRelocatorEvent.cancel().

Specified by:
drop in interface DockRelocatorEvent

forbid

public void forbid()
Description copied from interface: DockRelocatorEvent
Forbids the current event to complete, depending on the state of the operation this is equivalent to calling DockRelocatorEvent.cancel().

Specified by:
forbid in interface DockRelocatorEvent

getController

public DockController getController()
Description copied from interface: DockRelocatorEvent
Gets the controller in whose realm this event was created.

Specified by:
getController in interface DockRelocatorEvent
Returns:
the controller, not null

getDockable

public Dockable getDockable()
Description copied from interface: DockRelocatorEvent
Gets the Dockable which is or will be dragged.

Specified by:
getDockable in interface DockRelocatorEvent
Returns:
the dragged item

getSource

public DockRelocator getSource()
Description copied from interface: DockRelocatorEvent
Gets the DockRelocator which created this event.

Specified by:
getSource in interface DockRelocatorEvent
Returns:
the relocator, not null

getTarget

public DockStation getTarget()
Description copied from interface: DockRelocatorEvent
Gets the current target of the drag and drop operation, if the operation would finish now, the dockable would be dropped onto this station.

Specified by:
getTarget in interface DockRelocatorEvent
Returns:
the current target or null if either the drag and drop operation is not yet started or if there is no target selected

isCanceled

public boolean isCanceled()
Description copied from interface: DockRelocatorEvent
Tells whether this event is already canceled. This can either be due to a call to DockRelocatorEvent.cancel() or because the DockRelocator already decided that the operation has to be canceled.

Specified by:
isCanceled in interface DockRelocatorEvent
Returns:
whether the operation is canceled
See Also:
DockRelocatorEvent.cancel()

isDropping

public boolean isDropping()
Description copied from interface: DockRelocatorEvent
Tells whether this event will result in a drop operation. This can be either due to a call to DockRelocatorEvent.drop() or because the DockRelocator already decided that a the operation has to finish.

Specified by:
isDropping in interface DockRelocatorEvent
Returns:
whether the dockable will be dropped
See Also:
DockRelocatorEvent.drop()

isForbidden

public boolean isForbidden()
Description copied from interface: DockRelocatorEvent
Tells whether this event is forbidden. This can either be due to a call to DockRelocatorEvent.forbid() or because the DockRelocator already decided that this operation should not have an effect.

Specified by:
isForbidden in interface DockRelocatorEvent
Returns:
whether the operation is forbidden
See Also:
DockRelocatorEvent.forbid()