當前位置: 首頁>>代碼示例>>Java>>正文


Java Window.getOwner方法代碼示例

本文整理匯總了Java中java.awt.Window.getOwner方法的典型用法代碼示例。如果您正苦於以下問題:Java Window.getOwner方法的具體用法?Java Window.getOwner怎麽用?Java Window.getOwner使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在java.awt.Window的用法示例。


在下文中一共展示了Window.getOwner方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: addWindowParents

import java.awt.Window; //導入方法依賴的package包/類
private JSONObject addWindowParents(JSONObject r, Window parent, JSONObject current) {
    while (parent != null) {
        if (!parent.getClass().getName().equals("javax.swing.SwingUtilities$SharedOwnerFrame")
                && !parent.getClass().getName().equals("javax.swing.Popup$HeavyWeightWindow") && parent.isVisible()) {
            JSONObject pWindow = getContextJSONObject(parent);
            if (r == null) {
                r = pWindow;
            }
            if (current != null) {
                current.put("container", pWindow);
            }
            current = pWindow;
        }
        parent = parent.getOwner();
    }
    return r;
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:18,代碼來源:RComponent.java

示例2: centreOnScreen

import java.awt.Window; //導入方法依賴的package包/類
public static void centreOnScreen(Window window)
{
	Window owner = window.getOwner();

	// If the window has an owner, use the same graphics configuration so it
	// will
	// open on the same screen. Otherwise, grab the mouse pointer and work
	// from there.
	GraphicsConfiguration gc = owner != null ? owner.getGraphicsConfiguration() : MouseInfo.getPointerInfo()
		.getDevice().getDefaultConfiguration();

	if( gc != null )
	{
		window.setBounds(centre(getUsableScreenBounds(gc), window.getBounds()));
	}
	else
	{
		// Fall-back to letting Java do the work
		window.setLocationRelativeTo(null);
	}
}
 
開發者ID:equella,項目名稱:Equella,代碼行數:22,代碼來源:ComponentHelper.java

示例3: findFocusedWindow

import java.awt.Window; //導入方法依賴的package包/類
/**
 * @return Focused and showing Window or null.
 */
private Window findFocusedWindow() {
    Window w = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusedWindow();
    while( null != w && !w.isShowing() ) {
        w = w.getOwner();
    }
    return w;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:11,代碼來源:NbPresenter.java

示例4: getToplevelOwner

import java.awt.Window; //導入方法依賴的package包/類
/**
 * Return the owning Frame for a given Window.  Used in setFSWindow below
 * to set the properties of the owning Frame when a Window goes
 * into fullscreen mode.
 */
private Frame getToplevelOwner(Window w) {
    Window owner = w;
    while (owner != null) {
        owner = owner.getOwner();
        if (owner instanceof Frame) {
            return (Frame) owner;
        }
    }
    // could get here if passed Window is an owner-less Dialog
    return null;
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:17,代碼來源:D3DGraphicsDevice.java


注:本文中的java.awt.Window.getOwner方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。