/[fenfire]/fenfire/org/fenfire/fenpdf/fenpdfcontext.py
ViewVC logotype

Diff of /fenfire/org/fenfire/fenpdf/fenpdfcontext.py

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

revision 1.27 by tjl, Mon Aug 25 09:28:50 2003 UTC revision 1.28 by mudyc, Mon Aug 25 21:26:21 2003 UTC
# Line 101  class ContextStates: Line 101  class ContextStates:
101          pass          pass
102    
103  class Context(ff.view.lava.ContextNodeView.Context,  class Context(ff.view.lava.ContextNodeView.Context,
104                ff.view.buoy.AbstractMainNode2D.Context,                ff.view.buoy.AbstractMainNode2D.Context):
               ff.view.lava.TextHandler.Context):  
105      def __init__(self, win, fen, pp, filename):      def __init__(self, win, fen, pp, filename):
106          global w          global w
107          w = win          w = win
# Line 116  class Context(ff.view.lava.ContextNodeVi Line 115  class Context(ff.view.lava.ContextNodeVi
115          return self.states.fastChg          return self.states.fastChg
116    
117      # call back from AbstractMainNode2D      # call back from AbstractMainNode2D
118      def mainNodeToBeRender(self, vs, into, main):      def mainNodeToBeRender(self, vs, into, mainNode):
119          self.selection = ff.util.lava.view.getView(main, ff.view.AreaSelectingView2D)          self.selection = ff.util.lava.view.getView(mainNode, ff.view.AreaSelectingView2D)
120    
121                    if mainNode != self.states.buoymanager.getLastMain(): return
   
         #self.super.mainNodeToBeRender(vs, into, main)  
122    
123          # draw cursor          # draw cursor
124          if not self.states.cursor.hasAccursed() and main == self.fenPDF.views.getBuoyManager().getLastMain():          mainNode = self.states.buoymanager.getLastMain()
125              tmp = jarray.zeros(2, 'f')          canvas = ff.util.lava.view.getView(mainNode, ff.view.CanvasView2D)
126              vs.coords.getSqSize(into, tmp)          if not isinstance(canvas, ff.view.CanvasView2D): return
             cursorCS = vs.orthoBoxCS(into, "CURSOR", 0,  
                                      tmp[0]/2, tmp[1]/2, 1,1, tmp[0]/12, tmp[1]/12)  
             vs.put(vob.vobs.LineVob(0,0,0,1, java.awt.Color.darkGray), cursorCS)  
127                            
128            xy = jarray.zeros(2, 'f')
129            if not self.states.cursor.hasAccursed():
130                focus = mainNode.getFocus()
131                cs = vs.matcher.getCS(into, 'canvasview_conc')
132                cs = vs.coords.orthoBox(cs,0, focus.getPanX(), focus.getPanY(), 1,1, 1,1)
133            else:
134                # draw the cursor in somewhere where node is.
135                containerCS = canvas.getContainerCS(vs, into)
136                cs = vs.matcher.getCS(containerCS, self.states.cursor.getAccursed())
137                if cs < 0: return
138    
139                viewFunction = self.states.fenPDF.views.getMultiplexerNodeContentFunction()
140                p = viewFunction.f(self.states.fen.graph, self.states.cursor.getAccursed())
141                if isinstance(p, vob.lava.placeable.TextPlaceable):
142                    p.getCursorXY(self.states.cursor.getCursorOffset(), xy)
143                else: return
144                    
145            # XXX ugly
146            height = 24
147            cs = vs.coords.ortho(cs, 0,xy[0],xy[1], 1, -height)
148            vs.put(vob.vobs.ContinuousLineVob(5, [0,0,0 , 0,1,0]), cs)
149                    
150    
151    

Legend:
Removed from v.1.27  
changed lines
  Added in v.1.28

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