public Dockable getFrontDockable() { if( frontWindow == null ) return null; else return frontWindow.getDockable(); }
DockController controller = window.getStation().getController(); if( controller != null ){ relocator = controller.getRelocator().createRemote( window.getDockable() ); relocator.setShowImageWindow( false );
public Dockable getOld(){ return combine.getDockable(); }
public void shapeChanged( ScreenDockWindow window ) { Dockable dockable = window.getDockable(); if( dockable != null ){ listeners.fireDockablesRepositioned( dockable ); } }
public Dimension getSize(){ return combine.getDockable().getComponent().getSize(); }
public boolean beginVisit( Node node, boolean revisit ){ builder.append( node.hashCode() ).append(" '").append( node.getWindow().getDockable().getTitleText() ).append( "' " ); builder.append( node.getConstraints() ).append( "\n" ); depth++; return !revisit; }
public boolean beginVisit( Node node, boolean revisit ){ builder.append( node.hashCode() ).append(" '").append( node.getWindow().getDockable().getTitleText() ).append( "' " ); builder.append( node.getConstraints() ).append( "\n" ); depth++; return !revisit; }
public Point getMousePosition(){ Point point = new Point( x, y ); SwingUtilities.convertPointFromScreen( point, combine.getDockable().getComponent() ); return point; }
/** * Gets a list of all children of this station that are currently in fullscreen mode. * @return a list of children, not <code>null</code> */ public Dockable[] getFullscreenChildren() { List<Dockable> result = new ArrayList<Dockable>(); for( ScreenDockWindowHandle handle : dockables.dockables() ){ ScreenDockWindow window = handle.getWindow(); if( window.isFullscreen() ){ result.add( window.getDockable() ); } } return result.toArray( new Dockable[ result.size() ] ); }
public void fullscreenStateChanged( ScreenDockWindow window ) { Dockable dockable = window.getDockable(); if( dockable != null ){ for( ScreenDockStationListener listener : screenDockStationListeners() ){ listener.fullscreenChanged( ScreenDockStation.this, dockable ); } } }
/** * Gets all the {@link ScreenDockWindow}s of the {@link #getStation() station} that are attracted to <code>window</code>. * @param window the window that has moved and whose partners are searched * @return all the partner windows, may be empty, is never <code>null</code>, does not contain <code>window</code> */ public ScreenDockWindow[] getAttracted( ScreenDockWindow window ){ List<ScreenDockWindow> result = new ArrayList<ScreenDockWindow>(); int count = station.getDockableCount(); for( int i = 0; i < count; i++ ){ ScreenDockWindow next = station.getWindow( i ); if( next != window ){ Attraction attraction = getAttraction( window.getDockable(), next.getDockable() ); switch( attraction ){ case STRONGLY_ATTRACTED: case ATTRACTED: result.add( next ); break; } } } return result.toArray( new ScreenDockWindow[ result.size() ] ); }
/** * Gets all the {@link ScreenDockWindow}s of the {@link #getStation() station} that are attracted to <code>window</code>. * @param window the window that has moved and whose partners are searched * @return all the partner windows, may be empty, is never <code>null</code>, does not contain <code>window</code> */ public ScreenDockWindow[] getAttracted( ScreenDockWindow window ){ List<ScreenDockWindow> result = new ArrayList<ScreenDockWindow>(); int count = station.getDockableCount(); for( int i = 0; i < count; i++ ){ ScreenDockWindow next = station.getWindow( i ); if( next != window ){ Attraction attraction = getAttraction( window.getDockable(), next.getDockable() ); switch( attraction ){ case STRONGLY_ATTRACTED: case ATTRACTED: result.add( next ); break; } } } return result.toArray( new ScreenDockWindow[ result.size() ] ); }
public void closing( ScreenDockWindow window ){ CDockable dockable = CDockUtilities.getFirstDockable( window.getDockable() ); if( dockable != null ){ if( dockable.isNormalizeable() ){ dockable.setExtendedMode( ExtendedMode.NORMALIZED ); } } } }
public void closing( ScreenDockWindow window ){ CDockable dockable = CDockUtilities.getFirstDockable( window.getDockable() ); if( dockable != null ){ if( dockable.isNormalizeable() ){ dockable.setExtendedMode( ExtendedMode.NORMALIZED ); } } } }
/** * Ensures that the desired location where to insert the next child is valid. * @param dropInfo information about the element to drop * @return <code>true</code> if <code>dropInfo</code> is valid, <code>false</code> otherwise */ private boolean checkDropInfo( DropInfo dropInfo ){ if( dropInfo.combine != null ){ if( !accept( dropInfo.dockable ) || !dropInfo.dockable.accept( this, dropInfo.combine.getDockable() ) || !dropInfo.combine.getDockable().accept( this, dropInfo.dockable ) || !getController().getAcceptance().accept( this, dropInfo.combine.getDockable(), dropInfo.dockable )){ return false; } } else{ if( !accept( dropInfo.dockable ) || !dropInfo.dockable.accept( this ) || !getController().getAcceptance().accept( this, dropInfo.dockable )){ return false; } } return true; }
@Override protected Shape getShape(){ if( station == null ){ Dockable dockable = getCallback().getWindow().getDockable(); if( dockable instanceof ToolbarGroupDockStation ){ install( (ToolbarGroupDockStation)dockable ); } } if( station == null ){ return null; } Area area = new Area(); addBorder( area ); addChildren( area ); addExpanded( area ); return area; }
private DockablePlaceholderList<ScreenDockWindowHandle>.Item getItem( ScreenDockProperty property ){ Path oldPlaceholder = property.getPlaceholder(); if( oldPlaceholder != null ){ DockablePlaceholderList<ScreenDockWindowHandle>.Item item = dockables.getItem( oldPlaceholder ); if( item != null ){ return item; } } ScreenDockStationExtension.DropArguments args = new ScreenDockStationExtension.DropArguments(); args.setProperty( property ); args.setBoundsIncludeWindow( true ); windowAt( args ); ScreenDockWindow window = args.getWindow(); if( window != null ){ return dockables.getItem( window.getDockable() ); } return null; }
if( dropInfo.combine != null && dropInfo.combine.getDockable() == dropInfo.dockable ) dropInfo.combine = null;
/** * Removes the <code>index</code>'th {@link Dockable} of this station.<br> * Note: clients may need to invoke {@link DockController#freezeLayout()} * and {@link DockController#meltLayout()} to ensure no-one else adds or * removes <code>Dockable</code>s. * @param index the index of the {@link Dockable} to remove */ public void removeDockable( int index ){ DockUtilities.checkLayoutLocked(); ScreenDockWindowHandle handle = getWindowHandle( index ); ScreenDockWindow window = handle.getWindow(); Dockable dockable = window.getDockable(); DockHierarchyLock.Token token = DockHierarchyLock.acquireUnlinking( this, dockable ); try{ listeners.fireDockableRemoving( dockable ); window.setVisible( false ); deregister( dockable, window ); handle.setDockable( null ); dockable.setDockParent( null ); listeners.fireDockableRemoved( dockable ); } finally{ token.release(); } }
/** * Invoked when a {@link ScreenDockWindow} is no longer needed. This * method removes some listeners from the window. If overridden * by a subclass, the subclass should ensure that this implementation * is invoked too. * @param dockable the element for which <code>window</code> was used * @param window the old window */ protected void deregister( Dockable dockable, ScreenDockWindow window ){ if( frontWindow == window ) frontWindow = null; int index = indexOf( window.getDockable() ); saveLocation( index ); dockables.remove( index ); getRootHandler().removeRoot( window.getComponent() ); window.setDockable( null ); window.setPaintCombining( null ); window.setController( null ); window.setFullscreenStrategy( null ); for( ScreenDockStationListener listener : screenDockStationListeners() ){ listener.windowDeregistering( this, dockable, window ); } window.destroy(); }