@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 insert( SplitDockPathProperty property, int depth, Dockable dockable ) { if( child == null ){ long id = property.getLeafId(); Leaf leaf = create( dockable, id ); if( leaf == null ) return false; setChild( leaf ); leaf.setDockable( dockable, null ); return true; } else return child.insert( property, depth, dockable ); }
/** * Tries to insert <code>dockable</code> at a location such that the path * to that location is the same as described in <code>property</code>. * @param dockable the element to insert * @param property the preferred path to the element * @return <code>true</code> if the element was successfully inserted */ public boolean drop( Dockable dockable, SplitDockPathProperty property ){ try{ access.arm(); DockUtilities.checkLayoutLocked(); // use the ids of the topmost nodes in the path to find a node of this station Tuple<Integer, SplitNode> startNode = getLowestNode( property ); int index = startNode.getA(); SplitNode start = startNode.getB(); updateBounds(); boolean done = start.insert(property, index, dockable); if( done ) revalidate(); return done; } finally{ access.fire(); } }
/** * Tries to insert <code>dockable</code> at a location such that the path * to that location is the same as described in <code>property</code>. * @param dockable the element to insert * @param property the preferred path to the element * @return <code>true</code> if the element was successfully inserted */ public boolean drop( Dockable dockable, SplitDockPathProperty property ){ try{ access.arm(); DockUtilities.checkLayoutLocked(); // use the ids of the topmost nodes in the path to find a node of this station Tuple<Integer, SplitNode> startNode = getLowestNode( property ); int index = startNode.getA(); SplitNode start = startNode.getB(); updateBounds(); boolean done = start.insert(property, index, dockable); if( done ) revalidate(); return done; } finally{ access.fire(); } }