/** * Sets <code>key</code> as the root of the tree. The root must not have * a parent. * @param key the key which will be the root, <code>null</code> is not allowed. * @return <code>this</code> */ public SplitDockTree<D> root( Key key ){ if( key == null ) throw new IllegalArgumentException( "Key must not be null" ); if( key.getTree() != this ) throw new IllegalArgumentException( "Key is not created by this tree" ); if( key.parent != null ) throw new IllegalArgumentException( "Key has a parent, and can't be the root" ); this.root = key; return this; }
/** * Sets <code>key</code> as the root of the tree. The root must not have * a parent. * @param key the key which will be the root, <code>null</code> is not allowed. * @return <code>this</code> */ public SplitDockTree<D> root( Key key ){ if( key == null ) throw new IllegalArgumentException( "Key must not be null" ); if( key.getTree() != this ) throw new IllegalArgumentException( "Key is not created by this tree" ); if( key.parent != null ) throw new IllegalArgumentException( "Key has a parent, and can't be the root" ); this.root = key; return this; }
SplitDockTree<PerspectiveDockable> tree = key.getTree(); if( tree.isDockable( key )){ PerspectiveDockable[] dockables = tree.getDockables( key );
SplitDockTree<Dockable> tree = key.getTree(); CombinerSource source = new NodeCombinerSource( dockables[0], dockables[1], key.getTree().getPlaceholderMap( key ) ); CombinerTarget target = combiner.prepare( source, Enforcement.HARD ); Dockable selected = key.getTree().getSelected( key ); if( selected != null ) station.setFrontDockable( selected ); Dockable selected = key.getTree().getSelected( key ); if( selected != null ) station.setFrontDockable( selected );
SplitDockTree<PerspectiveDockable> tree = key.getTree(); if( tree.isDockable( key )){ PerspectiveDockable[] dockables = tree.getDockables( key );
@Override public void evolve( SplitDockTree<Dockable>.Key key, boolean checkValidity, Map<Leaf, Dockable> linksToSet ){ SplitDockTree<Dockable> tree = key.getTree(); setPlaceholders( tree.getPlaceholders( key ) ); setPlaceholderMap( tree.getPlaceholderMap( key ) ); if( tree.isHorizontal( key )){ orientation = SplitDockStation.Orientation.HORIZONTAL; setLeft( create( tree.getLeft( key ), checkValidity, linksToSet )); setRight( create( tree.getRight( key ), checkValidity, linksToSet )); setDivider( tree.getDivider( key )); } else{ orientation = SplitDockStation.Orientation.VERTICAL; setLeft( create( tree.getTop( key ), checkValidity, linksToSet )); setRight( create( tree.getBottom( key ), checkValidity, linksToSet )); setDivider( tree.getDivider( key )); } }
@Override public void evolve( SplitDockTree<Dockable>.Key key, boolean checkValidity, Map<Leaf, Dockable> linksToSet ){ setPlaceholders( key.getTree().getPlaceholders( key ) ); }