/** * Tells whether <code>dockable</code> is currently shown in fullscreen mode. * @param dockable the element to check * @return the mode * @throws IllegalArgumentException if <code>dockable</code> is not known */ public boolean isFullscreen( Dockable dockable ){ ScreenDockWindow window = getWindow( dockable ); if( window == null ){ throw new IllegalArgumentException( "dockable is not known to this station" ); } return window.isFullscreen(); }
/** * 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() ] ); }
/** * Gets the current normal bounds of the window represented by this handle. * @return the boundaries, not <code>null</code> */ public Rectangle getBounds(){ Rectangle result = null; if( window != null ){ if( window.isFullscreen() ){ result = window.getNormalBounds(); } if( result == null ){ result = window.getWindowBounds(); } } return result; } }
/** * Drops <code>dockable</code> at the same coordinates as <code>location</code>, a * direct child of this station. * @param dockable a new dockable * @param location a known dockable * @return whether the operation completed */ public boolean drop( Dockable dockable, Dockable location ){ boolean accept = accept( dockable ) && dockable.accept( this ); if( !accept ){ return false; } ScreenDockWindow window = getWindow( location ); if( window == null ){ throw new IllegalArgumentException( "location is now known to this station" ); } Rectangle bounds = null; if( window.isFullscreen() ){ bounds = window.getNormalBounds(); } if( bounds == null ){ bounds = window.getWindowBounds(); } addDockable( dockable, bounds, true ); return true; }
@Override protected void valueChanged( ScreenDockFullscreenStrategy oldValue, ScreenDockFullscreenStrategy newValue ) { List<ScreenDockWindow> fullscreenWindows = new ArrayList<ScreenDockWindow>(); for( ScreenDockWindowHandle handle : dockables.dockables() ){ ScreenDockWindow window = handle.getWindow(); if( window.isFullscreen() ){ fullscreenWindows.add( window ); window.setFullscreen( false ); } } if( oldValue != null ){ oldValue.uninstall( ScreenDockStation.this ); } if( newValue != null ){ newValue.install( ScreenDockStation.this ); } for( ScreenDockWindowHandle window : dockables.dockables() ){ window.getWindow().setFullscreenStrategy( newValue ); } for( ScreenDockWindow window : fullscreenWindows ){ window.setFullscreen( true ); } } };
private void handleMousePressed( MouseEvent e ){ if( !e.isConsumed() && !window.isFullscreen() ){ int buttons = MouseEvent.BUTTON1_DOWN_MASK | MouseEvent.BUTTON2_DOWN_MASK | MouseEvent.BUTTON3_DOWN_MASK; buttons &= e.getModifiersEx();
private void handleMousePressed( MouseEvent e ){ if( !e.isConsumed() && !window.isFullscreen() ){ int buttons = MouseEvent.BUTTON1_DOWN_MASK | MouseEvent.BUTTON2_DOWN_MASK | MouseEvent.BUTTON3_DOWN_MASK; buttons &= e.getModifiersEx();
boolean fullscreen = window.isFullscreen();
if (window.isFullscreen()){ window.setNormalBounds(bounds); } else{
private void saveLocation( int index ){ ScreenDockWindow window = dockables.dockables().get( index ).getWindow(); PlaceholderMetaMap map = dockables.dockables().getMetaMap( index ); Rectangle bounds = null; if( window.isFullscreen() ){ bounds = window.getNormalBounds(); } if( bounds == null ){ bounds = window.getWindowBounds(); } map.putInt( "x", bounds.x ); map.putInt( "y", bounds.y ); map.putInt( "width", bounds.width ); map.putInt( "height", bounds.height ); }
@Override public ConvertedPlaceholderListItem convert( int index, ScreenDockWindowHandle dockable ) { Integer id = children.get( dockable.asDockable() ); if( id == null ){ return null; } saveLocation( index ); ConvertedPlaceholderListItem item = new ConvertedPlaceholderListItem(); Rectangle bounds = dockable.getBounds(); item.putInt( "id", id ); item.putInt( "x", bounds.x ); item.putInt( "y", bounds.y ); item.putInt( "width", bounds.width ); item.putInt( "height", bounds.height ); item.putBoolean( "fullscreen", dockable.getWindow().isFullscreen() ); if( strategy != null ){ Path placeholder = strategy.getPlaceholderFor( dockable.asDockable() ); if( placeholder != null ){ item.putString( "placeholder", placeholder.toString() ); item.setPlaceholder( placeholder ); } } return item; } });
bounds = oldWindow.getWindowBounds(); boolean fullscreen = oldWindow.isFullscreen(); boolean visible = oldWindow.isVisible();
for( ScreenDockWindowHandle handle : dockables.dockables() ){ ScreenDockWindow window = handle.getWindow(); if( !window.isFullscreen() ){ Rectangle bounds = window.getWindowBounds(); double windowSize = bounds.width * bounds.height;