37 |
|
|
38 |
public class GLUpdateManager extends AbstractUpdateManager { |
public class GLUpdateManager extends AbstractUpdateManager { |
39 |
public static final String rcsid = "$Id$"; |
public static final String rcsid = "$Id$"; |
40 |
private static boolean dbg = false; |
public static boolean dbg = false; |
41 |
private static void p(String s) { if(dbg) pa(s); } |
private static void pa(String s) { System.out.println(s); } |
|
private static void pa(String s) { System.err.println(s); } |
|
42 |
|
|
43 |
// can be switched from jython.. |
// can be switched from jython.. |
44 |
public static boolean demoMode = false; |
public static boolean demoMode = false; |
51 |
|
|
52 |
private Thread t = new Thread(this); |
private Thread t = new Thread(this); |
53 |
{ |
{ |
54 |
p("STARTGLTHREAD"); |
if(dbg) pa("STARTGLTHREAD"); |
55 |
t.start(); |
t.start(); |
56 |
} |
} |
57 |
|
|
58 |
protected boolean handleEvents(boolean waitForEvent) { |
protected boolean handleEvents(boolean waitForEvent) { |
59 |
p("HandleEvents "+waitForEvent); |
if(dbg) pa("HandleEvents "+waitForEvent); |
60 |
GL.eventLoop(waitForEvent); |
GL.eventLoop(waitForEvent); |
61 |
return true; |
return true; |
62 |
} |
} |
75 |
private int freeMemoryCountdown = 50; |
private int freeMemoryCountdown = 50; |
76 |
|
|
77 |
protected boolean doIdle() { |
protected boolean doIdle() { |
78 |
|
if(dbg) pa("GLUpdatemanager doIdle"); |
79 |
if(demoMode) { |
if(demoMode) { |
80 |
processEvent( |
processEvent( |
81 |
new ActionEvent(this, ActionEvent.ACTION_LAST, "DEMO_EVENT")); |
new ActionEvent(this, ActionEvent.ACTION_LAST, "DEMO_EVENT")); |
93 |
} |
} |
94 |
|
|
95 |
protected void interruptEventloop() { |
protected void interruptEventloop() { |
96 |
|
if(dbg) pa("GLUpdatemanager interrupt eventloop"); |
97 |
GL.interruptEventloop(); |
GL.interruptEventloop(); |
98 |
|
if(dbg) pa("GLUpdatemanager interrupt done"); |
99 |
} |
} |
100 |
} |
} |