java.awt.event.WindowEvent#getWindow()源码实例Demo

下面列出了java.awt.event.WindowEvent#getWindow() 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: lnk2pwn   文件: DefaultWindowController.java
@Override
public void eventDispatched(AWTEvent event) {
    if (event instanceof WindowEvent) {
        WindowEvent windowEvent = (WindowEvent) event;
        
        switch(windowEvent.getID())
        {
            case WindowEvent.WINDOW_ACTIVATED:
                window = windowEvent.getWindow();
                break;
                
            case WindowEvent.WINDOW_DEACTIVATED:
                window = null;
                break;
                
            default:
                break;
        }
        
    }
}
 
源代码2 项目: opt4j   文件: DefaultApplicationFrame.java
@Override
public void startup() {
	WindowListener exitListener = new WindowAdapter() {
		@Override
		public void windowClosing(WindowEvent e) {
			Window window = e.getWindow();
			window.setVisible(false);
			window.dispose();
			try {
				Thread.sleep(1000);
			} catch (InterruptedException ignore) {
			} finally {
				System.exit(0);
			}
		}
	};
	addWindowListener(exitListener);

	setIconImage(Icons.getIcon(Icons.OPT4J).getImage());
	setTitle(title);
	setLayout(new BorderLayout());
	JSeparator jSeparator = new JSeparator();

	JPanel toolBarPanel = new JPanel(new BorderLayout());
	toolBarPanel.add(toolBar, BorderLayout.CENTER);
	toolBarPanel.add(jSeparator, BorderLayout.SOUTH);

	add(toolBarPanel, BorderLayout.NORTH);
	add(contentPanel, BorderLayout.CENTER);

	setJMenuBar(menu);

	menu.startup();
	toolBar.startup();
	contentPanel.startup();

	pack();
	setVisible(true);
}
 
源代码3 项目: netbeans   文件: ZOrderManager.java
public void windowActivated(WindowEvent e) {
    logger.entering(getClass().getName(), "windowActivated");

    WeakReference<RootPaneContainer> ww = getWeak((RootPaneContainer)e.getWindow());
    if (ww != null) {
        // place as last item in zOrder list
        zOrder.remove(ww);
        zOrder.add(ww);
    } else {
        throw new IllegalArgumentException("Window not attached: " + e.getWindow()); //NOI18N
    }
}
 
源代码4 项目: ccu-historian   文件: ApplicationFrame.java
/**
 * Listens for the main window closing, and shuts down the application.
 *
 * @param event  information about the window event.
 */
public void windowClosing(final WindowEvent event) {
    if (event.getWindow() == this) {
        dispose();
        System.exit(0);
    }
}
 
源代码5 项目: gcs   文件: BaseWindow.java
@Override
public void windowGainedFocus(WindowEvent event) {
    if (event.getWindow() == this) {
        WINDOW_LIST.remove(this);
        WINDOW_LIST.add(0, this);
    }
}
 
源代码6 项目: rapidminer-studio   文件: WindowChoreographer.java
@Override
public void windowClosed(WindowEvent e) {
	Window closedWindow = e.getWindow();
	Integer freePosition = windowPosition.remove(closedWindow);
	closedWindow.removeWindowListener(closeListener);
	// Mark as free
	if (freePosition != null) {
		freeSpaces.add(freePosition);
		cleanUp();
	}
}
 
源代码7 项目: raccoon4   文件: LifecycleBackend.java
@Override
public void windowClosing(WindowEvent e) {
	if (lifecycleManager.getWindow() == e.getWindow()) {
		// Primary window closed -> Application shutdown
		lifecycleManager.shutdown();
	}
	else {
		// Secondary window closed -> Hide and potentially recycle.
		e.getWindow().setVisible(false);
	}
}
 
源代码8 项目: astor   文件: ApplicationFrame.java
/**
 * Listens for the main window closing, and shuts down the application.
 *
 * @param event  information about the window event.
 */
public void windowClosing(WindowEvent event) {
    if (event.getWindow() == this) {
        dispose();
        System.exit(0);
    }
}
 
源代码9 项目: astor   文件: ApplicationFrame.java
/**
 * Listens for the main window closing, and shuts down the application.
 *
 * @param event  information about the window event.
 */
public void windowClosing(WindowEvent event) {
    if (event.getWindow() == this) {
        dispose();
        System.exit(0);
    }
}
 
源代码10 项目: wpcleaner   文件: Configuration.java
@Override
public void windowClosing(WindowEvent e) {
  if ((e != null) && (e.getWindow() != null)) {
    saveWindowPosition(e.getWindow());
  }
}
 
源代码11 项目: hortonmachine   文件: JFontChooser.java
public void windowClosing(WindowEvent e) {
    Window w = e.getWindow();
    w.setVisible(false);
}
 
源代码12 项目: SPIM_Registration   文件: Histogram.java
@Override
public void windowClosing( final WindowEvent evt )
{
	if( evt.getWindow() == this )
		dispose();
}