@Override protected Rectangle checkSize( ScreenDockWindow window, Rectangle target ){ GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); GraphicsDevice[] screens = ge.getScreenDevices(); int x = target.x; int y = target.y; int width = target.width; int height = target.height; double fit = -1.0; GraphicsDevice best = null; for( GraphicsDevice screen : screens ){ double check = measureBounds( window, x, y, width, height, screen ); if( check > fit ){ fit = check; best = screen; } } if( best == null ) return null; else return boundsInDevice( window, x, y, width, height, best ); }
@Override protected Rectangle checkSize( ScreenDockWindow window ){ return checkSize( window, window.getWindowBounds() ); }
@Override protected Rectangle checkSize( ScreenDockWindow window, Rectangle target ){ GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); GraphicsDevice[] screens = ge.getScreenDevices(); int x = target.x; int y = target.y; int width = target.width; int height = target.height; double fit = -1.0; GraphicsDevice best = null; for( GraphicsDevice screen : screens ){ double check = measureBounds( window, x, y, width, height, screen ); if( check > fit ){ fit = check; best = screen; } } if( best == null ) return null; else return boundsInDevice( window, x, y, width, height, best ); }
@Override protected Rectangle checkSize( ScreenDockWindow window ){ return checkSize( window, window.getWindowBounds() ); }