bibliothek.gui.dock.control.relocator
Interface Inserter

All Known Implementing Classes:
MultiInserter

public interface Inserter

The Inserter is used by the DockRelocator to build and execute StationDropOperations independent from the involved DockStations and Dockables. The Inserter is a very powerful interface, as it can completely override any decision that was made by a DockStation.
An Inserter does not have access to the internas of a DockStation, nor does any DockStation know of the existence of the Inserter. Some station may however offer special methods to create fitting StationDropOperations.

Author:
Benjamin Sigg

Method Summary
 StationDropOperation after(InserterSource source)
          This method is called after DockStation#prepareDrop(int, int, int, int, Dockable) was executed, the method is called in any case independent of whether prepareDrop returned a StationDropOperation or not.
 StationDropOperation before(InserterSource source)
          This method is called if DockStationDropLayer.contains(int, int) confirmed that a point belongs to the layer, but before DockStation#prepareDrop(int, int, int, int, Dockable) was invoked.
 

Method Detail

before

StationDropOperation before(InserterSource source)
This method is called if DockStationDropLayer.contains(int, int) confirmed that a point belongs to the layer, but before DockStation#prepareDrop(int, int, int, int, Dockable) was invoked.

Parameters:
source - information about the current position of the mouse, the invoked DockElements and other things related to a drag and drop operation.
Returns:
a value of null if this Inserter is not interested in the event, a value not null will override DockStation#prepareDrop(int, int, int, int, Dockable) (the method will never be called), in this case after(InserterSource) is not called either.

after

StationDropOperation after(InserterSource source)
This method is called after DockStation#prepareDrop(int, int, int, int, Dockable) was executed, the method is called in any case independent of whether prepareDrop returned a StationDropOperation or not.

Parameters:
source - information about the current position of the mouse, the invoked DockElements and other things related to a drag and drop operation.
Returns:
a value of null if this Inserter is not interested in the event, a value not null will override the result of DockStation#prepareDrop(int, int, int, int, Dockable)