kirk.gui.closer
Class WindowCloser

java.lang.Object
  extended byjava.awt.event.WindowAdapter
      extended bykirk.gui.closer.WindowCloser
All Implemented Interfaces:
EventListener, WindowFocusListener, WindowListener, WindowStateListener
Direct Known Subclasses:
FinishingCloser, GLWindowCloser

public class WindowCloser
extends WindowAdapter

This class closes Windows that generate WindowEvents asking for it. If specified, it can also end the program after the closing of a Window. This is useful for main Windows.

Version:
1
Author:
Berend Wouda
See Also:
Window

Field Summary
private  boolean exit
          Whether or not to exit after the window is closed.
 
Constructor Summary
WindowCloser()
          Constructs a WindowCloser that does not end the program after closing.
WindowCloser(boolean exit)
          Constructs a WindowCloser with the indicated setting for whether to exit the program after closing the window.
 
Method Summary
 void windowClosing(WindowEvent event)
          Closes the Window indicated by the given WindowEvent.
 
Methods inherited from class java.awt.event.WindowAdapter
windowActivated, windowClosed, windowDeactivated, windowDeiconified, windowGainedFocus, windowIconified, windowLostFocus, windowOpened, windowStateChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

exit

private boolean exit
Whether or not to exit after the window is closed.

Constructor Detail

WindowCloser

public WindowCloser(boolean exit)
Constructs a WindowCloser with the indicated setting for whether to exit the program after closing the window.

Parameters:
exit - true if the program should exit after closing a window, false otherwise.

WindowCloser

public WindowCloser()
Constructs a WindowCloser that does not end the program after closing.

Method Detail

windowClosing

public void windowClosing(WindowEvent event)
Closes the Window indicated by the given WindowEvent.

Parameters:
event - The event that indicates which Window to close.