/** * Constructs a new node. * @param access the access to the owner-station of this node * @param left the left child * @param right the right child * @param id the unique id of this node */ public Node( SplitDockAccess access, SplitNode left, SplitNode right, long id ){ super( access, id ); setRight( right ); setLeft( left ); }
@Override public void setChild( SplitNode child, int location ) { if( location == 0 ) setLeft( child ); else if( location == 1 ) setRight( child ); else throw new IllegalArgumentException( "Location not valid " + location ); }
/** * Constructs a new node. * @param access the access to the owner-station of this node * @param left the left child * @param right the right child */ public Node( SplitDockAccess access, SplitNode left, SplitNode right ){ super( access, -1 ); setRight( right ); setLeft( left ); }
@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 )); } }
node.setRight( this );
Node node = access.createNode( -1 ); node.setLeft( leaf ); node.setRight( child ); root.setChild( node );
Node node = access.createNode( -1 ); node.setLeft( leaf ); node.setRight( child ); root.setChild( node );