use of java.awt.event.WindowListener in project JMRI by JMRI.
the class ReporterIconTest method tearDown.
@Override
protected void tearDown() {
// now close panel window
if (panel != null) {
java.awt.event.WindowListener[] listeners = panel.getTargetFrame().getWindowListeners();
for (WindowListener listener : listeners) {
panel.getTargetFrame().removeWindowListener(listener);
}
junit.extensions.jfcunit.TestHelper.disposeWindow(panel.getTargetFrame(), this);
}
apps.tests.Log4JFixture.tearDown();
}
use of java.awt.event.WindowListener in project ChatGameFontificator by GlitchCog.
the class ChatWindow method initChat.
/**
* Sets the properties to get hooks into the properties' configuration models; Sets the ControlWindow to get hooks
* back into the controls; Sets the loaded member Boolean to indicate it has everything it needs to begin rendering
* the visualization
*
* @param fProps
* @param ctrlWindow
* @throws IOException
*/
public void initChat(final FontificatorProperties fProps, final ControlWindow ctrlWindow) throws IOException {
chatPanel = new ChatPanel();
add(chatPanel);
mouseListeners = new ChatMouseListeners(this, ctrlWindow);
addMouseListener(mouseListeners);
addMouseMotionListener(mouseListeners);
addMouseWheelListener(chatPanel);
setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
setSize(fProps.getChatConfig().getWidth(), fProps.getChatConfig().getHeight());
setResizable(fProps.getChatConfig().isResizable());
setAlwaysOnTop(fProps.getChatConfig().isAlwaysOnTop());
chatPanel.setConfig(fProps);
chatPanel.initExpirationTimer();
addWindowListener(new WindowListener() {
@Override
public void windowOpened(WindowEvent e) {
}
@Override
public void windowClosing(WindowEvent e) {
callExit(e.getComponent());
}
@Override
public void windowClosed(WindowEvent e) {
}
@Override
public void windowIconified(WindowEvent e) {
}
@Override
public void windowDeiconified(WindowEvent e) {
}
@Override
public void windowActivated(WindowEvent e) {
}
@Override
public void windowDeactivated(WindowEvent e) {
}
/**
* Calls exit from the control window
*/
private void callExit(Component caller) {
ctrlWindow.attemptToExit(caller);
}
});
}
use of java.awt.event.WindowListener in project jgnash by ccavanaugh.
the class MainFrame method doPartialDispose.
/**
* Dispose the UI without a complete program shutdown.
*/
void doPartialDispose() {
PluginFactory.stopPlugins();
for (final WindowListener listener : getWindowListeners()) {
if (listener instanceof ShutdownAdapter) {
removeWindowListener(listener);
}
}
super.dispose();
}
Aggregations