本文整理汇总了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;
}
示例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));
}
示例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;
}
}
示例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;
}
示例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);
}
}