/[fenfire]/fenfire/org/fenfire/demo/buoyoing.py
ViewVC logotype

Diff of /fenfire/org/fenfire/demo/buoyoing.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.86 by mudyc, Fri Jun 27 14:00:34 2003 UTC revision 1.87 by mudyc, Tue Jul 1 16:33:33 2003 UTC
# Line 54  from org.fenfire.demo.fenpdfcontext impo Line 54  from org.fenfire.demo.fenpdfcontext impo
54  import vob  import vob
55  w.setCursor('wait')  w.setCursor('wait')
56    
57    
58  vob.putil.demo.usingNormalBindings = 0  vob.putil.demo.usingNormalBindings = 0
59    
60  vob.buoy.buoymanager.replaceNewScene = vob.putil.demo.replacingScene  vob.buoy.buoymanager.replaceNewScene = vob.putil.demo.replacingScene
# Line 112  if 1: Line 113  if 1:
113    
114  textstyle = vob.GraphicsAPI.getInstance().getTextStyle("sans", 0, 24)  textstyle = vob.GraphicsAPI.getInstance().getTextStyle("sans", 0, 24)
115  textnodeview = ff.view.TextNodeView(fen.txtfunc, textstyle, 1)  textnodeview = ff.view.TextNodeView(fen.txtfunc, textstyle, 1)
116    #textnodeview = ff.view.lava.RSTText(fen.txtfunc, textstyle, 1)
117  pagenodeview = ff.view.PageNodeView(fen.txtfunc)  pagenodeview = ff.view.PageNodeView(fen.txtfunc)
118  dispnodeview = ff.view.DispatchingNodeView(fen.txtfunc,  dispnodeview = ff.view.DispatchingNodeView(fen.txtfunc,
119                                             textnodeview,                                             textnodeview,
120                                             pagenodeview)                                             pagenodeview)
121  cached = ff.swamp.CachedNodeFunction(50, fen.constgraph, dispnodeview)  #cached = ff.swamp.CachedNodeFunction(50, fen.constgraph, dispnodeview)
122  nodeview = ff.view.lava.ContextNodeView(cached, dispnodeview)  nodeview = ff.view.lava.ContextNodeView(dispnodeview, fen.constgraph, 150)
123  view = ff.view.CanvasView2D(fen, nodeview)  view = ff.view.CanvasView2D(fen, nodeview)
124  view.cull = 1  view.cull = 1
125  paperview = ff.view.PaperView2D(vob.putil.demowindow.w, view)  paperview = ff.view.PaperView2D(vob.putil.demowindow.w, view)
126  irregu = ff.view.IrregularViewportView2D(paperview)  selection = ff.view.AreaSelectingView2D(paperview)
127    irregu = ff.view.IrregularViewportView2D(selection)
128    
129  ff.view.buoy.NodeType2D.effigy = 0  ff.view.buoy.NodeType2D.effigy = 0
130  ff.view.buoy.NodeType2DFull.effigy = 0  ff.view.buoy.NodeType2DFull.effigy = 0
131    
132  main_ctrl = ff.util.ControlBinding()  main_ctrl = ff.util.ControlBinding()
133  node_ctrl = ff.util.ControlBinding()  node_ctrl = ff.util.ControlBinding()
134  ctrl = PlaneDispatcher(main_ctrl, node_ctrl, fen.graph, ppAct)  ctrlkey_ctrl = ff.util.ControlBinding()
135    ctrl = ControlsDispatcher(main_ctrl, node_ctrl, ctrlkey_ctrl, fen.graph, ppAct)
136    
137  #context = ff.view.lava.FenPDFContext(fen, ppAct, nodeview, ctrl)  #context = ff.view.lava.FenPDFContext(fen, ppAct, nodeview, ctrl)
138  context = Context(w, fen, ppAct, nodeview, ctrl)  context = Context(w, fen, ppAct, nodeview, ctrl, selection)
139    
140  context.initMainNodes(2)  context.initMainNodes(2)
141  nodeview.setContext(context)  nodeview.setContext(context)
# Line 147  ff.view.buoy.AbstractMainNode2D.context Line 151  ff.view.buoy.AbstractMainNode2D.context
151    
152  # Default controls  # Default controls
153    
 selectview = None  
   
154  ctrl.setContext(context)  ctrl.setContext(context)
155  main_ctrl.add(MovePanFast(context, selectview), -1, ctrl.WHEEL, 7,0, ctrl.VERTICAL)  main_ctrl.add(MovePanFast(), -1, ctrl.WHEEL, 7,0, ctrl.VERTICAL)
156  main_ctrl.add(MovePanFast(context, selectview), 1, ctrl.DRAG, 1, 0, ctrl.ALL)  main_ctrl.add(MovePanFast(), 1, ctrl.DRAG, 1, 0, ctrl.ALL)
157  main_ctrl.add(MovePanSlow(), 1, ctrl.CLICK)  main_ctrl.add(MovePanSlow(), 1, ctrl.CLICK)
158  main_ctrl.add(ZoomPan(), 3, ctrl.DRAG, 1, 0, ctrl.VERTICAL)  main_ctrl.add(ZoomPan(), 3, ctrl.DRAG, 1, 0, ctrl.VERTICAL)
159  main_ctrl.add(PanSize(), 3, ctrl.DRAG, 1, 0, ctrl.HORIZONTAL)  main_ctrl.add(PanSize(), 3, ctrl.DRAG, 1, 0, ctrl.HORIZONTAL)
160  main_ctrl.add(UnSelectNodeOnPlane(context), 3, ctrl.CLICK)  main_ctrl.add(UnSelectNodeOnPlane(context), 3, ctrl.CLICK)
161    
162  node_ctrl.add(SelectNodeOnPlane(context), 3, node_ctrl.CLICK)  node_ctrl.add(SelectNodeOnPlane(context), 3, ctrl.CLICK)
163  node_ctrl.add(MoveNodeOnPlane(context), 1, node_ctrl.DRAG)  node_ctrl.add(MoveNodeOnPlane(context), 1, ctrl.DRAG)
   
164    
165    ctrlkey_ctrl.add(SelectArea(context), 1, ctrl.DRAG)
166    
167    
168    
# Line 177  mainNode = ff.view.buoy.MainNode2D(plane Line 179  mainNode = ff.view.buoy.MainNode2D(plane
179  mainNode2 = ff.view.buoy.MainNode2D(planeHome, irregu, ctrl)  mainNode2 = ff.view.buoy.MainNode2D(planeHome, irregu, ctrl)
180  #mainNode = ff.view.buoy.MainNode2D(plane, paperview, ctrl)  #mainNode = ff.view.buoy.MainNode2D(plane, paperview, ctrl)
181    
 #connector = ff.view.buoy.PPConnector(fen, paperviewonly)  
 #connector.hackForTesting = 1  
182    
183  ppconnector = ff.view.buoy.PPConnector(fen, irregu,  ppconnector = ff.view.buoy.PPConnector(fen, irregu,
184                          ff.view.buoy.MainNode2D.MainNode2DFactory(1, ctrl),                          ff.view.buoy.MainNode2D.MainNode2DFactory(1, ctrl),
# Line 189  tconnector = ff.view.buoy.TransclusionCo Line 189  tconnector = ff.view.buoy.TransclusionCo
189  #           ff.view.PaperView2D(vob.putil.demowindow.w,  #           ff.view.PaperView2D(vob.putil.demowindow.w,
190  #                       ff.view.PageScrollView2D()))  #                       ff.view.PageScrollView2D()))
191  pagescroll2d = ff.view.PageScrollView2D()  pagescroll2d = ff.view.PageScrollView2D()
192    
193    
194  tconnector.normalNodeNodeType = ff.view.buoy.NodeType2D(irregu,  tconnector.normalNodeNodeType = ff.view.buoy.NodeType2D(irregu,
195                          ff.view.buoy.MainNode2D.MainNode2DFactory(1, ctrl))                          ff.view.buoy.MainNode2D.MainNode2DFactory(1, ctrl))
196  tconnector.pageImageScrollNodeType = ff.view.buoy.NodeType2DFull(pagescroll2d, ff.view.buoy.FisheyeMainNode2D.FisheyeMainNode2DFactory(ctrl))  tconnector.pageImageScrollNodeType = ff.view.buoy.NodeType2DFull(pagescroll2d, ff.view.buoy.FisheyeMainNode2D.FisheyeMainNode2DFactory(ctrl))
197    
198    
199  class DoubleGeometer:  class DoubleGeometer:
200      def __init__(self, mgr, context):      def __init__(self, mgr, context, nodeview):
201          self.split = .5          self.split = .5
202          self.height = 100          self.height = 100
203          self.width = 100          self.width = 100
204          self.mgr = mgr          self.mgr = mgr
205          self.context = context          self.context = context
206          self.context.setMngr(mgr)          self.context.setMngr(mgr)
207            self.nv = nodeview
208      def _doset(self, vs):      def _doset(self, vs):
209    
210          w,h = vs.size.width, vs.size.height          w,h = vs.size.width, vs.size.height
# Line 290  class DoubleGeometer: Line 293  class DoubleGeometer:
293    
294          if ev.getID() == ev.MOUSE_RELEASED:          if ev.getID() == ev.MOUSE_RELEASED:
295              ctrl.removePressState()              ctrl.removePressState()
296                self.context.states.clean()
297              w.setCursor('default')              w.setCursor('default')
298              return 1              return 1
299          #return 0          #return 0
# Line 301  class DoubleGeometer: Line 305  class DoubleGeometer:
305          planes = []          planes = []
306          for single in self.mgr.singles:          for single in self.mgr.singles:
307              planes.append(single.getMainNode())              planes.append(single.getMainNode())
308          newPlanes = self.context.doMouse(ev, oldvs, planes)          newPlanes = self.context.doMouse(ev, oldvs, planes, self.nv)
309          if newPlanes != None and planes != newPlanes:          if newPlanes != None and planes != newPlanes:
310              for i in range(0, len(newPlanes)):              for i in range(0, len(newPlanes)):
311                  self.mgr.singles[i] = vob.buoy.buoymanager.SingleFocusManager(                  self.mgr.singles[i] = vob.buoy.buoymanager.SingleFocusManager(
# Line 362  class Scene(vob.buoy.buoymanager.MultiBu Line 366  class Scene(vob.buoy.buoymanager.MultiBu
366      def __init__(self):      def __init__(self):
367          vob.buoy.buoymanager.MultiBuoyManager.__init__(self,          vob.buoy.buoymanager.MultiBuoyManager.__init__(self,
368                  [mainNode, mainNode2], [ppconnector, tconnector],                  [mainNode, mainNode2], [ppconnector, tconnector],
369                  DoubleGeometer(self, context),                  DoubleGeometer(self, context, nodeview),
370                  context=context)                  context=context)
371          w.setCursor('default')          w.setCursor('default')
372    

Legend:
Removed from v.1.86  
changed lines
  Added in v.1.87

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26