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