61 |
|
|
62 |
DIR = 'myFenfire/' |
DIR = 'myFenfire/' |
63 |
os.system('mkdir -p '+DIR) |
os.system('mkdir -p '+DIR) |
|
#pool = storm.impl.TransientPool(java.util.HashSet()) |
|
64 |
pool = storm.impl.DirPool(java.io.File(DIR), java.util.HashSet()) |
pool = storm.impl.DirPool(java.io.File(DIR), java.util.HashSet()) |
65 |
myalph = alph.impl.StormAlph(pool) |
myalph = alph.impl.StormAlph(pool) |
66 |
sc = myalph.addFile(java.io.File('../alph/testdata/test1.pdf'), 'application/pdf') |
sc = myalph.addFile(java.io.File('../alph/testdata/test1.pdf'), 'application/pdf') |
325 |
FenPDFActions(context, 2), context) |
FenPDFActions(context, 2), context) |
326 |
w.setCursor('default') |
w.setCursor('default') |
327 |
|
|
328 |
|
|
329 |
class MovePanFast(ff.util.ControlBinding.AbstractController): |
class MovePanFast(ff.util.ControlBinding.AbstractController): |
330 |
def isChangeable(self): return 1 |
def isChangeable(self): return 1 |
331 |
def change(self, x, y): |
def change(self, x, y): |
338 |
def isChangeable(self): return 0 |
def isChangeable(self): return 0 |
339 |
def controlPoint(self, x, y, scale): |
def controlPoint(self, x, y, scale): |
340 |
self.obj.moveToPoint(int(x),int(y), self.oldVS) |
self.obj.moveToPoint(int(x),int(y), self.oldVS) |
341 |
|
|
342 |
|
class ZoomPan(ff.util.ControlBinding.AbstractController): |
343 |
|
def isChangeable(self): return 1 |
344 |
|
def change(self, x, y): |
345 |
|
self.obj.changeZoom(x+y) |
346 |
|
# because of PanSize() - do not call |
347 |
|
#self.obj.chgFast(self.oldVS) |
348 |
|
|
349 |
|
class PanSize(ff.util.ControlBinding.AbstractController): |
350 |
|
def isChangeable(self): return 1 |
351 |
|
def change(self, x, y): |
352 |
|
self.obj.changeSize(x+y) |
353 |
|
self.obj.chgFast(self.oldVS) |
354 |
|
|
355 |
class FenPDFActions: |
class FenPDFActions: |
356 |
def __init__(self, context, mainNodes): |
def __init__(self, context, mainNodes): |
357 |
self.context = context |
self.context = context |
|
context = context |
|
358 |
self.context.initMainNodes(mainNodes) |
self.context.initMainNodes(mainNodes) |
359 |
self.lastIndex = 0 |
self.lastIndex = 0 |
360 |
|
|
361 |
c = self.controlMains = ff.util.ControlBinding() |
c = self.controlMains = ff.util.ControlBinding() |
362 |
c.add(MovePanFast(), -1, c.WHEEL, 7,1) |
c.add(MovePanFast(), -1, c.WHEEL, 7,0, c.VERTICAL) |
363 |
c.add(MovePanFast(), 1, c.DRAG, 1.4, 1) |
c.add(MovePanFast(), 1, c.DRAG, 1.4, 0, c.ALL) |
364 |
c.add(MovePanSlow(), 1, c.CLICK, 1, 1) |
c.add(MovePanSlow(), 1, c.CLICK) |
365 |
# c.dbg=1 |
c.add(ZoomPan(), 3, c.DRAG, 1, 0, c.VERTICAL) |
366 |
|
c.add(PanSize(), 3, c.DRAG, 1, 0, c.HORIZONTAL) |
367 |
|
|
368 |
|
#c.dbg=1 |
369 |
self.controls = [ self.controlMains ] |
self.controls = [ self.controlMains ] |
370 |
|
|
371 |
def key(self, mngr, key): |
def key(self, mngr, key): |
388 |
for ctrl in self.controls: |
for ctrl in self.controls: |
389 |
ctrl.removePressState() |
ctrl.removePressState() |
390 |
return |
return |
391 |
if ev.getID() == ev.MOUSE_PRESSED: |
if ev.getID() == ev.MOUSE_DRAGGED: |
392 |
self.oldEv = ev |
for ctrl in self.controls: |
393 |
|
if ctrl.hasPressState(): |
394 |
|
ctrl.handleEvent(None, ev, mngr.vs) |
395 |
|
mngr.replaceScene = mngr.vs |
396 |
|
vob.AbstractUpdateManager.setNoAnimation() |
397 |
|
vob.AbstractUpdateManager.chg() |
398 |
|
return |
399 |
|
|
400 |
### If there exist a buoy jump over there |
### If there exist a buoy jump over there |
401 |
for single in mngr.singles: |
for single in mngr.singles: |
402 |
link = single.cs.get(cs, None) |
link = single.cs.get(cs, None) |
403 |
if link != None: |
if link != None: |
404 |
# print "IN CS: ",cs, link |
# pa("IN CS: ",cs, link) |
405 |
if hasattr(mngr.geometer, 'buoyMouse') and \ |
if hasattr(mngr.geometer, 'buoyMouse') and \ |
406 |
mngr.geometer.buoyMouse(mngr, ev, single, link): |
mngr.geometer.buoyMouse(mngr, ev, single, link): |
407 |
return |
return |
417 |
if mngr.singles[i].mainNode.isHitInsidePlane(x,y,mngr.vs): |
if mngr.singles[i].mainNode.isHitInsidePlane(x,y,mngr.vs): |
418 |
self.context.setMainNodeIndex(i) |
self.context.setMainNodeIndex(i) |
419 |
self.lastIndex = i |
self.lastIndex = i |
|
|
|
420 |
if self.controlMains.handleEvent(mngr.singles[i].mainNode, ev, mngr.vs): |
if self.controlMains.handleEvent(mngr.singles[i].mainNode, ev, mngr.vs): |
421 |
mngr.replaceScene = mngr.vs |
mngr.replaceScene = mngr.vs |
422 |
vob.AbstractUpdateManager.setNoAnimation() |
vob.AbstractUpdateManager.setNoAnimation() |
433 |
newPlanes = self.context.doMouse(ev, mngr.vs, planes) |
newPlanes = self.context.doMouse(ev, mngr.vs, planes) |
434 |
if newPlanes != None and planes != newPlanes: |
if newPlanes != None and planes != newPlanes: |
435 |
for i in range(0, len(newPlanes)): |
for i in range(0, len(newPlanes)): |
436 |
mngr.singles[i] = SingleFocusManager( |
mngr.singles[i] = vob.buoy.buoymanager.SingleFocusManager( |
437 |
newPlanes[i], |
newPlanes[i], |
438 |
mngr.connectors) |
mngr.connectors) |
439 |
vob.AbstractUpdateManager.chg() |
vob.AbstractUpdateManager.chg() |