279 * @see Component#setVisible 280 * @see Frame#setUndecorated 281 * @see Dialog#setUndecorated 282 * 283 * @since 1.4 284 */ 285 public void setFullScreenWindow(Window w) { 286 if (w != null) { 287 if (w.getShape() != null) { 288 w.setShape(null); 289 } 290 if (w.getOpacity() < 1.0f) { 291 w.setOpacity(1.0f); 292 } 293 if (!w.isOpaque()) { 294 Color bgColor = w.getBackground(); 295 bgColor = new Color(bgColor.getRed(), bgColor.getGreen(), 296 bgColor.getBlue(), 255); 297 w.setBackground(bgColor); 298 } 299 } 300 if (fullScreenWindow != null && windowedModeBounds != null) { 301 // if the window went into fs mode before it was realized it may 302 // have (0,0) dimensions 303 if (windowedModeBounds.width == 0) windowedModeBounds.width = 1; 304 if (windowedModeBounds.height == 0) windowedModeBounds.height = 1; 305 fullScreenWindow.setBounds(windowedModeBounds); 306 } 307 // Set the full screen window 308 synchronized (fsAppContextLock) { 309 // Associate fullscreen window with current AppContext 310 if (w == null) { 311 fullScreenAppContext = null; 312 } else { 313 fullScreenAppContext = AppContext.getAppContext(); 314 } 315 fullScreenWindow = w; 316 } 317 if (fullScreenWindow != null) { 318 windowedModeBounds = fullScreenWindow.getBounds(); | 279 * @see Component#setVisible 280 * @see Frame#setUndecorated 281 * @see Dialog#setUndecorated 282 * 283 * @since 1.4 284 */ 285 public void setFullScreenWindow(Window w) { 286 if (w != null) { 287 if (w.getShape() != null) { 288 w.setShape(null); 289 } 290 if (w.getOpacity() < 1.0f) { 291 w.setOpacity(1.0f); 292 } 293 if (!w.isOpaque()) { 294 Color bgColor = w.getBackground(); 295 bgColor = new Color(bgColor.getRed(), bgColor.getGreen(), 296 bgColor.getBlue(), 255); 297 w.setBackground(bgColor); 298 } 299 // Check if this window is in fullscreen mode on another device. 300 final GraphicsConfiguration gc = w.getGraphicsConfiguration(); 301 if (gc != null && gc.getDevice() != this 302 && gc.getDevice().getFullScreenWindow() == w) { 303 gc.getDevice().setFullScreenWindow(null); 304 } 305 } 306 if (fullScreenWindow != null && windowedModeBounds != null) { 307 // if the window went into fs mode before it was realized it may 308 // have (0,0) dimensions 309 if (windowedModeBounds.width == 0) windowedModeBounds.width = 1; 310 if (windowedModeBounds.height == 0) windowedModeBounds.height = 1; 311 fullScreenWindow.setBounds(windowedModeBounds); 312 } 313 // Set the full screen window 314 synchronized (fsAppContextLock) { 315 // Associate fullscreen window with current AppContext 316 if (w == null) { 317 fullScreenAppContext = null; 318 } else { 319 fullScreenAppContext = AppContext.getAppContext(); 320 } 321 fullScreenWindow = w; 322 } 323 if (fullScreenWindow != null) { 324 windowedModeBounds = fullScreenWindow.getBounds(); |