/[fenfire]/fenfire/org/fenfire/view/lava/mindMapView2D.py
ViewVC logotype

Diff of /fenfire/org/fenfire/view/lava/mindMapView2D.py

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

revision 1.8 by mudyc, Wed Aug 13 10:57:41 2003 UTC revision 1.9 by humppake, Wed Aug 13 22:58:29 2003 UTC
# Line 22  dbg = 0 Line 22  dbg = 0
22  paper = vob.gl.SpecialPapers.selectionPaper(None);  paper = vob.gl.SpecialPapers.selectionPaper(None);
23  whiteground = vob.gl.GLRen.createFixedPaperQuad(paper, 0, 0, 1, 1, 0, 10, 10, 10);  whiteground = vob.gl.GLRen.createFixedPaperQuad(paper, 0, 0, 1, 1, 0, 10, 10, 10);
24    
   
25  class MindMapMainNode2D(ff.view.buoy.MainNode2D):  class MindMapMainNode2D(ff.view.buoy.MainNode2D):
26      def __init__(self, plane, view2d, focus, controller):      def __init__(self, plane, view2d, focus, controller):
27          ff.view.buoy.MainNode2D.__init__(self, plane, view2d, controller);          ff.view.buoy.MainNode2D.__init__(self, plane, view2d, controller);
28            self.context = None
29            
30      def init(self, fen, nodeview):      def init(self, fen, nodeview):
31          self.fen, self.viewfunc = fen, nodeview          self.fen, self.viewfunc = fen, nodeview
32                    
# Line 69  class MindMapMainNode2D(ff.view.buoy.Mai Line 69  class MindMapMainNode2D(ff.view.buoy.Mai
69      def place(self, node, vs, cs):      def place(self, node, vs, cs):
70          p = self.viewfunc.f(self.fen.graph, node)          p = self.viewfunc.f(self.fen.graph, node)
71    
72          cs_background = vs.orthoCS(cs,'WHITE_GROUND',0, 0,0, p.getWidth(), p.getHeight())          cs_background = vs.orthoCS(cs,'WHITE_GROUND',0, 0, 0, p.getWidth(), p.getHeight())
73          vs.put(whiteground, cs_background)          vs.put(whiteground, cs_background)
74                    
75          cs = vs.orthoBoxCS(cs,node,0, 0,0, 1,1, p.getWidth(), p.getHeight())          cs = vs.orthoBoxCS(cs,node,0, 0, 0, 1,1, p.getWidth(), p.getHeight())
76          p.place(vs, cs)          p.place(vs, cs)
77          vs.coords.activate(cs)          vs.coords.activate(cs)
78    
79            # draw cursor
80            if self.context and self.context.getAccursed() == node:
81                self.context.drawCursor(vs, node, cs)
82    
83  class MindNet:  class MindNet:
84      """ Keeps up nodes in hashmap of 'linked to' nodes in hashmap.      """ Keeps up nodes in hashmap of 'linked to' nodes in hashmap.
85          Point-to-point list of connections.    """          Point-to-point list of connections.    """
# Line 102  class MindMapView2D(ff.view.View2D): Line 106  class MindMapView2D(ff.view.View2D):
106          self.alphContent = ff.util.AlphContent(fen)          self.alphContent = ff.util.AlphContent(fen)
107          self.box = None          self.box = None
108          self.nodef = nodef          self.nodef = nodef
109            self.context = None
110            
111          ### fillet set up          ### fillet set up
112          self.angle = 1          self.angle = 1
113          self.thick = 1          self.thick = 1
# Line 208  class MindMapView2D(ff.view.View2D): Line 213  class MindMapView2D(ff.view.View2D):
213              vs.matcher.add(self.matchingParent, cs, node)              vs.matcher.add(self.matchingParent, cs, node)
214              self.putNodeContent(vs, node, cs)              self.putNodeContent(vs, node, cs)
215    
   
216      def getLinks(self, fen, node):      def getLinks(self, fen, node):
217          """ Get all links available with node."""          """ Get all links available with node."""
218          links = []          links = []
# Line 268  class MindMapView2D(ff.view.View2D): Line 272  class MindMapView2D(ff.view.View2D):
272          x,y = xy[0], xy[1]          x,y = xy[0], xy[1]
273    
274          s = self.getNodeSize(deepnes)          s = self.getNodeSize(deepnes)
275          print 'size', s          if (dbg): print 'size', s
276          cs = vs.orthoBoxCS(into,'foo'+str(key),0, x-s/2.0,y-s/2.0, 1,1, s,s)          cs = vs.orthoBoxCS(into,'foo'+str(key),0, x-s/2.0,y-s/2.0, 1,1, s,s)
277          if dbg:          if dbg:
278              p('come:',x0,y0, angle, dirAngle)              p('come:',x0,y0, angle, dirAngle)
# Line 300  class MindMapView2D(ff.view.View2D): Line 304  class MindMapView2D(ff.view.View2D):
304          p.place(vs, cs)          p.place(vs, cs)
305          vs.coords.activate(cs)          vs.coords.activate(cs)
306    
307            # draw cursor
308            if self.context and self.context.getAccursed() == node:
309                into = jarray.zeros(3, 'f')
310                vs.coords.transformPoints3(cs, [0,0,0], into)
311                cs = vs.orthoCS(0, 0, -100, into[0], into[1], 1, 1)
312                self.context.drawCursor(vs, node, cs)
313    
314    

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9

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