/** * Replaces <code>this</code> with <code>next</code>. * @param next the element which replaces this */ public void replace( Entry next ){ Entry parent = getParent(); if( parent == null ){ return; } if( parent instanceof Root ){ ((Root)parent).setChild( next ); } else{ Node parentNode = (Node)parent; if( parentNode.getChildA() == this ){ parentNode.setChildA( next ); } else{ parentNode.setChildB( next ); } } }
/** * Replaces <code>this</code> with <code>next</code>. * @param next the element which replaces this */ public void replace( Entry next ){ Entry parent = getParent(); if( parent == null ){ return; } if( parent instanceof Root ){ ((Root)parent).setChild( next ); } else{ Node parentNode = (Node)parent; if( parentNode.getChildA() == this ){ parentNode.setChildA( next ); } else{ parentNode.setChildB( next ); } } }
/** * Creates a new node. * @param orientation whether this node is horizontal or vertical * @param divider the location of the divider * @param childA the left or top child * @param childB the right or bottom child * @param placeholders placeholders associated with this node * @param placeholderMap placeholder information of a child {@link DockStation} * @param id the unique identifier of this node or -1 */ public Node( Orientation orientation, double divider, Entry childA, Entry childB, Set<Path> placeholders, PlaceholderMap placeholderMap, long id ){ super( placeholders, placeholderMap, id ); this.orientation = orientation; this.divider = divider; setChildA( childA ); setChildB( childB ); }
/** * Creates a new node. * @param orientation whether this node is horizontal or vertical * @param divider the location of the divider * @param childA the left or top child * @param childB the right or bottom child * @param placeholders placeholders associated with this node * @param placeholderMap placeholder information of a child {@link DockStation} * @param id the unique identifier of this node or -1 */ public Node( Orientation orientation, double divider, Entry childA, Entry childB, Set<Path> placeholders, PlaceholderMap placeholderMap, long id ){ super( placeholders, placeholderMap, id ); this.orientation = orientation; this.divider = divider; setChildA( childA ); setChildB( childB ); }