sun.awt.AWTAccessor.WindowAccessor Java Examples

The following examples show how to use sun.awt.AWTAccessor.WindowAccessor. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CPlatformWindow.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
private void orderAboveSiblings() {
    // Recursively pop up the windows from the very bottom, (i.e. root owner) so that
    // the windows are ordered above their nearest owner; ancestors of the window,
    // which is going to become 'main window', are placed above their siblings.
    CPlatformWindow rootOwner = getRootOwner();
    if (rootOwner.isVisible() && !rootOwner.isIconified() && !rootOwner.isActive()) {
        rootOwner.execute(CWrapper.NSWindow::orderFront);
    }

    // Do not order child windows of iconified owner.
    if (!rootOwner.isIconified()) {
        final WindowAccessor windowAccessor = AWTAccessor.getWindowAccessor();
        orderAboveSiblingsImpl(windowAccessor.getOwnedWindows(rootOwner.target));
    }
}
 
Example #2
Source File: CPlatformWindow.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
private void orderAboveSiblings() {
    // Recursively pop up the windows from the very bottom, (i.e. root owner) so that
    // the windows are ordered above their nearest owner; ancestors of the window,
    // which is going to become 'main window', are placed above their siblings.
    CPlatformWindow rootOwner = getRootOwner();
    if (rootOwner.isVisible() && !rootOwner.isIconified() && !rootOwner.isActive()) {
        rootOwner.execute(CWrapper.NSWindow::orderFront);
    }

    // Do not order child windows of iconified owner.
    if (!rootOwner.isIconified()) {
        final WindowAccessor windowAccessor = AWTAccessor.getWindowAccessor();
        orderAboveSiblingsImpl(windowAccessor.getOwnedWindows(rootOwner.target));
    }
}
 
Example #3
Source File: CPlatformWindow.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
private void orderAboveSiblings() {
    // Recursively pop up the windows from the very bottom, (i.e. root owner) so that
    // the windows are ordered above their nearest owner; ancestors of the window,
    // which is going to become 'main window', are placed above their siblings.
    CPlatformWindow rootOwner = getRootOwner();
    if (rootOwner.isVisible() && !rootOwner.isIconified() && !rootOwner.isActive()) {
        rootOwner.execute(CWrapper.NSWindow::orderFront);
    }

    // Do not order child windows of iconified owner.
    if (!rootOwner.isIconified()) {
        final WindowAccessor windowAccessor = AWTAccessor.getWindowAccessor();
        orderAboveSiblingsImpl(windowAccessor.getOwnedWindows(rootOwner.target));
    }
}
 
Example #4
Source File: CPlatformWindow.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
private void orderAboveSiblings() {
    // Recursively pop up the windows from the very bottom, (i.e. root owner) so that
    // the windows are ordered above their nearest owner; ancestors of the window,
    // which is going to become 'main window', are placed above their siblings.
    CPlatformWindow rootOwner = getRootOwner();
    if (rootOwner.isVisible() && !rootOwner.isIconified()) {
        rootOwner.execute(CWrapper.NSWindow::orderFront);
    }
    // Do not order child windows of iconified owner.
    if (!rootOwner.isIconified()) {
        final WindowAccessor windowAccessor = AWTAccessor.getWindowAccessor();
        orderAboveSiblingsImpl(windowAccessor.getOwnedWindows(rootOwner.target));
    }
}
 
Example #5
Source File: CPlatformWindow.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
private void orderAboveSiblings() {
    // Recursively pop up the windows from the very bottom, (i.e. root owner) so that
    // the windows are ordered above their nearest owner; ancestors of the window,
    // which is going to become 'main window', are placed above their siblings.
    CPlatformWindow rootOwner = getRootOwner();
    if (rootOwner.isVisible() && !rootOwner.isIconified()) {
        rootOwner.execute(CWrapper.NSWindow::orderFront);
    }
    // Do not order child windows of iconified owner.
    if (!rootOwner.isIconified()) {
        final WindowAccessor windowAccessor = AWTAccessor.getWindowAccessor();
        orderAboveSiblingsImpl(windowAccessor.getOwnedWindows(rootOwner.target));
    }
}
 
Example #6
Source File: CPlatformWindow.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
private void orderAboveSiblings() {
    // Recursively pop up the windows from the very bottom, (i.e. root owner) so that
    // the windows are ordered above their nearest owner; ancestors of the window,
    // which is going to become 'main window', are placed above their siblings.
    CPlatformWindow rootOwner = getRootOwner();
    if (rootOwner.isVisible() && !rootOwner.isIconified()) {
        CWrapper.NSWindow.orderFront(rootOwner.getNSWindowPtr());
    }
    // Do not order child windows of iconified owner.
    if (!rootOwner.isIconified()) {
        final WindowAccessor windowAccessor = AWTAccessor.getWindowAccessor();
        orderAboveSiblingsImpl(windowAccessor.getOwnedWindows(rootOwner.target));
    }
}
 
Example #7
Source File: CPlatformWindow.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
private void orderAboveSiblingsImpl(Window[] windows) {
    ArrayList<Window> childWindows = new ArrayList<Window>();

    final ComponentAccessor componentAccessor = AWTAccessor.getComponentAccessor();
    final WindowAccessor windowAccessor = AWTAccessor.getWindowAccessor();

    // Go through the list of windows and perform ordering.
    for (Window w : windows) {
        boolean iconified = false;
        final Object p = componentAccessor.getPeer(w);
        if (p instanceof LWWindowPeer) {
            CPlatformWindow pw = (CPlatformWindow)((LWWindowPeer)p).getPlatformWindow();
            iconified = isIconified();
            if (pw != null && pw.isVisible() && !iconified) {
                // If the window is one of ancestors of 'main window' or is going to become main by itself,
                // the window should be ordered above its siblings; otherwise the window is just ordered
                // above its nearest parent.
                if (pw.isOneOfOwnersOrSelf(this)) {
                    CWrapper.NSWindow.orderFront(pw.getNSWindowPtr());
                } else {
                    CWrapper.NSWindow.orderWindow(pw.getNSWindowPtr(), CWrapper.NSWindow.NSWindowAbove,
                            pw.owner.getNSWindowPtr());
                }
                pw.applyWindowLevel(w);
            }
        }
        // Retrieve the child windows for each window from the list except iconified ones
        // and store them for future use.
        // Note: we collect data about child windows even for invisible owners, since they may have
        // visible children.
        if (!iconified) {
            childWindows.addAll(Arrays.asList(windowAccessor.getOwnedWindows(w)));
        }
    }
    // If some windows, which have just been ordered, have any child windows, let's start new iteration
    // and order these child windows.
    if (!childWindows.isEmpty()) {
        orderAboveSiblingsImpl(childWindows.toArray(new Window[0]));
    }
}
 
Example #8
Source File: CPlatformWindow.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
private void orderAboveSiblings() {
    // Recursively pop up the windows from the very bottom, (i.e. root owner) so that
    // the windows are ordered above their nearest owner; ancestors of the window,
    // which is going to become 'main window', are placed above their siblings.
    CPlatformWindow rootOwner = getRootOwner();
    if (rootOwner.isVisible() && !rootOwner.isIconified() && !rootOwner.isActive()) {
        rootOwner.execute(CWrapper.NSWindow::orderFront);
    }

    // Do not order child windows of iconified owner.
    if (!rootOwner.isIconified()) {
        final WindowAccessor windowAccessor = AWTAccessor.getWindowAccessor();
        orderAboveSiblingsImpl(windowAccessor.getOwnedWindows(rootOwner.target));
    }
}
 
Example #9
Source File: CPlatformWindow.java    From dragonwell8_jdk with GNU General Public License v2.0 4 votes vote down vote up
private void orderAboveSiblingsImpl(Window[] windows) {
    ArrayList<Window> childWindows = new ArrayList<Window>();

    final ComponentAccessor componentAccessor = AWTAccessor.getComponentAccessor();
    final WindowAccessor windowAccessor = AWTAccessor.getWindowAccessor();

    // Go through the list of windows and perform ordering.
    for (Window w : windows) {
        boolean iconified = false;
        final Object p = componentAccessor.getPeer(w);
        if (p instanceof LWWindowPeer) {
            CPlatformWindow pw = (CPlatformWindow)((LWWindowPeer)p).getPlatformWindow();
            iconified = isIconified();
            if (pw != null && pw.isVisible() && !iconified) {
                // If the window is one of ancestors of 'main window' or is going to become main by itself,
                // the window should be ordered above its siblings; otherwise the window is just ordered
                // above its nearest parent.
                if (pw.isOneOfOwnersOrSelf(this)) {
                    pw.execute(CWrapper.NSWindow::orderFront);
                } else {
                    pw.owner.execute(ownerPtr -> {
                        pw.execute(ptr -> {
                            CWrapper.NSWindow.orderWindow(ptr, CWrapper.NSWindow.NSWindowAbove, ownerPtr);
                        });
                    });
                }
                pw.applyWindowLevel(w);
            }
        }
        // Retrieve the child windows for each window from the list except iconified ones
        // and store them for future use.
        // Note: we collect data about child windows even for invisible owners, since they may have
        // visible children.
        if (!iconified) {
            childWindows.addAll(Arrays.asList(windowAccessor.getOwnedWindows(w)));
        }
    }
    // If some windows, which have just been ordered, have any child windows, let's start new iteration
    // and order these child windows.
    if (!childWindows.isEmpty()) {
        orderAboveSiblingsImpl(childWindows.toArray(new Window[0]));
    }
}
 
Example #10
Source File: CPlatformWindow.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
private void orderAboveSiblingsImpl(Window[] windows) {
    ArrayList<Window> childWindows = new ArrayList<Window>();

    final ComponentAccessor componentAccessor = AWTAccessor.getComponentAccessor();
    final WindowAccessor windowAccessor = AWTAccessor.getWindowAccessor();

    // Go through the list of windows and perform ordering.
    for (Window w : windows) {
        boolean iconified = false;
        final Object p = componentAccessor.getPeer(w);
        if (p instanceof LWWindowPeer) {
            CPlatformWindow pw = (CPlatformWindow)((LWWindowPeer)p).getPlatformWindow();
            iconified = isIconified();
            if (pw != null && pw.isVisible() && !iconified) {
                // If the window is one of ancestors of 'main window' or is going to become main by itself,
                // the window should be ordered above its siblings; otherwise the window is just ordered
                // above its nearest parent.
                if (pw.isOneOfOwnersOrSelf(this)) {
                    pw.execute(CWrapper.NSWindow::orderFront);
                } else {
                    pw.owner.execute(ownerPtr -> {
                        pw.execute(ptr -> {
                            CWrapper.NSWindow.orderWindow(ptr, CWrapper.NSWindow.NSWindowAbove, ownerPtr);
                        });
                    });
                }
                pw.applyWindowLevel(w);
            }
        }
        // Retrieve the child windows for each window from the list except iconified ones
        // and store them for future use.
        // Note: we collect data about child windows even for invisible owners, since they may have
        // visible children.
        if (!iconified) {
            childWindows.addAll(Arrays.asList(windowAccessor.getOwnedWindows(w)));
        }
    }
    // If some windows, which have just been ordered, have any child windows, let's start new iteration
    // and order these child windows.
    if (!childWindows.isEmpty()) {
        orderAboveSiblingsImpl(childWindows.toArray(new Window[0]));
    }
}
 
Example #11
Source File: CPlatformWindow.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
private void orderAboveSiblingsImpl(Window[] windows) {
    ArrayList<Window> childWindows = new ArrayList<Window>();

    final ComponentAccessor componentAccessor = AWTAccessor.getComponentAccessor();
    final WindowAccessor windowAccessor = AWTAccessor.getWindowAccessor();

    // Go through the list of windows and perform ordering.
    for (Window w : windows) {
        boolean iconified = false;
        final Object p = componentAccessor.getPeer(w);
        if (p instanceof LWWindowPeer) {
            CPlatformWindow pw = (CPlatformWindow)((LWWindowPeer)p).getPlatformWindow();
            iconified = isIconified();
            if (pw != null && pw.isVisible() && !iconified) {
                // If the window is one of ancestors of 'main window' or is going to become main by itself,
                // the window should be ordered above its siblings; otherwise the window is just ordered
                // above its nearest parent.
                if (pw.isOneOfOwnersOrSelf(this)) {
                    pw.execute(CWrapper.NSWindow::orderFront);
                } else {
                    pw.owner.execute(ownerPtr -> {
                        pw.execute(ptr -> {
                            CWrapper.NSWindow.orderWindow(ptr, CWrapper.NSWindow.NSWindowAbove, ownerPtr);
                        });
                    });
                }
                pw.applyWindowLevel(w);
            }
        }
        // Retrieve the child windows for each window from the list except iconified ones
        // and store them for future use.
        // Note: we collect data about child windows even for invisible owners, since they may have
        // visible children.
        if (!iconified) {
            childWindows.addAll(Arrays.asList(windowAccessor.getOwnedWindows(w)));
        }
    }
    // If some windows, which have just been ordered, have any child windows, let's start new iteration
    // and order these child windows.
    if (!childWindows.isEmpty()) {
        orderAboveSiblingsImpl(childWindows.toArray(new Window[0]));
    }
}
 
Example #12
Source File: CPlatformWindow.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
private void orderAboveSiblingsImpl(Window[] windows) {
    ArrayList<Window> childWindows = new ArrayList<Window>();

    final ComponentAccessor componentAccessor = AWTAccessor.getComponentAccessor();
    final WindowAccessor windowAccessor = AWTAccessor.getWindowAccessor();

    // Go through the list of windows and perform ordering.
    for (Window w : windows) {
        boolean iconified = false;
        final Object p = componentAccessor.getPeer(w);
        if (p instanceof LWWindowPeer) {
            CPlatformWindow pw = (CPlatformWindow)((LWWindowPeer)p).getPlatformWindow();
            iconified = isIconified();
            if (pw != null && pw.isVisible() && !iconified) {
                // If the window is one of ancestors of 'main window' or is going to become main by itself,
                // the window should be ordered above its siblings; otherwise the window is just ordered
                // above its nearest parent.
                if (pw.isOneOfOwnersOrSelf(this)) {
                    pw.execute(CWrapper.NSWindow::orderFront);
                } else {
                    pw.owner.execute(ownerPtr -> {
                        pw.execute(ptr -> {
                            CWrapper.NSWindow.orderWindow(ptr, CWrapper.NSWindow.NSWindowAbove, ownerPtr);
                        });
                    });
                }
                pw.applyWindowLevel(w);
            }
        }
        // Retrieve the child windows for each window from the list except iconified ones
        // and store them for future use.
        // Note: we collect data about child windows even for invisible owners, since they may have
        // visible children.
        if (!iconified) {
            childWindows.addAll(Arrays.asList(windowAccessor.getOwnedWindows(w)));
        }
    }
    // If some windows, which have just been ordered, have any child windows, let's start new iteration
    // and order these child windows.
    if (!childWindows.isEmpty()) {
        orderAboveSiblingsImpl(childWindows.toArray(new Window[0]));
    }
}
 
Example #13
Source File: CPlatformWindow.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
private void orderAboveSiblingsImpl(Window[] windows) {
    ArrayList<Window> childWindows = new ArrayList<Window>();

    final ComponentAccessor componentAccessor = AWTAccessor.getComponentAccessor();
    final WindowAccessor windowAccessor = AWTAccessor.getWindowAccessor();

    // Go through the list of windows and perform ordering.
    for (Window w : windows) {
        boolean iconified = false;
        final Object p = componentAccessor.getPeer(w);
        if (p instanceof LWWindowPeer) {
            CPlatformWindow pw = (CPlatformWindow)((LWWindowPeer)p).getPlatformWindow();
            iconified = isIconified();
            if (pw != null && pw.isVisible() && !iconified) {
                // If the window is one of ancestors of 'main window' or is going to become main by itself,
                // the window should be ordered above its siblings; otherwise the window is just ordered
                // above its nearest parent.
                if (pw.isOneOfOwnersOrSelf(this)) {
                    pw.execute(CWrapper.NSWindow::orderFront);
                } else {
                    pw.owner.execute(ownerPtr -> {
                        pw.execute(ptr -> {
                            CWrapper.NSWindow.orderWindow(ptr, CWrapper.NSWindow.NSWindowAbove, ownerPtr);
                        });
                    });
                }
                pw.applyWindowLevel(w);
            }
        }
        // Retrieve the child windows for each window from the list except iconified ones
        // and store them for future use.
        // Note: we collect data about child windows even for invisible owners, since they may have
        // visible children.
        if (!iconified) {
            childWindows.addAll(Arrays.asList(windowAccessor.getOwnedWindows(w)));
        }
    }
    // If some windows, which have just been ordered, have any child windows, let's start new iteration
    // and order these child windows.
    if (!childWindows.isEmpty()) {
        orderAboveSiblingsImpl(childWindows.toArray(new Window[0]));
    }
}
 
Example #14
Source File: CPlatformWindow.java    From jdk8u_jdk with GNU General Public License v2.0 4 votes vote down vote up
private void orderAboveSiblingsImpl(Window[] windows) {
    ArrayList<Window> childWindows = new ArrayList<Window>();

    final ComponentAccessor componentAccessor = AWTAccessor.getComponentAccessor();
    final WindowAccessor windowAccessor = AWTAccessor.getWindowAccessor();

    // Go through the list of windows and perform ordering.
    for (Window w : windows) {
        boolean iconified = false;
        final Object p = componentAccessor.getPeer(w);
        if (p instanceof LWWindowPeer) {
            CPlatformWindow pw = (CPlatformWindow)((LWWindowPeer)p).getPlatformWindow();
            iconified = isIconified();
            if (pw != null && pw.isVisible() && !iconified) {
                // If the window is one of ancestors of 'main window' or is going to become main by itself,
                // the window should be ordered above its siblings; otherwise the window is just ordered
                // above its nearest parent.
                if (pw.isOneOfOwnersOrSelf(this)) {
                    pw.execute(CWrapper.NSWindow::orderFront);
                } else {
                    pw.owner.execute(ownerPtr -> {
                        pw.execute(ptr -> {
                            CWrapper.NSWindow.orderWindow(ptr, CWrapper.NSWindow.NSWindowAbove, ownerPtr);
                        });
                    });
                }
                pw.applyWindowLevel(w);
            }
        }
        // Retrieve the child windows for each window from the list except iconified ones
        // and store them for future use.
        // Note: we collect data about child windows even for invisible owners, since they may have
        // visible children.
        if (!iconified) {
            childWindows.addAll(Arrays.asList(windowAccessor.getOwnedWindows(w)));
        }
    }
    // If some windows, which have just been ordered, have any child windows, let's start new iteration
    // and order these child windows.
    if (!childWindows.isEmpty()) {
        orderAboveSiblingsImpl(childWindows.toArray(new Window[0]));
    }
}