src/java.desktop/share/classes/java/awt/dnd/DropTarget.java

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 1997, 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) 1997, 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
*** 47,56 **** --- 47,59 ---- import javax.swing.Timer; import java.awt.peer.ComponentPeer; import java.awt.peer.LightweightPeer; import java.awt.dnd.peer.DropTargetPeer; + import sun.awt.AWTAccessor; + import sun.awt.AWTAccessor.ComponentAccessor; + /** * The <code>DropTarget</code> is associated * with a <code>Component</code> when that <code>Component</code> * wishes
*** 497,515 **** * * @param peer The Peer of the Component we are associated with! * */ - @SuppressWarnings("deprecation") public void addNotify(ComponentPeer peer) { if (peer == componentPeer) return; componentPeer = peer; for (Component c = component; c != null && peer instanceof LightweightPeer; c = c.getParent()) { ! peer = c.getPeer(); } if (peer instanceof DropTargetPeer) { nativePeer = peer; ((DropTargetPeer)peer).addDropTarget(this); --- 500,518 ---- * * @param peer The Peer of the Component we are associated with! * */ public void addNotify(ComponentPeer peer) { if (peer == componentPeer) return; componentPeer = peer; + final ComponentAccessor acc = AWTAccessor.getComponentAccessor(); for (Component c = component; c != null && peer instanceof LightweightPeer; c = c.getParent()) { ! peer = acc.getPeer(c); } if (peer instanceof DropTargetPeer) { nativePeer = peer; ((DropTargetPeer)peer).addDropTarget(this);