bibliothek.gui.dock
Interface DockFactory<D extends DockElement,L>

Type Parameters:
D - the type of element which can be written and read by this factory
L - the type of object that stores the contents of a D. If clients cannot guarantee that always the same factory will be mapped to the same identifier, then L should be set to Object and the methods which receive a L should use instanceof before casting the argument.
All Superinterfaces:
DockConverter<D,L>
All Known Implementing Classes:
CommonMultipleDockableFactory, CommonSingleDockableFactory, DefaultDockableFactory, FlapDockStationFactory, RegisteringDockFactory, ReplacementDockFactory, ScreenDockStationFactory, SecureFlapDockStationFactory, SecureScreenDockStationFactory, SecureSplitDockStationFactory, SecureStackDockStationFactory, SplitDockStationFactory, StackDockStationFactory

public interface DockFactory<D extends DockElement,L>
extends DockConverter<D,L>

A DockConverter which can not only store and load the contents of an element, but also create a new DockElement with the content.

Author:
Benjamin Sigg

Method Summary
 void estimateLocations(L layout, LocationEstimationMap children)
          Tries to estimate the DockablePropertys of the children of the station which is represented by layout.
 D layout(L layout)
          Creates a new DockElement and changes the layout of the new element such that is matches layout.
 D layout(L layout, Map<Integer,Dockable> children)
          Creates a new DockElement and changes the layout of the new element such that is matches layout.
 
Methods inherited from interface bibliothek.gui.dock.layout.DockConverter
getID, getLayout, read, read, setLayout, setLayout, write, write
 

Method Detail

estimateLocations

void estimateLocations(L layout,
                       LocationEstimationMap children)
Tries to estimate the DockablePropertys of the children of the station which is represented by layout.
The children of this station accessible through children.getChild( ... ), this factory may also access the leafs in the tree of Dockables through children.getSubChild(...).
Note: this method must not set the successor of any DockableProperty, it is the callers responsibility to handle chains of stations.

Parameters:
layout - this station
children - the children of the station, this method should call DockLayoutInfo.setLocation(DockableProperty) or LocationEstimationMap.setLocation(int, DockableProperty) and LocationEstimationMap.setLocation(int, int, DockableProperty) for as many children as possible

layout

D layout(L layout,
         Map<Integer,Dockable> children)
Creates a new DockElement and changes the layout of the new element such that is matches layout.

Parameters:
layout - the new layout
children - some children, note that the map may not contain all elements which were present when the layout was created.
Returns:
a new element or null if layout can't be used

layout

D layout(L layout)
Creates a new DockElement and changes the layout of the new element such that is matches layout. This method should not add any children to the element.

Parameters:
layout - the new layout
Returns:
a new element or null if layout can't be used