@Override public Leaf getLeaf( Dockable dockable ) { Dockable mine = getDockable(); if( mine != null && dockable == getDockable() ){ return this; } else{ return null; } }
@Override protected Dockable getDockable( SplitNode leaf ){ return ((Leaf)leaf).getDockable(); }
@Override protected Dockable getDockable( SplitNode leaf ){ return ((Leaf)leaf).getDockable(); }
public void handleLeaf( Leaf leaf ){ Dockable dockable = leaf.getDockable(); if( dockable != null ){ repositioned.add( dockable ); } } });
public void handleLeaf( Leaf leaf ){ Dockable dockable = leaf.getDockable(); if( dockable != null ){ repositioned.add( dockable ); } } });
@Override public void handleLeaf( Leaf leaf ) { if( leaf.hasPlaceholder( placeholder )){ result = leaf.getDockable(); } }
public void handleLeaf( Leaf leaf ){ if( leaf != node ){ handle( leaf ); handle( leaf.getDockable() ); } }
public void handleLeaf( Leaf leaf ){ if( leaf != node ){ handle( leaf ); handle( leaf.getDockable() ); } }
/** * Creates a new object * @param info information about the current position of the mouse and of * what is under the mouse * @param station the creator of this source * @param mouseOnStation position of the mouse in relation to <code>station</code> * @throws IllegalArgumentException if the target not of <code>info</code> is not a {@link Leaf} */ public SplitDockCombinerSource( PutInfo info, SplitDockStation station, Point mouseOnStation ){ if( !(info.getNode() instanceof Leaf) ){ throw new IllegalArgumentException( "info is not available for a combination" ); } this.info = info; this.station = station; this.mouse = mouseOnStation; old = getLeaf().getDockable(); if( old == null ){ throw new IllegalArgumentException( "old Dockable is null" ); } }
/** * Creates a new object * @param info information about the current position of the mouse and of * what is under the mouse * @param station the creator of this source * @param mouseOnStation position of the mouse in relation to <code>station</code> * @throws IllegalArgumentException if the target not of <code>info</code> is not a {@link Leaf} */ public SplitDockCombinerSource( PutInfo info, SplitDockStation station, Point mouseOnStation ){ if( !(info.getNode() instanceof Leaf) ){ throw new IllegalArgumentException( "info is not available for a combination" ); } this.info = info; this.station = station; this.mouse = mouseOnStation; old = getLeaf().getDockable(); if( old == null ){ throw new IllegalArgumentException( "old Dockable is null" ); } }
@Override public <N> N submit( SplitTreeFactory<N> factory ){ PlaceholderMap map = getPlaceholderMap(); if( map == null ){ Dockable dockable = getDockable(); if( dockable != null ){ DockStation station = dockable.asDockStation(); if( station != null ){ map = station.getPlaceholders(); } } } return factory.leaf( getDockable(), getId(), getPlaceholders(), map ); }
@Override public void handleLeaf( Leaf leaf ){ Dimension preferredSize = getPreferredSize( leaf ); if( preferredSize != null ){ int size; int preferred; if( side().getHeaderOrientation() == Orientation.HORIZONTAL ){ size = leaf.getSize().height; preferred = preferredSize.height; } else{ size = leaf.getSize().width; preferred = preferredSize.width; } leafs.put( leaf.getDockable(), new PersistentCell( size, preferred )); } } } );
@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; }
public PutInfo validatePutInfo( SplitDockStation station, PutInfo putInfo ){ if( putInfo != null ){ if( !station.accept( putInfo.getDockable() )) return null; if( putInfo.getNode() != null && (putInfo.getPut() == PutInfo.Put.CENTER || putInfo.getPut() == PutInfo.Put.TITLE )){ if( !putInfo.getDockable().accept( station, ((Leaf)putInfo.getNode()).getDockable() ) || !((Leaf)putInfo.getNode()).getDockable().accept( station, putInfo.getDockable() ) || !station.getController().getAcceptance().accept( station, ((Leaf)putInfo.getNode()).getDockable(), putInfo.getDockable() )){ return null; } } else{ if( !putInfo.getDockable().accept( station ) || !station.getController().getAcceptance().accept( station, putInfo.getDockable() )){ return null; } } } return putInfo; }
public PutInfo validatePutInfo( SplitDockStation station, PutInfo putInfo ){ if( putInfo != null ){ if( !station.accept( putInfo.getDockable() )) return null; if( putInfo.getNode() != null && (putInfo.getPut() == PutInfo.Put.CENTER || putInfo.getPut() == PutInfo.Put.TITLE )){ if( !putInfo.getDockable().accept( station, ((Leaf)putInfo.getNode()).getDockable() ) || !((Leaf)putInfo.getNode()).getDockable().accept( station, putInfo.getDockable() ) || !station.getController().getAcceptance().accept( station, ((Leaf)putInfo.getNode()).getDockable(), putInfo.getDockable() )){ return null; } } else{ if( !putInfo.getDockable().accept( station ) || !station.getController().getAcceptance().accept( station, putInfo.getDockable() )){ return null; } } } return putInfo; }
@Override public boolean aside( SplitDockPathProperty property, int index, AsideRequest request ){ if( request.getPlaceholder() != null ){ if( index < property.size() ){ DockStation station = getDockable().asDockStation(); if( station == null ){ Placeholder placeholder = createPlaceholder( property.getLeafId() ); split( property, index, placeholder ); return placeholder.aside( request ); } } else{ return aside( request ); } } return true; }
@Override public RequestDimension prepareResize( Leaf leaf ) { RequestDimension request = getAndClearResizeRequest( leaf.getDockable() ); if( request != null ){ Insets insets = leaf.getDisplayer().getDockableInsets(); if( request.isWidthSet() ) request.setWidth( request.getWidth() + insets.left + insets.right ); if( request.isHeightSet() ) request.setHeight( request.getHeight() + insets.top + insets.bottom ); return request; } return super.prepareResize( leaf ); } }
@Override public RequestDimension prepareResize( Leaf leaf ) { RequestDimension request = getAndClearResizeRequest( leaf.getDockable() ); if( request != null ){ Insets insets = leaf.getDisplayer().getDockableInsets(); if( request.isWidthSet() ) request.setWidth( request.getWidth() + insets.left + insets.right ); if( request.isHeightSet() ) request.setHeight( request.getHeight() + insets.top + insets.bottom ); return request; } return super.prepareResize( leaf ); } }
@Override public boolean aside( AsideRequest request ){ if( request.getPlaceholder() != null ){ addPlaceholder( request.getPlaceholder() ); DockStation station = getDockable().asDockStation(); if( station == null ){ AsideAnswer answer = request.forward( getStation().getCombiner(), getPlaceholderMap() ); if( answer.isCanceled() ){ return false; } setPlaceholderMap( answer.getLayout() ); } else{ AsideAnswer answer = request.forward( station ); if( answer.isCanceled() ){ return false; } } } return true; }