[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gzz-commits] gzz/gzz client/gl/GLUpdateManager.java modules/...
From: |
Matti Katila |
Subject: |
[Gzz-commits] gzz/gzz client/gl/GLUpdateManager.java modules/... |
Date: |
Mon, 27 Jan 2003 10:58:22 -0500 |
CVSROOT: /cvsroot/gzz
Module name: gzz
Changes by: Matti Katila <address@hidden> 03/01/27 10:58:22
Modified files:
gzz/client/gl : GLUpdateManager.java
gzz/modules/pp : EventHandling.java PPView2.java demotest.py
Added files:
gzz/modules/pp : PPDemo.java
Log message:
Demo motor.
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/client/gl/GLUpdateManager.java.diff?tr1=1.11&tr2=1.12&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/modules/pp/PPDemo.java?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/modules/pp/EventHandling.java.diff?tr1=1.9&tr2=1.10&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/modules/pp/PPView2.java.diff?tr1=1.63&tr2=1.64&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/modules/pp/demotest.py.diff?tr1=1.69&tr2=1.70&r1=text&r2=text
Patches:
Index: gzz/gzz/client/gl/GLUpdateManager.java
diff -u gzz/gzz/client/gl/GLUpdateManager.java:1.11
gzz/gzz/client/gl/GLUpdateManager.java:1.12
--- gzz/gzz/client/gl/GLUpdateManager.java:1.11 Sat Jan 18 09:53:09 2003
+++ gzz/gzz/client/gl/GLUpdateManager.java Mon Jan 27 10:58:22 2003
@@ -29,12 +29,20 @@
import gzz.gfx.gl.*;
import java.util.*;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.AWTEventMulticaster;
+
+
public class GLUpdateManager extends AbstractUpdateManager {
-public static final String rcsid = "$Id: GLUpdateManager.java,v 1.11
2003/01/18 14:53:09 tjl Exp $";
+public static final String rcsid = "$Id: GLUpdateManager.java,v 1.12
2003/01/27 15:58:22 mudyc Exp $";
private static boolean dbg = false;
private static void p(String s) { if(dbg) pa(s); }
private static void pa(String s) { System.err.println(s); }
+ // can be switched from jython..
+ public static boolean demoMode = false;
+
public GLUpdateManager(Runnable r) { super(r); }
static void startGLUpdateManager(Runnable r) {
@@ -53,7 +61,22 @@
return true;
}
+ /* for demo-events at the end of doIdle() */
+ private ActionListener actionListener = null;
+ public synchronized void addActionListener(ActionListener l) {
+ actionListener = AWTEventMulticaster.add(actionListener, l);
+ }
+ private void processEvent(ActionEvent e) {
+ if (actionListener != null) {
+ actionListener.actionPerformed(e);
+ }
+ }
+ public static GLUpdateManager getInstance() { return
(GLUpdateManager)instance; }
+
protected boolean doIdle() {
+ if(demoMode) processEvent(
+ new ActionEvent(this, ActionEvent.ACTION_LAST, "DEMO_EVENT"));
+
if(super.doIdle()) return true;
GL.freeQueue();
return false;
Index: gzz/gzz/modules/pp/EventHandling.java
diff -u gzz/gzz/modules/pp/EventHandling.java:1.9
gzz/gzz/modules/pp/EventHandling.java:1.10
--- gzz/gzz/modules/pp/EventHandling.java:1.9 Tue Jan 7 11:10:34 2003
+++ gzz/gzz/modules/pp/EventHandling.java Mon Jan 27 10:58:22 2003
@@ -35,7 +35,7 @@
* STATE: Working prototype
*/
public class EventHandling {
-public static final String rcsid = "$Id: EventHandling.java,v 1.9 2003/01/07
16:10:34 mudyc Exp $";
+public static final String rcsid = "$Id: EventHandling.java,v 1.10 2003/01/27
15:58:22 mudyc Exp $";
public boolean dbg = false;
private void pa(String s) { System.out.println(s); }
@@ -91,7 +91,7 @@
/** Used to clean callers at the beginning of render.
*/
public void cleanCallers() {
- callers = new TreeMap();
+ callers.clear();
}
Index: gzz/gzz/modules/pp/PPView2.java
diff -u gzz/gzz/modules/pp/PPView2.java:1.63
gzz/gzz/modules/pp/PPView2.java:1.64
--- gzz/gzz/modules/pp/PPView2.java:1.63 Wed Jan 22 09:31:33 2003
+++ gzz/gzz/modules/pp/PPView2.java Mon Jan 27 10:58:22 2003
@@ -36,7 +36,7 @@
import java.util.*;
public class PPView2 implements View {
-public static final String rcsid = "$Id: PPView2.java,v 1.63 2003/01/22
14:31:33 mudyc Exp $";
+public static final String rcsid = "$Id: PPView2.java,v 1.64 2003/01/27
15:58:22 mudyc Exp $";
public static boolean dbg = false;
private static void pa(String s) { System.err.println(s); }
@@ -154,7 +154,23 @@
public Space space;
public PPDims d;
+
+ /** Demo - Animations
+ */
+ private TreeMap animationTree = new TreeMap();
+ private void addAnim(Object o, int key) {
+ animationTree.put(o, new Integer(key));
+ }
+ public int getAnimCS(Object o) {
+ Object obj = animationTree.get(o);
+ if (obj == null) return -1;
+ return ((Integer)obj).intValue();
+ }
+
+ /** Interpolations
+ */
private TreeMap interps = new TreeMap();
+ public void addInterp(Object key, int i) { addInterp(key, new Integer(i));
}
public void addInterp(Object key, Object o) { interps.put(key, o); }
public void clearInterps() { interps.clear(); }
@@ -320,6 +336,7 @@
-pan[0]*buoyZoom, -pan[1]*buoyZoom, buoyZoom, buoyZoom);
vs.matcher.add(frameCS, c2fCS, "C2F");
+ addAnim(""+c, frameCS);
if (viewMode == LINK_KILLING) {
ev_handler.onClick(frameCS, "Kill link",
new Object[]{ c, connectedFrom, new Integer(dir)});
@@ -372,13 +389,14 @@
"LineWidth 2\nColor 0 0 0\nEnable TEXTURE_2D");
public void render(VobScene vs, int intoCS, ViewContext context) {
+ ev_handler.cleanCallers();
+ animationTree.clear();
+
// Nadir CS
NADIR_PT = vs.orthoBoxCS(0, "nadir_point", 0,
leftPanelRealWidth + 0.5f*mainWidth,
mainHeight*2.0f,
1, 1, 2, 2);
- ev_handler.cleanCallers();
-
buoy_vc.setCellView(cellview);
buoy_singlePlane = new SinglePlane();
@@ -421,6 +439,7 @@
vs.matcher.add(frameCS, c2fCS, "C2F");
MAIN_CS = frameCS;
+ addAnim(""+context.getAccursed(), MAIN_CS);
ev_handler.onClick(frameCS, "Click MAINVP",
new Object[]{ new Integer(mainctr), new Integer(frameCS)});
Index: gzz/gzz/modules/pp/demotest.py
diff -u gzz/gzz/modules/pp/demotest.py:1.69 gzz/gzz/modules/pp/demotest.py:1.70
--- gzz/gzz/modules/pp/demotest.py:1.69 Wed Jan 22 09:31:33 2003
+++ gzz/gzz/modules/pp/demotest.py Mon Jan 27 10:58:22 2003
@@ -108,6 +108,7 @@
self.ppv.bgscale = 500
self.poly = ["FILL", "LINE"]
self.map = None
+ self.demo = None
def setDefaultViewMode(self):
# set default settings
@@ -122,6 +123,12 @@
if key == "Ctrl-T":
c = self.avc.getAccursed()
self.ppv.dump(c)
+ elif key == "Ctrl-D":
+ a = gzz.client.gl.GLUpdateManager
+ if self.demo == None:
+ self.demo = PPDemo(self.ppv, a.getInstance(), self.avc)
+ a.demoMode = not a.demoMode
+ print 'Demo mode!', a.demoMode
elif key == "Ctrl-E":
print self.vs.matcher.interpList(self.vs.matcher, 0)
elif key == "Alt-R":
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gzz-commits] gzz/gzz client/gl/GLUpdateManager.java modules/...,
Matti Katila <=