@Override public void setChild( SplitNode child, int location ) { if( location == 0 ) setChild( child ); else throw new IllegalArgumentException( "Location invalid: " + location ); }
@Override public void evolve( SplitDockTree<Dockable>.Key key, boolean checkValidity, Map<Leaf, Dockable> linksToSet ){ setChild( create( key, checkValidity, linksToSet ) ); }
@Override public boolean aside( AsideRequest request ){ if( child == null ){ if( request.getPlaceholder() != null ){ Placeholder placeholder = createPlaceholder( -1 ); setChild( placeholder ); return placeholder.aside( request ); } } else{ return child.aside( request ); } return true; }
@Override public boolean insert( SplitDockPathProperty property, int depth, Dockable dockable ) { if( child == null ){ long id = property.getLeafId(); Leaf leaf = create( dockable, id ); if( leaf == null ) return false; setChild( leaf ); leaf.setDockable( dockable, null ); return true; } else return child.insert( property, depth, dockable ); }
@Override public boolean aside( SplitDockPathProperty property, int index, AsideRequest request ){ if( child == null ){ if( request.getPlaceholder() != null ){ long id = property.getLeafId(); Placeholder placeholder = createPlaceholder( id ); setChild( placeholder ); placeholder.addPlaceholder( request.getPlaceholder() ); } return true; } else{ return child.aside( property, index, request ); } }
/** * Removes all children from this station.<br> * Note: clients may need to invoke {@link DockController#freezeLayout()} * and {@link DockController#meltLayout()} to ensure no-one else adds or * removes <code>Dockable</code>s. */ public void removeAllDockables(){ DockController controller = getController(); try { access.arm(); DockUtilities.checkLayoutLocked(); if( controller != null ) controller.freezeLayout(); for( int i = getDockableCount() - 1; i >= 0; i-- ) removeDisplayer(i, null); root().setChild(null); } finally { if( controller != null ) controller.meltLayout(); access.fire(); } }
/** * Removes all children from this station.<br> * Note: clients may need to invoke {@link DockController#freezeLayout()} * and {@link DockController#meltLayout()} to ensure noone else adds or * removes <code>Dockable</code>s. */ public void removeAllDockables(){ DockController controller = getController(); try { access.arm(); DockUtilities.checkLayoutLocked(); if( controller != null ) controller.freezeLayout(); for( int i = getDockableCount() - 1; i >= 0; i-- ) removeDisplayer(i, null); root().setChild(null); } finally { if( controller != null ) controller.meltLayout(); access.fire(); } }
if( shrink ){ if( parent instanceof Root ){ ((Root)parent).setChild( null );