/** * Given a set of <code>Dockable</code>s this method * estimates which of them will be visible once <code>composition</code> * is applied. * @param <D> the kind of elements to check * @param base a collection of <code>Dockable</code>s in no specific * order and with no restrictions * @param composition location information for various elements * @return A subset of <code>base</code> with those elements which will * be visible once this situation converts <code>composition</code> */ public <D extends DockElement> Set<D> listVisible( Collection<D> base, DockLayoutComposition composition ){ Set<D> result = new HashSet<D>(); listVisible( base, composition, result ); return result; }
/** * Given a set of <code>Dockable</code>s this method * estimates which of them will be visible once <code>composition</code> * is applied. * @param <D> the kind of elements to check * @param base a collection of <code>Dockable</code>s in no specific * order and with no restrictions * @param composition location information for various elements * @return A subset of <code>base</code> with those elements which will * be visible once this situation converts <code>composition</code> */ public <D extends DockElement> Set<D> listVisible( Collection<D> base, DockLayoutComposition composition ){ Set<D> result = new HashSet<D>(); listVisible( base, composition, result ); return result; }
/** * Tries to estimate which of the currently visible {@link Dockable}s will * still be visible if <code>layout</code> is applied to <code>frontend</code>. The * default implementation assumes that <code>situation</code> is a {@link PredefinedDockSituation}.<br> * Subclasses may override this method and modify the result in any way they like * @param frontend the caller of this method * @param situation algorithm used to convert <code>layout</code> * @param layout the layout that will be applied * @return an estimation of the elements that will be made invisible or <code>null</code> */ protected Set<Dockable> estimateVisible( DockFrontendInternals frontend, DockSituation situation, DockLayoutComposition layout ){ if( situation instanceof PredefinedDockSituation ){ Set<Dockable> allDockables = new HashSet<Dockable>(); for( DockInfo info : frontend.getDockables() ){ Dockable dockable = info.getDockable(); if( dockable != null ){ allDockables.add( dockable ); } } PredefinedDockSituation predefined = (PredefinedDockSituation)situation; Set<Dockable> visible = predefined.listVisible( allDockables, layout ); return visible; } return null; }
@Override protected Set<Dockable> estimateVisible( DockFrontendInternals frontend, DockSituation situation, DockLayoutComposition layout ){ if( situation instanceof PredefinedDockSituation ){ Set<Dockable> allDockables = new HashSet<Dockable>(); for( DockInfo info : frontend.getDockables() ){ Dockable dockable = info.getDockable(); if( dockable != null ){ allDockables.add( dockable ); } } for( MultipleCDockable dockable : control.getRegister().getMultipleDockables() ){ allDockables.add( dockable.intern() ); } PredefinedDockSituation predefined = (PredefinedDockSituation)situation; Set<Dockable> visible = predefined.listVisible( allDockables, layout ); findVisible( visible, layout ); return visible; } return null; }
@Override protected Set<Dockable> estimateVisible( DockFrontendInternals frontend, DockSituation situation, DockLayoutComposition layout ){ if( situation instanceof PredefinedDockSituation ){ Set<Dockable> allDockables = new HashSet<Dockable>(); for( DockInfo info : frontend.getDockables() ){ Dockable dockable = info.getDockable(); if( dockable != null ){ allDockables.add( dockable ); } } for( MultipleCDockable dockable : control.getRegister().getMultipleDockables() ){ allDockables.add( dockable.intern() ); } PredefinedDockSituation predefined = (PredefinedDockSituation)situation; Set<Dockable> visible = predefined.listVisible( allDockables, layout ); findVisible( visible, layout ); return visible; } return null; }
listVisible( base, child, result );
listVisible( base, child, result );