[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gzz-commits] libvob/vob/buoy buoymanager.py
From: |
Matti Katila |
Subject: |
[Gzz-commits] libvob/vob/buoy buoymanager.py |
Date: |
Thu, 19 Jun 2003 07:58:41 -0400 |
CVSROOT: /cvsroot/libvob
Module name: libvob
Branch:
Changes by: Matti Katila <address@hidden> 03/06/19 07:58:41
Modified files:
vob/buoy : buoymanager.py
Log message:
eventhandling sketching
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/vob/buoy/buoymanager.py.diff?tr1=1.30&tr2=1.31&r1=text&r2=text
Patches:
Index: libvob/vob/buoy/buoymanager.py
diff -u libvob/vob/buoy/buoymanager.py:1.30 libvob/vob/buoy/buoymanager.py:1.31
--- libvob/vob/buoy/buoymanager.py:1.30 Mon Jun 9 17:48:53 2003
+++ libvob/vob/buoy/buoymanager.py Thu Jun 19 07:58:40 2003
@@ -69,7 +69,8 @@
"""
self.mainNode = mainNode
self.connectors = connectors
- def getMainNode(self): return self.mainNode
+ def getMainNode(self):
+ return self.mainNode
def _nadir(self, cs):
n = self.vs.coords.nadirUnitSq(cs, self.nadirCS)
self.vs.matcher.add(cs, n, "NADIR")
@@ -201,26 +202,23 @@
class MultiBuoyManager:
- def __init__(self, mainNodes, connectors, geometer, context):
+ def __init__(self, mainNodes, connectors, geometer, eventHandler=None,
context=None):
self.singles = [
SingleFocusManager(i, connectors) for i in mainNodes]
self.connectors = connectors
self.geometer = geometer
self.replaceScene = None
+ self.events = eventHandler
self.context = context
- self.context.initMainNodes(len(mainNodes))
- self.lastIndex = 0
def key(self, key):
if self.geometer.key(key):
- return
- index = self.lastIndex
- self.context.setMainNodeIndex(index)
- self.singles[index].mainNode.keystroke(key)
- vob.AbstractUpdateManager.chg()
- pass
+ return
+ if self.events != None:
+ self.events.key(self, key)
def getVs(self):
return self.vs;
-
+ def getSingles(self):
+ return self.singles
def scene(self, vs):
if self.replaceScene:
sc = self.replaceScene
@@ -238,7 +236,8 @@
geoms = self.geometer.place(vs)
- self.context.renderContext(vs, 0)
+ if self.context != None:
+ self.context.renderContext(vs, 0)
for i in range(0, len(self.singles)):
self.context.setMainNodeIndex(i)
self.singles[i].drawscene(vs,
@@ -247,6 +246,10 @@
nadirCS)
def mouse(self, ev):
+ if self.events != None:
+ self.events.mouse(self, ev)
+ return
+
if hasattr(self.geometer, 'mouse') and \
self.geometer.mouse(ev, self.vs):
return
@@ -265,6 +268,7 @@
single.followLink(link)
vob.AbstractUpdateManager.chg()
return
+
# Fall through if no link - need main node
for i in range(0, len(self.singles)):
if self.singles[i].mainNode.mouseClickHit(ev, self.vs, None):
@@ -275,29 +279,6 @@
vob.AbstractUpdateManager.setNoAnimation()
vob.AbstractUpdateManager.chg()
return
-
- # ...then see context
- if ev.getID() != ev.MOUSE_CLICKED: return
- self.context.setMainNodeIndex(self.lastIndex)
- planes = []
- for single in self.singles:
- planes.append(single.getMainNode())
- #newPlanes = jarray.zeros(len(self.singles), 'c')
- newPlanes = self.context.doMouse(ev, self.vs, planes)
- if newPlanes != None and planes != newPlanes:
- for i in range(0, len(newPlanes)):
- self.singles[i] = SingleFocusManager(
- newPlanes[i],
- self.connectors)
- vob.AbstractUpdateManager.chg()
- #else:
- # self.context.setMainNodeIndex(self.lastIndex)
- # if self.singles[self.lastIndex].mainNode.mouse(ev, self.vs, w):
- # self.replaceScene = self.vs
- # vob.AbstractUpdateManager.setNoAnimation()
- # vob.AbstractUpdateManager.chg()
-
-
vob.impl.gl.GLScreen.dbg = 0
- [Gzz-commits] libvob/vob/buoy buoymanager.py, Benja Fallenstein, 2003/06/07
- [Gzz-commits] libvob/vob/buoy buoymanager.py, Benja Fallenstein, 2003/06/07
- [Gzz-commits] libvob/vob/buoy buoymanager.py, Benja Fallenstein, 2003/06/08
- [Gzz-commits] libvob/vob/buoy buoymanager.py, Benja Fallenstein, 2003/06/09
- [Gzz-commits] libvob/vob/buoy buoymanager.py,
Matti Katila <=
- [Gzz-commits] libvob/vob/buoy buoymanager.py, Matti Katila, 2003/06/24
- [Gzz-commits] libvob/vob/buoy buoymanager.py, Matti Katila, 2003/06/25
- [Gzz-commits] libvob/vob/buoy buoymanager.py, Matti Katila, 2003/06/26