/** * Tells whether the frame or dialog <code>window</code> is in fullscreen mode. * @param wrapper the wrapper around <code>window</code> * @param window the window to check * @return the current mode */ public boolean isFullscreen( ScreenDockWindow wrapper, Window window ){ if( wrapper.getNormalBounds() == null ){ return false; } GraphicsEnvironment environment = GraphicsEnvironment.getLocalGraphicsEnvironment(); Rectangle current = window.getBounds(); current = new Rectangle( current.x - 1, current.y - 1, current.width + 2, current.height + 2 ); for( GraphicsDevice device : environment.getScreenDevices() ){ Rectangle fullscreen = getAvailableBounds( device.getDefaultConfiguration() ); if( current.contains( fullscreen ) ){ return true; } } return false; }
/** * 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; } }
public void setFullscreen( ScreenDockWindow window, boolean fullscreen ){ if( fullscreen ){ window.setNormalBounds( window.getWindowBounds() ); window.setWindowBounds( new Rectangle( 0, 0, desktop.getWidth(), desktop.getHeight() ) ); } else{ Rectangle bounds = window.getNormalBounds(); if( bounds != null ){ window.setWindowBounds( bounds ); window.setNormalBounds( null ); } } } }
public void setFullscreen( ScreenDockWindow window, boolean fullscreen ){ if( fullscreen ){ window.setNormalBounds( window.getWindowBounds() ); window.setWindowBounds( new Rectangle( 0, 0, desktop.getWidth(), desktop.getHeight() ) ); } else{ Rectangle bounds = window.getNormalBounds(); if( bounds != null ){ window.setWindowBounds( bounds ); window.setNormalBounds( null ); } } } }
/** * 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; }
bounds = window.getNormalBounds();
/** * Sets the fullscreen mode of <code>window</code>. * @param wrapper the wrapper around <code>window</code> * @param window the window whose state is to be changed * @param fullscreen the new state */ public void setFullscreen( ScreenDockWindow wrapper, Window window, boolean fullscreen ){ if( isFullscreen( wrapper, window ) != fullscreen ){ if( fullscreen ){ Rectangle bounds = findBestFullscreenBounds( window ); if( bounds != null ){ wrapper.setNormalBounds( wrapper.getWindowBounds() ); window.setBounds( bounds.x-1, bounds.y-1, bounds.width+2, bounds.height+2 ); } } else{ Rectangle bounds = wrapper.getNormalBounds(); if( bounds != null ){ window.setBounds( bounds ); wrapper.setNormalBounds( null ); } } } }
final int height = insets.top + insets.bottom + preferred.height; Rectangle bounds = window.getNormalBounds(); if (bounds == null){ bounds = window.getWindowBounds();
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 ); }
Rectangle bounds = oldWindow.getNormalBounds(); if( bounds == null ){ bounds = oldWindow.getWindowBounds();