bibliothek.gui.dock.control.relocator
Class MultiInserter

java.lang.Object
  extended by bibliothek.gui.dock.control.relocator.MultiInserter
All Implemented Interfaces:
Inserter

public class MultiInserter
extends Object
implements Inserter

An Inserter which consists of several child Inserters. In any method the first result that is not null is the result of the entire Inserter.

Author:
Benjamin Sigg

Constructor Summary
MultiInserter()
           
 
Method Summary
 void add(Inserter inserter)
          Adds a new Inserter to the list of Inserters.
 StationDropOperation after(InserterSource source)
          This method is called after DockStation.prepareDrop(bibliothek.gui.dock.station.StationDropItem) 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(bibliothek.gui.dock.station.StationDropItem) was invoked.
 Inserter get(int index)
          Gets the index'th inserter in the list of inserters.
 void remove(Inserter inserter)
          Removes inserter from the list of Inserters.
 int size()
          Gets the total number of Inserters in this list of inserters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultiInserter

public MultiInserter()
Method Detail

add

public void add(Inserter inserter)
Adds a new Inserter to the list of Inserters.

Parameters:
inserter - the new item, not null

remove

public void remove(Inserter inserter)
Removes inserter from the list of Inserters.

Parameters:
inserter - the item to remove

size

public int size()
Gets the total number of Inserters in this list of inserters.

Returns:
the list of inserters

get

public Inserter get(int index)
Gets the index'th inserter in the list of inserters.

Parameters:
index - the location
Returns:
the inserter, not null

before

public StationDropOperation before(InserterSource source)
Description copied from interface: Inserter
This method is called if DockStationDropLayer.contains(int, int) confirmed that a point belongs to the layer, but before DockStation.prepareDrop(bibliothek.gui.dock.station.StationDropItem) was invoked.

Specified by:
before in interface Inserter
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(bibliothek.gui.dock.station.StationDropItem) (the method will never be called), in this case Inserter.after(InserterSource) is not called either.

after

public StationDropOperation after(InserterSource source)
Description copied from interface: Inserter
This method is called after DockStation.prepareDrop(bibliothek.gui.dock.station.StationDropItem) was executed, the method is called in any case independent of whether prepareDrop returned a StationDropOperation or not.

Specified by:
after in interface Inserter
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(bibliothek.gui.dock.station.StationDropItem)