22 |
|
|
23 |
from org import fenfire as ff |
from org import fenfire as ff |
24 |
from org.fenfire.vocab import CANVAS2D, RDF |
from org.fenfire.vocab import CANVAS2D, RDF |
25 |
|
import org.nongnu.libvob as vob |
26 |
|
|
27 |
dbg = 0 |
dbg = 0 |
28 |
|
|
36 |
|
|
37 |
######## Actions to control pan of main nodes etc. |
######## Actions to control pan of main nodes etc. |
38 |
|
|
39 |
class MovePanFast(ff.util.ControlBinding.AbstractController): |
class MovePanFast(AbstractContextController): |
40 |
def isChangeable(self): return 1 |
def isChangeable(self): return 1 |
41 |
def change(self, x, y): |
def change(self, x, y): |
42 |
if dbg: p('move pan fast') |
if dbg: p('move pan fast') |
43 |
f = self.obj.getFocus() |
f = self.obj.getFocus() |
44 |
fX, fY = f.getPanX(), f.getPanY() |
fX, fY = f.getPanX(), f.getPanY() |
45 |
f.setPan( fX-x/f.zoom, fY-y/f.zoom) |
f.setPan( fX-x/f.zoom, fY-y/f.zoom) |
46 |
self.obj.chgFast(self.oldVS) |
self.context.chgFast(self.oldVS) |
47 |
|
|
48 |
class MovePanSlow(ff.util.ControlBinding.AbstractController): |
class MovePanSlow(ff.util.ControlBinding.AbstractController): |
49 |
def isChangeable(self): return 0 |
def isChangeable(self): return 0 |
58 |
### because of PanSize() - do not call |
### because of PanSize() - do not call |
59 |
#self.obj.chgFast(self.oldVS) |
#self.obj.chgFast(self.oldVS) |
60 |
|
|
61 |
class PanSize(ff.util.ControlBinding.AbstractController): |
class PanSize(AbstractContextController): |
62 |
def isChangeable(self): return 1 |
def isChangeable(self): return 1 |
63 |
def change(self, x, y): |
def change(self, x, y): |
64 |
self.obj.changeSize(x+y) |
self.obj.changeSize(x+y) |
65 |
self.obj.chgFast(self.oldVS) |
self.context.chgFast(self.oldVS) |
66 |
|
|
67 |
class UnSelectNodeOnPlane(AbstractContextController): |
class UnSelectNodeOnPlane(AbstractContextController): |
68 |
def isChangeable(self): return 0 |
def isChangeable(self): return 0 |
69 |
def controlPoint(self, x, y, scale): |
def controlPoint(self, x, y, scale): |
70 |
self.context.setAccursed(None) |
self.context.setAccursed(None) |
71 |
|
|
72 |
|
class ShowMouseMenu(AbstractContextController): |
73 |
|
def isChangeable(self): return 0 |
74 |
|
def controlPoint(self, x, y, scale): |
75 |
|
self.context.mousemenu.showList(x,y) |
76 |
|
vob.AbstractUpdateManager.setNoAnimation() |
77 |
|
|
78 |
####### Actions to control nodes on main node plane |
####### Actions to control nodes on main node plane |
79 |
|
|
96 |
ox = ff.util.RDFUtil.getInt(g, node, CANVAS2D.x) |
ox = ff.util.RDFUtil.getInt(g, node, CANVAS2D.x) |
97 |
oy = ff.util.RDFUtil.getInt(g, node, CANVAS2D.y) |
oy = ff.util.RDFUtil.getInt(g, node, CANVAS2D.y) |
98 |
self.obj[3].moveNote(node, int(ox+x/f.zoom), int(oy+y/f.zoom) ) |
self.obj[3].moveNote(node, int(ox+x/f.zoom), int(oy+y/f.zoom) ) |
99 |
|
self.context.chgFast(self.oldVS) |
100 |
|
|
101 |
|
|
102 |
####### Actions to control selection (Ctrl pressed) |
####### Actions to control selection (Ctrl pressed) |
109 |
xy = self.obj.getXYHit(self.oldVS, x,y) |
xy = self.obj.getXYHit(self.oldVS, x,y) |
110 |
oldXY = self.context.states.getPressPans() |
oldXY = self.context.states.getPressPans() |
111 |
self.context.selection.setArea(oldXY[0], oldXY[1], xy[0], xy[1]) |
self.context.selection.setArea(oldXY[0], oldXY[1], xy[0], xy[1]) |
112 |
self.obj.chgFast(self.oldVS) |
self.context.chgFast(self.oldVS) |
113 |
|
|
114 |
|
|
115 |
####### Dispatcher for plane events etc. |
####### Dispatcher for plane events etc. |