本文整理匯總了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);
}
}