bibliothek.gui.dock.control.relocator
Class StackMerger

java.lang.Object
  extended by bibliothek.gui.dock.control.relocator.StackMerger
All Implemented Interfaces:
Merger

public class StackMerger
extends java.lang.Object
implements Merger

This merger takes two StackDockStations and merges them into one.

Author:
Benjamin Sigg

Constructor Summary
StackMerger()
           
 
Method Summary
 boolean canMerge(DockStation parent, DockStation child)
          Checks whether Merger.merge(DockStation, DockStation) will succeed or not.
 void merge(DockStation parent, DockStation child)
          Moves all children of child to parent, leaving child empty.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StackMerger

public StackMerger()
Method Detail

canMerge

public boolean canMerge(DockStation parent,
                        DockStation child)
Description copied from interface: Merger
Checks whether Merger.merge(DockStation, DockStation) will succeed or not. This method will only be called if parent would accept all children of child. This method may be called during "drop" and during "move" operations.

Specified by:
canMerge in interface Merger
Parameters:
parent - an existing station
child - a station that is dragged around and may be dropped onto parent
Returns:
whether Merger.merge(DockStation, DockStation) will succeed

merge

public void merge(DockStation parent,
                  DockStation child)
Description copied from interface: Merger
Moves all children of child to parent, leaving child empty. This method is only called if canMerge returned true and if the accept-methods allow the operation.
If the parent of child is not parent, then child will be removed from its parent. Otherwise the child remains, allowing this Merger to reuse it.

Specified by:
merge in interface Merger
Parameters:
parent - the new parent of the children
child - the station to disolve