bibliothek.gui.dock.station
Interface Combiner

All Known Implementing Classes:
BasicCombiner, SplitCombiner, StationCombinerValue, ThemeCombiner

public interface Combiner

A Combiner merges two Dockables into one Dockable. How this is done, is up to the Combiner, but most Combiners will create a new DockStation and put the Dockables onto this new station.

See Also:
Merger, Inserter

Method Summary
 void aside(AsideRequest request)
          Prepares the layout of the DockStations that are created by this Combiner to keep track of a new DockableProperty with its own placeholder.
 Dockable combine(CombinerSource source, CombinerTarget target)
          Merges two Dockables into a new Dockable.
 CombinerTarget prepare(CombinerSource source, Enforcement force)
          Prepares information telling how two Dockables may be combined.
 

Method Detail

prepare

CombinerTarget prepare(CombinerSource source,
                       Enforcement force)
Prepares information telling how two Dockables may be combined.

Parameters:
source - the Dockables which may be combined, their parent station and other helpful information.
force - how much the caller of this method would like the method not to return a value of null. Implementations should read the force property, where a value of 1 means that this method must success, while 0 means that this method may or may not success. In general the modules in the framework expect that a value below 0.5 results in null, while a value above 0.5f results in a non-null value.
Returns:
How to combine the Dockables, may be null to indicate that a combination is not desired

combine

Dockable combine(CombinerSource source,
                 CombinerTarget target)
Merges two Dockables into a new Dockable. This method may set the DockController of the created element in order to initialize it more efficiently.

Parameters:
source - information about the two Dockables that are going to be merged, not null. This object may or may not have been created by this Combiner, some sanity checks are advised before using it
target - information that was created by prepare(CombinerSource, Enforcement) using source, not null
Returns:
the combined Dockable, not null

aside

void aside(AsideRequest request)
Prepares the layout of the DockStations that are created by this Combiner to keep track of a new DockableProperty with its own placeholder. The new property is set "aside" an existing location. For more information please read the documentation of DockElement.asDockable().

Parameters:
request - information about a location and methods to create the neighbor location
See Also:
DockStation.aside(AsideRequest)