@Override public DockableProperty findProperty( DockableProperty successor ) { if( successor == null ){ return new ScreenDockProperty( 20, 20, 400, 400 ); } return successor; }
/** * Creates a new location by creating the child location of <code>location</code> using * <code>property</code> for that step. * @param location the location to expand * @param property the property that is the source of the next location * @return the new location or <code>null</code> if no conversion is possible */ protected CLocation expand( CLocation location, ScreenDockProperty property ){ if( property.isFullscreen() ){ return new CMaximalExternalizedLocation( location, property.getX(), property.getY(), property.getWidth(), property.getHeight() ); } else{ return new CExternalizedLocation( location, property.getX(), property.getY(), property.getWidth(), property.getHeight() ); } }
@Override public DockableProperty findProperty( DockableProperty successor ){ ScreenDockProperty screen = new ScreenDockProperty( x, y, width, height ); screen.setSuccessor( successor ); if( parent != null ){ return parent.findProperty( screen ); } return screen; }
public ScreenDockProperty copy() { ScreenDockProperty copy = new ScreenDockProperty( x, y, width, height, placeholder, fullscreen ); copy( copy ); return copy; }
int x = property.getX(); int y = property.getY(); int width = property.getWidth(); int height = property.getHeight(); Path placeholder = property.getPlaceholder(); if( placeholder != null ){ ScreenDockWindowHandle handle = dockables.getDockableAt( placeholder ); height = meta.getInt( "height" ); ScreenDockProperty replacement = new ScreenDockProperty( x, y, width, height, placeholder, property.isFullscreen() ); replacement.setSuccessor( property.getSuccessor() ); args.setProperty( replacement ); args.setBoundsIncludeWindow( true );
DockableProperty successor = property.getSuccessor(); Dockable dock = best.getDockable(); if( successor != null ){ Dockable old = best.getDockable(); if( old.accept( this, dockable ) && dockable.accept( this, old ) && (acceptance == null || acceptance.accept( this, old, dockable ))){ combine( old, dockable, property.getSuccessor() ); done = true; boolean accept = accept( dockable ) && dockable.accept( this ) && (acceptance == null || acceptance.accept( this, dockable )); if( accept ){ addDockable( dockable, new Rectangle( property.getX(), property.getY(), property.getWidth(), property.getHeight() ), property.getPlaceholder(), args.isBoundsIncludeWindow() ); done = true; if( done && property.isFullscreen() ){ DockStation parent = dockable.getDockParent(); while( parent != null && parent != this ){
public DockableProperty getLocationAt( Path placeholder ) { DockablePlaceholderList<ScreenDockWindowHandle>.Item item = dockables.getItem( placeholder ); if( item == null ){ return null; } ScreenDockWindowHandle handle = item.getDockable(); if( handle != null ){ Dockable dockable = handle.asDockable(); ScreenDockProperty property = getLocation( dockable, dockable ); property.setPlaceholder( placeholder ); return property; } else if( item.contains( "x", "y", "width", "height" )){ int x = item.getInt( "x" ); int y = item.getInt( "y" ); int width = item.getInt( "width" ); int height = item.getInt( "height" ); return new ScreenDockProperty( x, y, width, height, placeholder ); } else{ return null; } } };
public boolean isChildLocation( DockableProperty location ){ if( location instanceof ScreenDockProperty ){ return ((ScreenDockProperty)location).isFullscreen(); } return false; } };
public void aside( AsideRequest request ){ DockableProperty location = request.getLocation(); if( location instanceof ScreenDockProperty ){ ScreenDockProperty screenLocation = (ScreenDockProperty)location; DockablePlaceholderList<ScreenDockWindowHandle>.Item item = getItem( screenLocation ); if( item != null ){ delegate().combine( item, getCombiner(), request ); } ScreenDockProperty copy = screenLocation.copy(); copy.setSuccessor( null ); copy.setPlaceholder( request.getPlaceholder() ); request.answer( copy ); } }
throw new IllegalArgumentException( "cannot drag dockable from its current parent" ); location.setFullscreen( false ); if( !station.drop( dockable, location, true )){ throw new IllegalStateException( "could not drop dockable on this station" );
@Override public void dropped( ScreenDockStation station, DropArguments arguments, boolean successfull ){ if( pending != null && successfull ){ DockStation child = arguments.getDockable().asDockStation(); DockableProperty successor = arguments.getProperty().getSuccessor(); if( successor == null || !child.drop( pending, successor )){ child.drop( pending ); } } pending = null; } }
public boolean isChildLocation( DockableProperty location ){ if( location instanceof ScreenDockProperty ){ return !((ScreenDockProperty)location).isFullscreen(); } return false; }
throw new IllegalArgumentException( "cannot drag dockable from its current parent" ); location.setFullscreen( false ); if( !station.drop( dockable, location, true )){ throw new IllegalStateException( "could not drop dockable on this station" );
/** * Creates a new location by creating the child location of <code>location</code> using * <code>property</code> for that step. * @param location the location to expand * @param property the property that is the source of the next location * @return the new location or <code>null</code> if no conversion is possible */ protected CLocation expand( CLocation location, ScreenDockProperty property ){ if( property.isFullscreen() ){ return new CMaximalExternalizedLocation( location, property.getX(), property.getY(), property.getWidth(), property.getHeight() ); } else{ return new CExternalizedLocation( location, property.getX(), property.getY(), property.getWidth(), property.getHeight() ); } }
@Override public DockableProperty findProperty( DockableProperty successor ) { if( successor == null ){ return new ScreenDockProperty( 20, 20, 400, 400 ); } return successor; }
@Override public DockableProperty findProperty( DockableProperty successor ){ ScreenDockProperty screen = new ScreenDockProperty( x, y, width, height ); screen.setSuccessor( successor ); if( parent != null ){ return parent.findProperty( screen ); } return screen; }
public boolean isChildLocation( DockableProperty location ){ if( location instanceof ScreenDockProperty ){ return ((ScreenDockProperty)location).isFullscreen(); } return false; } };
public void move( Dockable dockable, DockableProperty property ) { DockUtilities.checkLayoutLocked(); if( property instanceof ScreenDockProperty ){ ScreenDockWindow window = getWindow( dockable ); if( window == null ) throw new IllegalArgumentException( "dockable not child of this station" ); ScreenDockProperty bounds = (ScreenDockProperty)property; window.setWindowBounds( new Rectangle( bounds.getX(), bounds.getY(), bounds.getWidth(), bounds.getHeight() ) ); } }
public DockableProperty createProperty() { return new ScreenDockProperty(); } }
@Override public DockableProperty findProperty( DockableProperty successor ){ ScreenDockProperty screen = new ScreenDockProperty( getX(), getY(), getWidth(), getHeight(), null, true ); screen.setSuccessor( successor ); CLocation parent = getParent(); if( parent != null ){ return parent.findProperty( screen ); } return screen; }