当前位置: 首页>>代码示例>>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;未经允许,请勿转载。