public void execute(){ access.unsetDropInfo(); if( isMove() ){ access.move( putInfo, item ); } else{ access.drop( null, putInfo, item ); } }
/** * Gets the station this node belongs to. * @return the station */ public SplitDockStation getStation(){ return access.getOwner(); }
public void destroy( StationDropOperation next ){ if( access.getOwner().getDropInfo() == putInfo ){ access.setDropInfo( null ); if( next == null || !(next instanceof SplitDropOperation) || next.getTarget() != getTarget() ){ access.unsetDropInfo(); } } }
public void setDivider( double divider ){ if( this.divider != divider ){ this.divider = divider; getAccess().getOwner().revalidate(); getAccess().getOwner().repaint(); getAccess().repositioned( this ); } }
final List<SplitNode> nodesToDelete = new ArrayList<SplitNode>(); Root root = access.getOwner().getRoot(); root.visit( new SplitNodeVisitor() { public void handleRoot( Root root ){ if( access.isTreeAutoCleanupEnabled() ){ for( SplitNode protectedNode : protectedNodes ){ nodesToDelete.remove( protectedNode );
if( station != null && stationLocation != null ){ if( dockable.accept( station ) && station.accept( dockable )){ DockController controller = getAccess().getOwner().getController(); DockAcceptance acceptance = controller == null ? null : controller.getAcceptance(); if( acceptance == null || acceptance.accept( station, dockable )){ boolean done = station.drop( dockable, stationLocation ); if( done ){ getAccess().getPlaceholderSet().set( null, placeholder, this ); return true; boolean done = getAccess().drop( dockable, selfLocation, this ); if( done ){ removePlaceholder( placeholder );
if( handle != null ){ if( updatePlaceholders ){ getAccess().getPlaceholderSet().set( this, handle.getDockable() ); getAccess().removeHandle( handle, token ); handle = null; handle = getAccess().newHandle( dockable ); getAccess().getPlaceholderSet().set( this, dockable ); getAccess().addHandle( handle, token );
if( station != null && stationLocation != null ){ if( dockable.accept( station ) && station.accept( dockable )){ DockController controller = getAccess().getOwner().getController(); DockAcceptance acceptance = controller == null ? null : controller.getAcceptance(); if( acceptance == null || acceptance.accept( station, dockable )){ return getAccess().drop( dockable, property.toLocation( this ), this );
/** * Creates or re-creates the {@link Span}s used by this {@link Leaf}. This method should not be called * by clients. */ @FrameworkOnly public void createSpans(){ spans = getAccess().getSpanStrategy().createSpans( this ); }
/** * Sets information about the placeholders of a {@link DockStation} that was * child of this node. * @param placeholderMap the placeholder information, can be <code>null</code> */ public void setPlaceholderMap( PlaceholderMap placeholderMap ){ if( this.placeholderMap != null ){ this.placeholderMap.setPlaceholderStrategy( null ); } this.placeholderMap = placeholderMap; if( this.placeholderMap != null ){ this.placeholderMap.setPlaceholderStrategy( getAccess().getOwner().getPlaceholderStrategy() ); getAccess().getPlaceholderSet().removeDoublePlaceholders( this, placeholderMap ); } }
/** * Resets the boundaries of the {@link DockableDisplayer} of this {@link Leaf}, using the current {@link Span}s * as well. */ public void resetDisplayerBounds(){ DockableDisplayer displayer = getDisplayer(); StationChildHandle fullscreen = getAccess().getFullScreenDockable(); if( displayer != null && (fullscreen == null || displayer != fullscreen.getDisplayer() )){ Rectangle bounds = getBounds(); bounds = getAccess().getSpanStrategy().modifyBounds( bounds, this ); Component component = displayer.getComponent(); component.setBounds( bounds ); if( component instanceof JComponent ){ ((JComponent)component).revalidate(); } } }
@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; }
@Override public boolean isOfUse(){ if( !getAccess().isTreeAutoCleanupEnabled() ){ return true; } return handle != null || hasPlaceholders(); }
public void draw(){ access.setDropInfo( putInfo ); }
/** * Creates a new {@link Leaf} * @param id the unique identifier of the new leaf, can be -1 * @return the new leaf */ public Leaf createLeaf( long id ){ return access.createLeaf( id ); }
/** * Creates a new {@link Node}. * @param id the unique identifier of the new node, can be -1 * @return the new node */ public Node createNode( long id ){ return access.createNode( id ); }
/** * Sets the left child of this node. The area of this child * will be in the left or the upper half of the area of this node.<br> * Note that setting the child to <code>null</code> does not delete * the child from the system, only a call to {@link SplitNode#delete(boolean)} * does that. * @param left the left child or <code>null</code> */ public void setLeft( SplitNode left ){ if( this.left != null ) this.left.setParent( null ); this.left = left; clearVisibility(); if( left != null ){ left.setParent( this ); } treeChanged(); if( left != null ){ ensureIdUniqueAsync(); } getAccess().getOwner().revalidate(); getAccess().getOwner().repaint(); getAccess().repositioned( this ); }
final List<SplitNode> nodesToDelete = new ArrayList<SplitNode>(); Root root = access.getOwner().getRoot(); root.visit( new SplitNodeVisitor() { public void handleRoot( Root root ){ if( access.isTreeAutoCleanupEnabled() ){ for( SplitNode protectedNode : protectedNodes ){ nodesToDelete.remove( protectedNode );
/** * Creates or re-creates the {@link Span}s used by this {@link Leaf}. This method should not be called * by clients. */ @FrameworkOnly public void createSpans(){ spans = getAccess().getSpanStrategy().createSpans( this ); }
return getAccess().drop( dockable, property.toLocation( this ), this );