bibliothek.gui.dock.control.relocator
Interface DockRelocatorEvent

All Known Implementing Classes:
DefaultDockRelocatorEvent

public interface DockRelocatorEvent

An event created by the DockRelocator and forwarded to the VetoableDockRelocatorListener. This event represents what the users sees on the screen, internally the drag and drop operation may trigger additional events.

Author:
Benjamin Sigg

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 getTarget() to be not null, otherwise this operation is equal to calling cancel().
 void forbid()
          Forbids the current event to complete, depending on the state of the operation this is equivalent to calling cancel().
 DockController getController()
          Gets the controller in whose realm this event was created.
 Dockable getDockable()
          Gets the Dockable which is or will be dragged.
 Dockable[] getImplicitDockables()
          Gets a set of Dockables that will also change their parent due to this event.
 Point getMouseLocation()
          Gets the location of the mouse on the screen.
 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.
Please note that this field does not take into consideration, that the dockable may be forced onto another parent.
 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.
 

Method Detail

getController

DockController getController()
Gets the controller in whose realm this event was created.

Returns:
the controller, not null

getSource

DockRelocator getSource()
Gets the DockRelocator which created this event.

Returns:
the relocator, not null

getDockable

Dockable getDockable()
Gets the Dockable which is or will be dragged.

Returns:
the dragged item

getImplicitDockables

Dockable[] getImplicitDockables()
Gets a set of Dockables that will also change their parent due to this event. This list contains only the set of Dockables that are directly affected by this event. Elements that are affected indirectly, e.g. because a DockStation remains that has only one child and thus gets removed, are not included.

Returns:
the items whose position is about to change too, can be empty but not null

getTarget

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.
Please note that this field does not take into consideration, that the dockable may be forced onto another parent. Clients should always ask the Dockable directly for its real parent.

Returns:
the current target or null if either the drag and drop operation is not yet started or if there is no target selected

getMouseLocation

Point getMouseLocation()
Gets the location of the mouse on the screen. This includes imaginary points created by calls to a DirectRemoteRelocator or a RemoteRelocator. The property may not be set if either the location of the mouse is not important for the current event, or simply if the location of the mouse is not known.

Returns:
the location of the mouse, may be null

cancel

void cancel()
Cancels the entire operation, the Dockable remains at its current place and all visible indicators are removed.


isCanceled

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

Returns:
whether the operation is canceled
See Also:
cancel()

forbid

void forbid()
Forbids the current event to complete, depending on the state of the operation this is equivalent to calling cancel().


isForbidden

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

Returns:
whether the operation is forbidden
See Also:
forbid()

drop

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


isDropping

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

Returns:
whether the dockable will be dropped
See Also:
drop()