src/java.desktop/windows/classes/sun/awt/windows/WComponentPeer.java

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this --- 1,7 ---- /* ! * Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this
*** 567,587 **** // fallback default font object final static Font defaultFont = new Font(Font.DIALOG, Font.PLAIN, 12); @Override - @SuppressWarnings("deprecation") public Graphics getGraphics() { if (isDisposed()) { return null; } Component target = (Component)getTarget(); Window window = SunToolkit.getContainingWindow(target); if (window != null) { ! Graphics g = ! ((WWindowPeer)window.getPeer()).getTranslucentGraphics(); // getTranslucentGraphics() returns non-null value for non-opaque windows only if (g != null) { // Non-opaque windows do not support heavyweight children. // Redirect all painting to the Window's Graphics instead. // The caller is responsible for calling the --- 567,587 ---- // fallback default font object final static Font defaultFont = new Font(Font.DIALOG, Font.PLAIN, 12); @Override public Graphics getGraphics() { if (isDisposed()) { return null; } Component target = (Component)getTarget(); Window window = SunToolkit.getContainingWindow(target); if (window != null) { ! final WWindowPeer wpeer = AWTAccessor.getComponentAccessor() ! .getPeer(window); ! Graphics g = wpeer.getTranslucentGraphics(); // getTranslucentGraphics() returns non-null value for non-opaque windows only if (g != null) { // Non-opaque windows do not support heavyweight children. // Redirect all painting to the Window's Graphics instead. // The caller is responsible for calling the
*** 683,693 **** WGlobalCursorManager.getCursorManager().updateCursorImmediately(); } // TODO: consider moving it to KeyboardFocusManagerPeerImpl @Override - @SuppressWarnings("deprecation") public boolean requestFocus(Component lightweightChild, boolean temporary, boolean focusedWindowChangeAllowed, long time, CausedFocusEvent.Cause cause) { if (WKeyboardFocusManagerPeer. --- 683,692 ----
*** 711,721 **** } Window parentWindow = SunToolkit.getContainingWindow((Component)target); if (parentWindow == null) { return rejectFocusRequestHelper("WARNING: Parent window is null"); } ! WWindowPeer wpeer = (WWindowPeer)parentWindow.getPeer(); if (wpeer == null) { return rejectFocusRequestHelper("WARNING: Parent window's peer is null"); } boolean res = wpeer.requestWindowFocus(cause); --- 710,721 ---- } Window parentWindow = SunToolkit.getContainingWindow((Component)target); if (parentWindow == null) { return rejectFocusRequestHelper("WARNING: Parent window is null"); } ! final WWindowPeer wpeer = AWTAccessor.getComponentAccessor() ! .getPeer(parentWindow); if (wpeer == null) { return rejectFocusRequestHelper("WARNING: Parent window's peer is null"); } boolean res = wpeer.requestWindowFocus(cause);
*** 1102,1128 **** // REMIND: Temp workaround for issues with using HW acceleration // in the browser on Vista when DWM is enabled. // @return true if the toplevel container is not an EmbeddedFrame or // if this EmbeddedFrame is acceleration capable, false otherwise - @SuppressWarnings("deprecation") private static final boolean isContainingTopLevelAccelCapable(Component c) { while (c != null && !(c instanceof WEmbeddedFrame)) { c = c.getParent(); } if (c == null) { return true; } ! return ((WEmbeddedFramePeer)c.getPeer()).isAccelCapable(); } /** * Applies the shape to the native component window. * @since 1.7 */ @Override - @SuppressWarnings("deprecation") public void applyShape(Region shape) { if (shapeLog.isLoggable(PlatformLogger.Level.FINER)) { shapeLog.finer("*** INFO: Setting shape: PEER: " + this + "; TARGET: " + target + "; SHAPE: " + shape); --- 1102,1128 ---- // REMIND: Temp workaround for issues with using HW acceleration // in the browser on Vista when DWM is enabled. // @return true if the toplevel container is not an EmbeddedFrame or // if this EmbeddedFrame is acceleration capable, false otherwise private static final boolean isContainingTopLevelAccelCapable(Component c) { while (c != null && !(c instanceof WEmbeddedFrame)) { c = c.getParent(); } if (c == null) { return true; } ! final WEmbeddedFramePeer peer = AWTAccessor.getComponentAccessor() ! .getPeer(c); ! return peer.isAccelCapable(); } /** * Applies the shape to the native component window. * @since 1.7 */ @Override public void applyShape(Region shape) { if (shapeLog.isLoggable(PlatformLogger.Level.FINER)) { shapeLog.finer("*** INFO: Setting shape: PEER: " + this + "; TARGET: " + target + "; SHAPE: " + shape);