import com.apple.eawt.*;
import javax.swing.*;
import java.awt.event.*;

public class MacAdapter {

	public static void adapt() {
		Application fApplication = Application.getApplication();
		fApplication.addApplicationListener(new com.apple.eawt.ApplicationAdapter() {
			public void handleAbout(ApplicationEvent e) {
				//open the about dialog box
				String[] message = { "Dungeon Master Java", "by Alan Berfield", "\nCopyright 2010\n" };
				JOptionPane.showMessageDialog(dmnew.frame,message,"About",JOptionPane.INFORMATION_MESSAGE);
				e.setHandled(true);
			}
			public void handleQuit(ApplicationEvent e) {
				e.setHandled(false);
				dmnew.shutDown();
			}
		});
	};

	public static void adaptEditor() {
		Application fApplication = Application.getApplication();
		fApplication.addApplicationListener(new com.apple.eawt.ApplicationAdapter() {
			public void handleAbout(ApplicationEvent e) {
				DMEditor.menulisten.actionPerformed(new ActionEvent(this,ActionEvent.ACTION_PERFORMED,"About"));
				e.setHandled(true);
			}
			public void handleQuit(ApplicationEvent e) {
				e.setHandled(false);
				DMEditor.menulisten.actionPerformed(new ActionEvent(this,ActionEvent.ACTION_PERFORMED,"Exit"));
			}
		});
	};

}

