src/java.desktop/unix/classes/sun/awt/X11/XWindow.java

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 2002, 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) 2002, 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
*** 32,41 **** --- 32,42 ---- import java.lang.ref.WeakReference; import java.lang.reflect.Method; + import sun.awt.AWTAccessor.ComponentAccessor; import sun.util.logging.PlatformLogger; import sun.awt.*; import sun.awt.image.PixelConverter;
*** 280,317 **** boolean isReparented() { return reparented; } - @SuppressWarnings("deprecation") static long getParentWindowID(Component target) { - ComponentPeer peer = target.getParent().getPeer(); Component temp = target.getParent(); while (!(peer instanceof XWindow)) { temp = temp.getParent(); ! peer = temp.getPeer(); } if (peer != null && peer instanceof XWindow) return ((XWindow)peer).getContentWindow(); else return 0; } - @SuppressWarnings("deprecation") static XWindow getParentXWindowObject(Component target) { if (target == null) return null; Component temp = target.getParent(); if (temp == null) return null; ! ComponentPeer peer = temp.getPeer(); if (peer == null) return null; while ((peer != null) && !(peer instanceof XWindow)) { temp = temp.getParent(); ! peer = temp.getPeer(); } if (peer != null && peer instanceof XWindow) return (XWindow) peer; else return null; } --- 281,318 ---- boolean isReparented() { return reparented; } static long getParentWindowID(Component target) { Component temp = target.getParent(); + final ComponentAccessor acc = AWTAccessor.getComponentAccessor(); + ComponentPeer peer = acc.getPeer(temp); while (!(peer instanceof XWindow)) { temp = temp.getParent(); ! peer = acc.getPeer(temp); } if (peer != null && peer instanceof XWindow) return ((XWindow)peer).getContentWindow(); else return 0; } static XWindow getParentXWindowObject(Component target) { if (target == null) return null; Component temp = target.getParent(); if (temp == null) return null; ! final ComponentAccessor acc = AWTAccessor.getComponentAccessor(); ! ComponentPeer peer = acc.getPeer(temp); if (peer == null) return null; while ((peer != null) && !(peer instanceof XWindow)) { temp = temp.getParent(); ! peer = acc.getPeer(temp); } if (peer != null && peer instanceof XWindow) return (XWindow) peer; else return null; }
*** 550,560 **** int y = xe.get_y(); int w = xe.get_width(); int h = xe.get_height(); Component target = getEventSource(); ! AWTAccessor.ComponentAccessor compAccessor = AWTAccessor.getComponentAccessor(); if (!compAccessor.getIgnoreRepaint(target) && compAccessor.getWidth(target) != 0 && compAccessor.getHeight(target) != 0) { --- 551,561 ---- int y = xe.get_y(); int w = xe.get_width(); int h = xe.get_height(); Component target = getEventSource(); ! ComponentAccessor compAccessor = AWTAccessor.getComponentAccessor(); if (!compAccessor.getIgnoreRepaint(target) && compAccessor.getWidth(target) != 0 && compAccessor.getHeight(target) != 0) {