/** * Creates a {@link DockableProperty} for the location of <code>dockable</code>. * The location is encoded directly as the coordinates x,y,width and height * of the <code>dockable</code>. * @param dockable the element whose location is searched * @return the location */ public SplitDockProperty getDockableLocationProperty( Dockable dockable ){ Leaf leaf = getRoot().getLeaf(dockable); return new SplitDockProperty(leaf.getX(), leaf.getY(), leaf.getWidth(), leaf.getHeight()); }
/** * Creates a {@link DockableProperty} for the location of <code>dockable</code>. * The location is encoded directly as the coordinates x,y,width and height * of the <code>dockable</code>. * @param dockable the element whose location is searched * @return the location */ public SplitDockProperty getDockableLocationProperty( Dockable dockable ){ Leaf leaf = getRoot().getLeaf(dockable); return new SplitDockProperty(leaf.getX(), leaf.getY(), leaf.getWidth(), leaf.getHeight()); }
@Override public RequestDimension prepareResize( Leaf leaf ) { boolean lockedWidth = isLockedHorizontally( leaf.getDockable() ); 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; }
@Override public RequestDimension prepareResize( Leaf leaf ) { boolean lockedWidth = isLockedHorizontally( leaf.getDockable() ); 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; }
SplitDockProperty selfLocation = new SplitDockProperty( getX(), getY(), getWidth(), getHeight() ); selfLocation.setSuccessor( property.getSuccessor() ); boolean done = getAccess().drop( dockable, selfLocation, this );