[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gzz-commits] fenfire/org/fenfire/demo buoyoing.py
From: |
Matti Katila |
Subject: |
[Gzz-commits] fenfire/org/fenfire/demo buoyoing.py |
Date: |
Sun, 22 Jun 2003 12:17:18 -0400 |
CVSROOT: /cvsroot/fenfire
Module name: fenfire
Branch:
Changes by: Matti Katila <address@hidden> 03/06/22 12:17:18
Modified files:
org/fenfire/demo: buoyoing.py
Log message:
more sketching
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/fenfire/fenfire/org/fenfire/demo/buoyoing.py.diff?tr1=1.75&tr2=1.76&r1=text&r2=text
Patches:
Index: fenfire/org/fenfire/demo/buoyoing.py
diff -u fenfire/org/fenfire/demo/buoyoing.py:1.75
fenfire/org/fenfire/demo/buoyoing.py:1.76
--- fenfire/org/fenfire/demo/buoyoing.py:1.75 Thu Jun 19 11:24:00 2003
+++ fenfire/org/fenfire/demo/buoyoing.py Sun Jun 22 12:17:18 2003
@@ -61,7 +61,6 @@
DIR = 'myFenfire/'
os.system('mkdir -p '+DIR)
-#pool = storm.impl.TransientPool(java.util.HashSet())
pool = storm.impl.DirPool(java.io.File(DIR), java.util.HashSet())
myalph = alph.impl.StormAlph(pool)
sc = myalph.addFile(java.io.File('../alph/testdata/test1.pdf'),
'application/pdf')
@@ -326,6 +325,7 @@
FenPDFActions(context, 2), context)
w.setCursor('default')
+
class MovePanFast(ff.util.ControlBinding.AbstractController):
def isChangeable(self): return 1
def change(self, x, y):
@@ -338,19 +338,34 @@
def isChangeable(self): return 0
def controlPoint(self, x, y, scale):
self.obj.moveToPoint(int(x),int(y), self.oldVS)
-
+
+class ZoomPan(ff.util.ControlBinding.AbstractController):
+ def isChangeable(self): return 1
+ def change(self, x, y):
+ self.obj.changeZoom(x+y)
+ # because of PanSize() - do not call
+ #self.obj.chgFast(self.oldVS)
+
+class PanSize(ff.util.ControlBinding.AbstractController):
+ def isChangeable(self): return 1
+ def change(self, x, y):
+ self.obj.changeSize(x+y)
+ self.obj.chgFast(self.oldVS)
+
class FenPDFActions:
def __init__(self, context, mainNodes):
self.context = context
- context = context
self.context.initMainNodes(mainNodes)
self.lastIndex = 0
c = self.controlMains = ff.util.ControlBinding()
- c.add(MovePanFast(), -1, c.WHEEL, 7,1)
- c.add(MovePanFast(), 1, c.DRAG, 1.4, 1)
- c.add(MovePanSlow(), 1, c.CLICK, 1, 1)
-# c.dbg=1
+ c.add(MovePanFast(), -1, c.WHEEL, 7,0, c.VERTICAL)
+ c.add(MovePanFast(), 1, c.DRAG, 1.4, 0, c.ALL)
+ c.add(MovePanSlow(), 1, c.CLICK)
+ c.add(ZoomPan(), 3, c.DRAG, 1, 0, c.VERTICAL)
+ c.add(PanSize(), 3, c.DRAG, 1, 0, c.HORIZONTAL)
+
+ #c.dbg=1
self.controls = [ self.controlMains ]
def key(self, mngr, key):
@@ -373,14 +388,20 @@
for ctrl in self.controls:
ctrl.removePressState()
return
- if ev.getID() == ev.MOUSE_PRESSED:
- self.oldEv = ev
-
+ if ev.getID() == ev.MOUSE_DRAGGED:
+ for ctrl in self.controls:
+ if ctrl.hasPressState():
+ ctrl.handleEvent(None, ev, mngr.vs)
+ mngr.replaceScene = mngr.vs
+ vob.AbstractUpdateManager.setNoAnimation()
+ vob.AbstractUpdateManager.chg()
+ return
+
### If there exist a buoy jump over there
for single in mngr.singles:
link = single.cs.get(cs, None)
if link != None:
- # print "IN CS: ",cs, link
+ # pa("IN CS: ",cs, link)
if hasattr(mngr.geometer, 'buoyMouse') and \
mngr.geometer.buoyMouse(mngr, ev, single, link):
return
@@ -396,7 +417,6 @@
if mngr.singles[i].mainNode.isHitInsidePlane(x,y,mngr.vs):
self.context.setMainNodeIndex(i)
self.lastIndex = i
-
if self.controlMains.handleEvent(mngr.singles[i].mainNode, ev,
mngr.vs):
mngr.replaceScene = mngr.vs
vob.AbstractUpdateManager.setNoAnimation()
@@ -413,7 +433,7 @@
newPlanes = self.context.doMouse(ev, mngr.vs, planes)
if newPlanes != None and planes != newPlanes:
for i in range(0, len(newPlanes)):
- mngr.singles[i] = SingleFocusManager(
+ mngr.singles[i] = vob.buoy.buoymanager.SingleFocusManager(
newPlanes[i],
mngr.connectors)
vob.AbstractUpdateManager.chg()
- [Gzz-commits] fenfire/org/fenfire/demo buoyoing.py, Benja Fallenstein, 2003/06/07
- [Gzz-commits] fenfire/org/fenfire/demo buoyoing.py, Benja Fallenstein, 2003/06/08
- [Gzz-commits] fenfire/org/fenfire/demo buoyoing.py, Benja Fallenstein, 2003/06/08
- [Gzz-commits] fenfire/org/fenfire/demo buoyoing.py, Benja Fallenstein, 2003/06/09
- [Gzz-commits] fenfire/org/fenfire/demo buoyoing.py, Benja Fallenstein, 2003/06/09
- [Gzz-commits] fenfire/org/fenfire/demo buoyoing.py, Benja Fallenstein, 2003/06/09
- [Gzz-commits] fenfire/org/fenfire/demo buoyoing.py, Benja Fallenstein, 2003/06/09
- [Gzz-commits] fenfire/org/fenfire/demo buoyoing.py, Benja Fallenstein, 2003/06/09
- [Gzz-commits] fenfire/org/fenfire/demo buoyoing.py, Matti Katila, 2003/06/14
- [Gzz-commits] fenfire/org/fenfire/demo buoyoing.py, Benja Fallenstein, 2003/06/19
- [Gzz-commits] fenfire/org/fenfire/demo buoyoing.py,
Matti Katila <=
- [Gzz-commits] fenfire/org/fenfire/demo buoyoing.py, Matti Katila, 2003/06/23
- [Gzz-commits] fenfire/org/fenfire/demo buoyoing.py, Tuomas J. Lukka, 2003/06/24
- [Gzz-commits] fenfire/org/fenfire/demo buoyoing.py, Benja Fallenstein, 2003/06/26