public Rectangle getBounds(){ return root.getBounds(); }
/** * Replaces this node with <code>node</code>. Does nothing if this node has no parent. * @param node the replacement, not <code>null</code> */ public void replace( SplitNode node ){ if( node == null ) throw new IllegalArgumentException( "node must not be null" ); SplitNode parent = getParent(); if( parent != null ){ int location = parent.getChildLocation( this ); parent.setChild( node, location ); } }
/** * Sets the parent of this node. * @param parent the new parent, can be <code>null</code> */ public void setParent( SplitNode parent ){ if( this.parent != null ){ SplitNode node = this.parent; this.parent = null; node.setChild( null, node.getChildLocation( this ) ); } this.parent = parent; }
private int score( Column c ){ int score = 0; SplitNode root = c.root; while( root != null ){ SplitNode parent = root.getParent(); if( parent != null && parent.getChildLocation( root ) > 0 ){ score++; } root = parent; } return score; } });
origin.getSize(); if( other.getParent() instanceof Root ){ other = other.getParent(); Dimension nodeSize = other.getSize(); other.getMinimumSize(), Orientation.VERTICAL, other.getWidth(), other.getHeight() ); other.getMinimumSize(), item.getMinimumSize(), Orientation.VERTICAL, other.getWidth(), other.getHeight() ); other.getMinimumSize(), Orientation.HORIZONTAL, other.getWidth(), other.getHeight() ); other.getMinimumSize(), item.getMinimumSize(), Orientation.HORIZONTAL, other.getWidth(), other.getHeight() );
PlaceholderMap map = getPlaceholderMap(); if( map != null ){ map.setPlaceholderStrategy( null ); SplitNode parent = getParent(); if( parent != null ){ if( shrink ){ if( !parent.hasPlaceholders() ){ Node node = (Node)parent; SplitNode other = node.getLeft() == this ? node.getRight() : node.getLeft(); int location = parent.getChildLocation( node ); parent.setChild( other, location ); int location = parent.getChildLocation( this ); parent.setChild( null, location );
@Override public boolean aside( AsideRequest request ){ boolean leftVisible = left == null || left.isVisible(); boolean rightVisible = right == null || right.isVisible(); if( leftVisible ){ return left.aside( request ); } else if( rightVisible ){ return right.aside( request ); } else{ return false; } }
SplitNode right = real.getRight(); boolean leftVisible = left == null ? false : left.isVisible(); boolean rightVisible = right == null ? false : right.isVisible(); if( leftVisible && rightVisible ){ return new ResizeNode<T>( this, parent, (Node)node ); return toElement( parent, left.getVisible() ); return toElement( parent, right.getVisible() );
if( SplitNode.above( 0, 0, station.getWidth(), station.getHeight(), x, y )){ if( SplitNode.above( 0, station.getHeight(), station.getWidth(), 0, x, y )){ if( SplitNode.above( 0, station.getHeight(), station.getWidth(), 0, x, y )){ if( node.getLeft().isVisible() && node.getRight().isVisible() ){ if( info.getPut() == PutInfo.Put.TOP && node.getOrientation() == Orientation.VERTICAL && node.getLeft() == leaf ) return null;
SplitNode parent = getParent(); int location = parent.getChildLocation( this ); if( reverse ){ split = createNode( newNodeId ); split.setOrientation( orientation ); split.setLeft( this ); split = createNode( newNodeId ); split.setLeft( newChild ); split.setRight( this ); parent.setChild( split, location );
@Override public Dimension getMinimumSize() { boolean leftVisible = left == null || left.isVisible(); boolean rightVisible = right == null || right.isVisible(); Dimension minLeft = leftVisible ? left.getMinimumSize() : null; Dimension minRight = rightVisible ? right.getMinimumSize() : null; return getSize( minLeft, minRight ); }
if( target == null ){ SplitNode node = putInfo.getNode(); if( node.getParent() == getRoot() ){ node = getRoot(); Rectangle bounds = node.getBounds(); paint.drawInsertion(g, putInfo.getNode().getBounds(), bounds); Rectangle bounds = putInfo.getNode().getBounds(); StationPaint stationPaint = paint.get(); if( stationPaint != null ){
int size = 100; SplitNode node = info.getNode(); if( node.getParent() == station.getRoot() ){ node = node.getParent(); size = (int)(node.getSize().width * divider); break; case RIGHT: size = (int)(node.getSize().width * (1-divider)); break; case TOP: size = (int)(node.getSize().height * divider); break; case BOTTOM: size = (int)(node.getSize().height * (1-divider)); break;
/** * Gets the {@link Column} which contains <code>node</code>. * @param node the node whose column is searched * @param upwards if <code>false</code>, then <code>node</code> * has to be a {@link #isColumnRoot(SplitNode)}, otherwise * it can be a child of a column root as well. * @return the column or <code>null</code> */ public Column getColumn( SplitNode node, boolean upwards ){ if( upwards ){ Column column = null; while( node != null && column == null ) { column = getColumns().get( node ); node = node.getParent(); } return column; } else{ return getColumns().get( node ); } }
@Override public Dimension getPreferredSize(){ boolean leftVisible = left == null || left.isVisible(); boolean rightVisible = right == null || right.isVisible(); Dimension minLeft = leftVisible ? left.getPreferredSize() : null; Dimension minRight = rightVisible ? right.getPreferredSize() : null; return getSize( minLeft, minRight ); }
@Override public Node getDividerNode( int x, int y ){ boolean leftVisible = left == null || left.isVisible(); boolean rightVisible = right == null || right.isVisible(); if( leftVisible && rightVisible && dividerBounds.contains( x, y )) return this; if( left != null && leftVisible ){ Node node = left.getDividerNode( x, y ); if( node != null ) return node; } if( right != null && rightVisible ){ return right.getDividerNode( x, y ); } else{ return null; } }