/[gzz]/gzz/gzz/client/gl/GLUpdateManager.java
ViewVC logotype

Diff of /gzz/gzz/client/gl/GLUpdateManager.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.11 by tjl, Sat Jan 18 14:53:09 2003 UTC revision 1.12 by mudyc, Mon Jan 27 15:58:22 2003 UTC
# Line 29  import gzz.client.*; Line 29  import gzz.client.*;
29  import gzz.gfx.gl.*;  import gzz.gfx.gl.*;
30  import java.util.*;  import java.util.*;
31    
32    import java.awt.event.ActionEvent;
33    import java.awt.event.ActionListener;
34    import java.awt.AWTEventMulticaster;
35    
36    
37  public class GLUpdateManager extends AbstractUpdateManager {  public class GLUpdateManager extends AbstractUpdateManager {
38  public static final String rcsid = "$Id$";  public static final String rcsid = "$Id$";
39      private static boolean dbg = false;      private static boolean dbg = false;
40      private static void p(String s) { if(dbg) pa(s); }      private static void p(String s) { if(dbg) pa(s); }
41      private static void pa(String s) { System.err.println(s); }      private static void pa(String s) { System.err.println(s); }
42    
43        // can be switched from jython..
44        public static boolean demoMode = false;
45    
46      public GLUpdateManager(Runnable r) { super(r); }      public GLUpdateManager(Runnable r) { super(r); }
47    
48      static void startGLUpdateManager(Runnable r) {      static void startGLUpdateManager(Runnable r) {
# Line 53  public static final String rcsid = "$Id$ Line 61  public static final String rcsid = "$Id$
61          return true;          return true;
62      }      }
63    
64        /* for demo-events at the end of doIdle() */
65        private ActionListener actionListener = null;
66        public synchronized void addActionListener(ActionListener l) {
67            actionListener = AWTEventMulticaster.add(actionListener, l);
68        }
69        private void processEvent(ActionEvent e) {
70            if (actionListener != null) {
71                actionListener.actionPerformed(e);
72            }        
73        }
74        public static GLUpdateManager getInstance() { return (GLUpdateManager)instance; }
75    
76      protected boolean doIdle() {      protected boolean doIdle() {
77            if(demoMode) processEvent(
78                new ActionEvent(this, ActionEvent.ACTION_LAST, "DEMO_EVENT"));
79    
80          if(super.doIdle()) return true;          if(super.doIdle()) return true;
81          GL.freeQueue();          GL.freeQueue();
82          return false;          return false;

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.12

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26