@Override public String toString(){ return getClass().getSimpleName() + "[placeholder=" + getPlaceholder() + ", backup=" + getBackup() + ", successor=" + getSuccessor() + "]"; }
public DockableProperty createProperty() { return new SplitDockPlaceholderProperty(); }
public SplitDockPlaceholderProperty copy(){ SplitDockPlaceholderProperty copy = new SplitDockPlaceholderProperty( placeholder, backup == null ? null : backup.copy() ); copy( copy ); return copy; }
if( location instanceof SplitDockPlaceholderProperty ){ SplitDockPlaceholderProperty property = (SplitDockPlaceholderProperty)location; SplitNode node = root().getPlaceholderNode( property.getPlaceholder() ); if( node != null ){ node.aside( request ); location = property.getBackup(); location = request.getLocation(); if( location instanceof SplitDockPlaceholderProperty ){ location = ((SplitDockPlaceholderProperty)location).getBackup(); SplitDockPlaceholderProperty newLocation = new SplitDockPlaceholderProperty( request.getPlaceholder(), path ); request.answer( newLocation );
/** * 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, SplitDockPlaceholderProperty property ){ return expand( location, property.getBackup() ); }
@Override public boolean insert( SplitDockPlaceholderProperty property, Dockable dockable ){ Path placeholder = property.getPlaceholder(); if( hasPlaceholder( placeholder )){ return replace( placeholder, dockable ); } return false; }
@Override public boolean insert( SplitDockPlaceholderProperty property, Dockable dockable ){ Path placeholder = property.getPlaceholder(); if( hasPlaceholder( placeholder )){ DockableProperty stationLocation = property.getSuccessor(); if( station != null && stationLocation != null ){ if( dockable.accept( station ) && station.accept( dockable )){ selfLocation.setSuccessor( property.getSuccessor() ); boolean done = getAccess().drop( dockable, selfLocation, this ); if( done ){
/** * Gets some {@link DockableProperty} that works as backup property * if the referenced placeholder is not found. * @param target the node that asks for this location * @return the location, not <code>null</code> */ public DockableProperty toLocation( SplitNode target ){ if( backup == null ){ return toSplitLocation( target ); } return backup; }
/** * Gets a {@link SplitDockProperty} that works as backup property * if the referenced placeholder is not found. * @param target the node that asks for this location * @return the location, not <code>null</code> */ public SplitDockProperty toSplitLocation( SplitNode target ){ if( backup instanceof SplitDockProperty ) return (SplitDockProperty)backup; if( backup instanceof SplitDockPathProperty ) return ((SplitDockPathProperty)backup).toLocation( target ); SplitDockProperty result = new SplitDockProperty( target.getX(), target.getY(), target.getWidth(), target.getHeight() ); result.setSuccessor( getSuccessor() ); return result; }
if( location instanceof SplitDockPlaceholderProperty ){ SplitDockPlaceholderProperty property = (SplitDockPlaceholderProperty)location; SplitNode node = root().getPlaceholderNode( property.getPlaceholder() ); if( node != null ){ node.aside( request ); location = property.getBackup(); location = request.getLocation(); if( location instanceof SplitDockPlaceholderProperty ){ location = ((SplitDockPlaceholderProperty)location).getBackup(); SplitDockPlaceholderProperty newLocation = new SplitDockPlaceholderProperty( request.getPlaceholder(), path ); request.answer( newLocation );
/** * 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, SplitDockPlaceholderProperty property ){ return expand( location, property.getBackup() ); }
/** * Ensures that the dropped {@link Dockable} does not come to rest at a location that would destroy the columns. */ @Override public boolean drop( Dockable dockable, SplitDockPlaceholderProperty property ){ SplitNode node = getRoot().getPlaceholderNode( property.getPlaceholder() ); if( node != null && !(node instanceof Leaf) && !(node instanceof Root)){ if( node instanceof Placeholder || ((Node)node).getOrientation() == side.getHeaderOrientation() ){ pushIntoHeader( node ); } } return super.drop( dockable, property ); }
@Override public boolean insert( SplitDockPlaceholderProperty property, Dockable dockable ){ boolean done = child != null && child.insert( property, dockable ); if( !done ){ return getAccess().drop( dockable, property.toSplitLocation( this ), this ); } return true; }
public DockableProperty getLocationAt( Path placeholder ) { SplitDockPathProperty path = station.getDockablePathProperty( placeholder ); return new SplitDockPlaceholderProperty( placeholder, path ); }
@Override public boolean insert( SplitDockPlaceholderProperty property, Dockable dockable ){ Path placeholder = property.getPlaceholder(); if( hasPlaceholder( placeholder )){
public DockableProperty getDockableProperty( PerspectiveDockable child, PerspectiveDockable target ){ Path placeholder = null; if( target != null ){ placeholder = target.getPlaceholder(); } else{ placeholder = child.getPlaceholder(); } SplitDockPathProperty backup = getDockablePathProperty( child ); if( placeholder == null ){ return backup; } return new SplitDockPlaceholderProperty( placeholder, backup ); }
public DockableProperty getDockableProperty( PerspectiveDockable child, PerspectiveDockable target ){ Path placeholder = null; if( target != null ){ placeholder = target.getPlaceholder(); } else{ placeholder = child.getPlaceholder(); } SplitDockPathProperty backup = getDockablePathProperty( child ); if( placeholder == null ){ return backup; } return new SplitDockPlaceholderProperty( placeholder, backup ); }
/** * Creates a {@link SplitDockPlaceholderProperty} for <code>dockable</code>, may * insert an additional placeholder in the tree. * @param dockable the element whose location is searched * @param target hint required to find the placeholder * @return the placeholder or <code>null</code> if the {@link #getPlaceholderStrategy() strategy} * did not assign a placeholder to <code>dockable</code> */ public SplitDockPlaceholderProperty getDockablePlaceholderProperty( Dockable dockable, Dockable target ){ Leaf leaf = getRoot().getLeaf(dockable); if( leaf == null ) { throw new IllegalArgumentException("dockable not known to this station"); } Path placeholder = getPlaceholderStrategy().getPlaceholderFor(target == null ? dockable : target); if( placeholder == null ) { return null; } placeholderSet.set(leaf, placeholder); return new SplitDockPlaceholderProperty(placeholder, getDockablePathProperty(dockable)); }
/** * Creates a {@link SplitDockPlaceholderProperty} for <code>dockable</code>, may * insert an additional placeholder in the tree. * @param dockable the element whose location is searched * @param target hint required to find the placeholder * @return the placeholder or <code>null</code> if the {@link #getPlaceholderStrategy() strategy} * did not assign a placeholder to <code>dockable</code> */ public SplitDockPlaceholderProperty getDockablePlaceholderProperty( Dockable dockable, Dockable target ){ Leaf leaf = getRoot().getLeaf(dockable); if( leaf == null ) { throw new IllegalArgumentException("dockable not known to this station"); } Path placeholder = getPlaceholderStrategy().getPlaceholderFor(target == null ? dockable : target); if( placeholder == null ) { return null; } placeholderSet.set(leaf, placeholder); return new SplitDockPlaceholderProperty(placeholder, getDockablePathProperty(dockable)); }
Path placeholder = info.getPlaceholder(); if( placeholder != null ){ info.setLocation( new SplitDockPlaceholderProperty( placeholder, property ) ); placeholder = subInfo.getPlaceholder(); if( placeholder != null ){ subInfo.setLocation( new SplitDockPlaceholderProperty( placeholder, property ) );