001
002 package gui;
003
004 //import java.awt.event.WindowListener;
005 import java.awt.event.WindowEvent;
006 import java.awt.event.WindowAdapter;
007
008 import javax.swing.JFrame;
009
010 /**
011 * Main class to send GUI window events to the TSP model.
012 * @author Heinz Kredel.
013 */
014 public class TSPguiWindowControl extends WindowAdapter /*implements WindowListener*/ {
015
016 TSPguiModel model;
017
018 /**
019 * @param model the TSPguiModel.
020 */
021 public TSPguiWindowControl(TSPguiModel model) {
022 super();
023 this.model = model;
024 }
025
026 /* (non-Javadoc)
027 * @see java.awt.event.WindowListener#windowClosing(java.awt.event.WindowEvent)
028 */
029 public void windowClosing(WindowEvent event) {
030 JFrame source = (JFrame)event.getSource();
031 // System.out.println("source = " + source);
032 model.setDone();
033 }
034
035 /*
036 public void windowClosed(WindowEvent event) {
037 }
038
039 public void windowOpened(WindowEvent event) {
040 }
041
042 public void windowActivated(WindowEvent event) {
043 }
044
045 public void windowDeactivated(WindowEvent event) {
046 }
047
048 public void windowIconified(WindowEvent event) {
049 }
050
051 public void windowDeiconified(WindowEvent event) {
052 }
053 */
054
055 }
056