/** * Returns a newly created map that centers around the child with index <code>childIndex</code>. * @param childIndex the index of the child * @return the new map */ public DefaultLocationEstimationMap subMap( int childIndex ){ return new DefaultLocationEstimationMap( root.children.get( childIndex ) ); }
/** * Tries to guess the location of the elements stored in the tree below * <code>composition</code>, assuming that <code>composition</code> itself * is at location <code>location</code>. This method reads out the * {@link DockLayoutInfo} through {@link DockLayoutComposition#getLayout()} * and then calls {@link DockLayoutInfo#setLocation(DockableProperty)}, so * <code>composition</code> gets modified by this method. This method stops * its recursion if the location of a child of <code>composition</code> * was not found.<br> * This method returns immediately if one of: * <ul> * <li><code>composition</code> does not have children</li> * <li><code>composition</code> does not carry a {@link DockLayout}</li> * <li>There is no {@link DockFactory} registered for the factory-id found * in <code>composition</code></li> * </ul> <br> * Note: if the number of factories changed, then it might be a good idea * to call {@link #fillMissing(DockLayoutComposition)} before invoking this method. * @param composition the composition whose children should be analyzed * @param location the location of <code>composition</code>, can be <code>null</code> */ public void estimateLocations( DockLayoutComposition composition, DockableProperty location ){ DefaultLocationEstimationMap map = new DefaultLocationEstimationMap( composition ); estimateLocations( map ); if( location != null ){ appendFirstOnEstimate( composition, location ); } }