当前位置: 首页>>代码示例>>Java>>正文


Java Window.getOwnedWindows方法代码示例

本文整理汇总了Java中java.awt.Window.getOwnedWindows方法的典型用法代码示例。如果您正苦于以下问题:Java Window.getOwnedWindows方法的具体用法?Java Window.getOwnedWindows怎么用?Java Window.getOwnedWindows使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.awt.Window的用法示例。


在下文中一共展示了Window.getOwnedWindows方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: findChildWindow

import java.awt.Window; //导入方法依赖的package包/类
/**
 * Finds the first direct child window of the given window that matches the
 * specified attributes.
 * 
 * @param baseWindow the parent window.
 * @param isVisible the child window must be visible or not.
 * @param isActive the child window must be active or not.
 * @return a child window matching the attributes, or null if none found.
 */
public static Window findChildWindow(Window baseWindow, boolean isVisible, boolean isActive)
{
	Window ownedWindows[] = baseWindow.getOwnedWindows();
	for( int i = 0; i < ownedWindows.length; ++i )
	{
		Window w = ownedWindows[i];

		// If this is an active Frame or Dialog then start again from it:
		if( (w instanceof Frame) || ((w instanceof Dialog) && ((Dialog) w).isModal()) )
		{
			boolean check1 = !(isVisible ^ w.isVisible());
			boolean check2 = !(isActive ^ w.isActive());

			if( check1 && check2 )
			{
				return ownedWindows[i];
			}
		}
	}

	return null;
}
 
开发者ID:equella,项目名称:Equella,代码行数:32,代码来源:ComponentHelper.java

示例2: WindowNode

import java.awt.Window; //导入方法依赖的package包/类
public WindowNode(Window win) {
    super(win);
    Window[] wns = win.getOwnedWindows();
    Vector<WindowNode> wwns = new Vector<>();
    for (Window wn : wns) {
        if (propDialog.showAll || wn.isVisible()) {
            wwns.add(new WindowNode(wn));
        }
    }
    wins = new WindowNode[wwns.size()];
    for (int i = 0; i < wwns.size(); i++) {
        wins[i] = wwns.get(i);
    }
    title = win.toString();
    clss = win.getClass().getName();
    BufferedImage image = null;
    try {
        image = new Robot().
                createScreenCapture(new Rectangle(win.getLocationOnScreen(),
                        win.getSize()));
    } catch (AWTException e) {
        e.printStackTrace();
    }
    setComponentImageProvider(new ComponentImageProvider(image, x, y));
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:26,代码来源:GUIBrowser.java

示例3: getAWindow

import java.awt.Window; //导入方法依赖的package包/类
private static Window getAWindow(Window owner, ComponentChooser cc) {
    if (owner == null) {
        return WindowWaiter.getAWindow(cc);
    } else {
        Window result = null;
        Window[] windows = owner.getOwnedWindows();
        for (Window window : windows) {
            if (cc.checkComponent(window)) {
                return window;
            }
            if ((result = WindowWaiter.getWindow(window, cc)) != null) {
                return result;
            }
        }
        return null;
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:18,代码来源:WindowWaiter.java

示例4: hasModalDialog

import java.awt.Window; //导入方法依赖的package包/类
private static boolean hasModalDialog(Window w) {
    if (w == null) { // #63830
        return false;
    }
    Window[] ws = w.getOwnedWindows();
    for(int i = 0; i < ws.length; i++) {
        if(ws[i] instanceof Dialog && ((Dialog)ws[i]).isModal() && ws[i].isVisible()) {
            return true;
        } else if(hasModalDialog(ws[i])) {
            return true;
        }
    }
    
    return false;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:16,代码来源:NotifyExcPanel.java

示例5: updateWindowTreeUI

import java.awt.Window; //导入方法依赖的package包/类
private static void updateWindowTreeUI(Window window) {
    SwingUtilities.updateComponentTreeUI(window);
    Window[] arrwindow = window.getOwnedWindows();
    int n = arrwindow.length;
    while (--n >= 0) {
        Window window2 = arrwindow[n];
        if (!window2.isDisplayable()) continue;
        Test4319113.updateWindowTreeUI(window2);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:11,代码来源:Test4319113.java


注:本文中的java.awt.Window.getOwnedWindows方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。