本文整理汇总了Java中java.awt.Window.equals方法的典型用法代码示例。如果您正苦于以下问题:Java Window.equals方法的具体用法?Java Window.equals怎么用?Java Window.equals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.awt.Window
的用法示例。
在下文中一共展示了Window.equals方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onRegistryChange
import java.awt.Window; //导入方法依赖的package包/类
private void onRegistryChange( PropertyChangeEvent evt ) {
if( TopComponent.Registry.PROP_ACTIVATED.equals( evt.getPropertyName() ) ) {
final TopComponent tc = TopComponent.getRegistry().getActivated();
if( null != tc ) {
//#237857
Window activeWindow = SwingUtilities.getWindowAncestor(tc);
if( null != activeWindow && !activeWindow.equals(WindowManagerImpl.getInstance().getMainWindow()) )
return;
}
if( switchCurrentEditor() ) {
return;
}
cancel( true );
}
}
示例2: findActiveWindow
import java.awt.Window; //导入方法依赖的package包/类
/**
* Finds the deepest, visible, active child window from the given window. If
* an active window can not be found, it will try to search for the deepest,
* visible child window. If that can't be found, then it will use the given
* baseWindow.
*
* @param baseWindow the parent window.
* @return the active child window, else the deepest visible window, else
* the baseWindow.
*/
public static Window findActiveWindow(Window baseWindow)
{
Window selected = findDeepestChildWindow(baseWindow, true, true);
if( selected.equals(baseWindow) )
{
selected = findDeepestChildWindow(baseWindow, true, false);
}
return selected;
}