home *** CD-ROM | disk | FTP | other *** search
- package com.zerog.lax;
-
- import java.io.File;
- import java.util.Enumeration;
- import java.util.Vector;
-
- public class ZGAppEventUtils {
- static final int ZGAPPEVENT_ABOUT = 1;
- static final int ZGAPPEVENT_QUIT = 2;
- static final int ZGAPPEVENT_FILE_OPEN = 3;
- static final int ZGAPPEVENT_FILE_PRINT = 4;
- static Vector listenerVector = new Vector();
-
- private ZGAppEventUtils() {
- new Integer(4);
- new StringBuffer();
- }
-
- public static synchronized void addZGAppEventListener(ZGAppEventListener var0) {
- new Integer(4);
- new StringBuffer();
- if (System.getProperty("os.name").equals("Mac OS") && listenerVector.isEmpty()) {
- try {
- ZGMRJAppEventUtils.registerWithMRJ();
- } catch (ClassNotFoundException var2) {
- System.err.println(((Throwable)var2).getLocalizedMessage());
- }
- }
-
- listenerVector.addElement(var0);
- }
-
- public static synchronized boolean removeZGAppEventListener(ZGAppEventListener var0) {
- new Integer(4);
- new StringBuffer();
- return listenerVector.removeElement(var0);
- }
-
- protected static void appEvent(int var0) {
- new Integer(4);
- new StringBuffer();
- Object var1 = null;
- switch (var0) {
- case 1:
- Enumeration var3 = listenerVector.elements();
-
- while(var3.hasMoreElements()) {
- ((ZGAppEventListener)var3.nextElement()).aboutChosen();
- }
- break;
- case 2:
- Enumeration var2 = listenerVector.elements();
-
- while(var2.hasMoreElements()) {
- ((ZGAppEventListener)var2.nextElement()).quitRequested();
- }
- }
-
- }
-
- protected static void fileEvent(int var0, String var1) {
- new Integer(4);
- new StringBuffer();
- Object var2 = null;
- File var3 = new File(var1);
- switch (var0) {
- case 3:
- Enumeration var5 = listenerVector.elements();
-
- while(var5.hasMoreElements()) {
- ((ZGAppEventListener)var5.nextElement()).requestedOpenFile(var3);
- }
- break;
- case 4:
- Enumeration var4 = listenerVector.elements();
-
- while(var4.hasMoreElements()) {
- ((ZGAppEventListener)var4.nextElement()).requestedPrintFile(var3);
- }
- }
-
- }
- }
-