jdk/test/java/awt/Mixing/AWT_Mixing/OverlappingTestBase.java
changeset 30469 bac0a7ff7e1e
parent 28087 622b2f420bc3
child 36511 9d0388c6b336
equal deleted inserted replaced
30468:a016d2637922 30469:bac0a7ff7e1e
     1 /*
     1 /*
     2  * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    27 import java.lang.reflect.Constructor;
    27 import java.lang.reflect.Constructor;
    28 import java.lang.reflect.InvocationTargetException;
    28 import java.lang.reflect.InvocationTargetException;
    29 import java.lang.reflect.Method;
    29 import java.lang.reflect.Method;
    30 import java.util.ArrayList;
    30 import java.util.ArrayList;
    31 import javax.swing.*;
    31 import javax.swing.*;
       
    32 
       
    33 import sun.awt.AWTAccessor;
    32 import sun.awt.EmbeddedFrame;
    34 import sun.awt.EmbeddedFrame;
    33 import java.io.*;
    35 import java.io.*;
    34 import test.java.awt.regtesthelpers.Util;
    36 import test.java.awt.regtesthelpers.Util;
    35 
    37 
    36 /**
    38 /**
   241                 long frameWindow = 0;
   243                 long frameWindow = 0;
   242                 String getWindowMethodName = "getHWnd";
   244                 String getWindowMethodName = "getHWnd";
   243                 if (Toolkit.getDefaultToolkit().getClass().getName().contains("XToolkit")) {
   245                 if (Toolkit.getDefaultToolkit().getClass().getName().contains("XToolkit")) {
   244                     getWindowMethodName = "getWindow";
   246                     getWindowMethodName = "getWindow";
   245                 }
   247                 }
   246                 ComponentPeer peer = embedder.getPeer();
   248                 ComponentPeer peer = AWTAccessor.getComponentAccessor()
   247 //                System.err.println("Peer: " + peer);
   249                                                 .getPeer(embedder);
       
   250                 //  System.err.println("Peer: " + peer);
   248                 Method getWindowMethod = peer.getClass().getMethod(getWindowMethodName);
   251                 Method getWindowMethod = peer.getClass().getMethod(getWindowMethodName);
   249                 frameWindow = (Long) getWindowMethod.invoke(peer);
   252                 frameWindow = (Long) getWindowMethod.invoke(peer);
   250 //                System.err.println("frame peer ID: " + frameWindow);
   253 //                System.err.println("frame peer ID: " + frameWindow);
   251 
   254 
   252                 String eframeClassName = "sun.awt.windows.WEmbeddedFrame";
   255                 String eframeClassName = "sun.awt.windows.WEmbeddedFrame";