Package bibliothek.gui.dock.common.layout

Examples of bibliothek.gui.dock.common.layout.RequestDimension


     * {@link CControl#handleResizeRequests()} manually to process all pending
     * requests.
     * @see #setResizeRequest(RequestDimension, boolean)
     */
    public void setResizeRequest( Dimension size, boolean process ){
        resizeRequest = size == null ? null : new RequestDimension( size );
       
        if( process && control != null ){
            control.getOwner().handleResizeRequests();
        }
    }
View Full Code Here


     * Clients can set this parameter to <code>false</code> and call
     * {@link CControl#handleResizeRequests()} manually to process all pending
     * requests.
     */
    public void setResizeRequest( RequestDimension size, boolean process ){
        resizeRequest = size == null ? null : new RequestDimension( size );
       
        if( process && control != null ){
            control.getOwner().handleResizeRequests();
        }
    }
View Full Code Here

            control.getOwner().handleResizeRequests();
        }
    }
   
    public RequestDimension getAndClearResizeRequest() {
        RequestDimension result = resizeRequest;
        resizeRequest = null;
        return result;
    }
View Full Code Here

     * @return the size request or <code>null</code>
     */
    protected RequestDimension getAndClearResizeRequest( Dockable dockable ){
        if( dockable instanceof CommonDockable ){
            CDockable cdock = ((CommonDockable)dockable).getDockable();
            RequestDimension result = cdock.getAndClearResizeRequest();
            if( result == null )
                return null;
           
            return result.clone();
        }
        if( dockable instanceof StackDockStation ){
            RequestDimension max = new RequestDimension();
            StackDockStation station = (StackDockStation)dockable;
           
            for( int i = 0, n = station.getDockableCount(); i<n; i++ ){
                RequestDimension check = getAndClearResizeRequest( station.getDockable( i ) );
                if( check != null ){
                    Dimension sizeDockable = station.getDockable( i ).getComponent().getSize();
                    Dimension sizeStation = station.getComponent().getSize();
                   
                    if( check.isWidthSet() ){
                        max.setWidth( Math.max( max.getWidth(), check.getWidth() + sizeStation.width - sizeDockable.width  ) );
                    }
                    if( check.isHeightSet() ){
                        max.setHeight( Math.max( max.getHeight(), check.getHeight() + sizeStation.height - sizeDockable.height ) );
                    }
                }
            }
           
            if( max.isHeightSet() || max.isWidthSet() )
View Full Code Here

        public void updateBounds( Root root, double x, double y, double factorW, double factorH ) {
            updateBoundsLocked( root, x, y, factorW, factorH );
        }
        @Override
        public RequestDimension prepareResize( Leaf leaf ) {
            RequestDimension request = getAndClearResizeRequest( leaf.getDockable() );
            if( request != null ){
                Insets insets = leaf.getDisplayer().getDockableInsets();
               
                if( request.isWidthSet() )
                    request.setWidth( request.getWidth() + insets.left + insets.right );
               
                if( request.isHeightSet() )
                    request.setHeight( request.getHeight() + insets.top + insets.bottom );
               
                return request;
            }
           
            return super.prepareResize( leaf );
View Full Code Here

        boolean lockedHeight = isLockedVertically( leaf.getDockable() );
       
        if( !lockedWidth && !lockedHeight )
            return null;
       
        RequestDimension request = new RequestDimension();
        Rectangle bounds = leaf.getCurrentBounds();
       
        if( lockedWidth ){
            double width = leaf.getWidth();
            if( width > 0 ){
                request.setWidth( bounds.width );
            }
        }
       
        if( lockedHeight ){
            double height = leaf.getHeight();
            if( height > 0 ){
                request.setHeight( bounds.height );
            }
        }
       
        return request;
    }
View Full Code Here

    public void handleResizeRequest( CControl control ) {
        boolean horizontal = station.getDirection() == Direction.SOUTH || station.getDirection() == Direction.NORTH;
       
        for( int i = 0, n = station.getDockableCount(); i<n; i++ ){
            Dockable dockable = station.getDockable( i );
            RequestDimension size = getAndClearResizeRequest( dockable );
            if( size != null ){
                if( horizontal ){
                    if( size.isWidthSet() ){
                        station.setWindowSize( dockable, size.getWidth() );
                    }
                }
                else{
                    if( size.isHeightSet() ){
                        station.setWindowSize( dockable, size.getHeight() );
                    }
                }
            }
        }
    }
View Full Code Here

    }
   
    public void handleResizeRequest( CControl control ) {
        for( int i = 0, n = station.getDockableCount(); i<n; i++ ){
            ScreenDockWindow window = station.getWindow( i );
            RequestDimension size = getAndClearResizeRequest( station.getDockable( i ) );
            if( size != null ){
                Insets insets = window.getDockableInsets();
                Rectangle bounds = window.getWindowBounds();
               
                int width;
                if( size.isWidthSet() )
                    width = size.getWidth() + insets.left + insets.right;
                else
                    width = bounds.width;
               
                int height;
                if( size.isHeightSet() )
                    height = size.getHeight() + insets.top + insets.bottom;
                else
                    height = bounds.height;

                window.setWindowBounds(
                        new Rectangle(
View Full Code Here

TOP

Related Classes of bibliothek.gui.dock.common.layout.RequestDimension

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.