gzz-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gzz-commits] gzz/gzz/view xubuoy.py


From: Benja Fallenstein
Subject: [Gzz-commits] gzz/gzz/view xubuoy.py
Date: Thu, 03 Oct 2002 14:41:29 -0400

CVSROOT:        /cvsroot/gzz
Module name:    gzz
Changes by:     Benja Fallenstein <address@hidden>      02/10/03 14:41:29

Modified files:
        gzz/view       : xubuoy.py 

Log message:
        First cut at text buoys

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/view/xubuoy.py.diff?tr1=1.19&tr2=1.20&r1=text&r2=text

Patches:
Index: gzz/gzz/view/xubuoy.py
diff -c gzz/gzz/view/xubuoy.py:1.19 gzz/gzz/view/xubuoy.py:1.20
*** gzz/gzz/view/xubuoy.py:1.19 Thu Oct  3 14:31:32 2002
--- gzz/gzz/view/xubuoy.py      Thu Oct  3 14:41:29 2002
***************
*** 78,88 ****
  lineconn = GLRen.createLineConnector(0,0)
  
  class XuPDFBuoy:
!     def __init__(self, linkindex, link, enfoverlap):
        self.cursor = None
        self.link = link
        self.linkindex = linkindex
        self.linkspan = link[linkindex].getList()[0]
        self.mat = enfoverlap.getMatches(link[linkindex])
        l = [m for m in self.mat]
        if len(l) == 0: 
--- 78,90 ----
  lineconn = GLRen.createLineConnector(0,0)
  
  class XuPDFBuoy:
!     def __init__(self, linkindex, link, enfoverlap, cellview, win):
        self.cursor = None
        self.link = link
        self.linkindex = linkindex
        self.linkspan = link[linkindex].getList()[0]
+         self.cellview = cellview
+         self.win = win
        self.mat = enfoverlap.getMatches(link[linkindex])
        l = [m for m in self.mat]
        if len(l) == 0: 
***************
*** 94,108 ****
          if ispdf(self.cell):
            self.view = getCellPDFView(self.cell)
  
!       p = self.linkspan.getLocation()
!       d = self.linkspan.getSize()
!       o = self.linkspan.offset()
!       # print "page, loc, size: ", linkspan.offset(), p, d
!       # print "P0, P1: ",p0, p1
! 
!       self.p0 = self.view.paperpoint(o, p.x, p.y)
!       self.p1 = self.view.paperpoint(o, p.x+d.width, p.y+d.height)
!       self.pctr = [0.5 * (self.p0[i] + self.p1[i]) for i in range(0,2)]
  
        self.eye = 0.2
        self.buoyscale = 400
--- 96,112 ----
          if ispdf(self.cell):
            self.view = getCellPDFView(self.cell)
  
!           p = self.linkspan.getLocation()
!           d = self.linkspan.getSize()
!           o = self.linkspan.offset()
!           # print "page, loc, size: ", linkspan.offset(), p, d
!           # print "P0, P1: ",p0, p1
! 
!           self.p0 = self.view.paperpoint(o, p.x, p.y)
!           self.p1 = self.view.paperpoint(o, p.x+d.width, p.y+d.height)
!           self.pctr = [0.5 * (self.p0[i] + self.p1[i]) for i in range(0,2)]
!         else:
!             pass
  
        self.eye = 0.2
        self.buoyscale = 400
***************
*** 147,167 ****
        # cs1 = vs.coords.buoyOnCircle(main_end_cs, *buoyparams)
        #       vs.matcher.add(cs1, cell.getId()+"__buo") 
  
!       cs1_zoom= vs.coords.distort(cs1, 0, 0, self.eye, self.eye, 
self.buoyscale, self.buoyscale)
!       vs.matcher.add(cs1_zoom, cell.getId()+"__bulg") 
  
!       cs1_trans = vs.coords.translateXY(cs1_zoom, -self.pctr[0], 
-self.pctr[1])
!       # cs1_trans = vs.coords.translateXY(cs1_zoom, 0, 0)
!       vs.matcher.add(cs1_trans, cell.getId()+"__trans") 
  
!       self.cliprect = (self.p0[0], self.p0[1], self.p1[0], self.p1[1])
  
!       self.view.placepapers(vs, cs1_trans, cliprect = self.cliprect,
                fancy = globalusefancypaper, showTessel = globalshowtessel)
  
!       # Then, the xu link connector
  
!       link_end_cs = vs.coords.coordsys(cs1_trans, -20, self.pctr[0], 
self.pctr[1], 0, 0)
  
        vs.matcher.add(main_end_cs, "link"+str(self.link)+str(self.linkindex))
        vs.matcher.add(link_end_cs, "link"+str(self.link)+str(1-self.linkindex))
--- 151,181 ----
        # cs1 = vs.coords.buoyOnCircle(main_end_cs, *buoyparams)
        #       vs.matcher.add(cs1, cell.getId()+"__buo") 
  
!         if hasattr(self, 'pctr'):
!           cs1_zoom= vs.coords.distort(cs1, 0, 0, self.eye, self.eye, 
self.buoyscale, self.buoyscale)
!           vs.matcher.add(cs1_zoom, cell.getId()+"__bulg") 
  
!           cs1_trans = vs.coords.translateXY(cs1_zoom, -self.pctr[0], 
-self.pctr[1])
!           # cs1_trans = vs.coords.translateXY(cs1_zoom, 0, 0)
!           vs.matcher.add(cs1_trans, cell.getId()+"__trans") 
  
!           self.cliprect = (self.p0[0], self.p0[1], self.p1[0], self.p1[1])
  
!           self.view.placepapers(vs, cs1_trans, cliprect = self.cliprect,
                fancy = globalusefancypaper, showTessel = globalshowtessel)
  
!           # Then, the xu link connector
  
!           link_end_cs = vs.coords.coordsys(cs1_trans, -20, self.pctr[0], 
self.pctr[1], 0, 0)
!             
!         else:
!             d = java.awt.Dimension()
!             self.cellview.getDefaultSize(1.1, d)
!             cs1_text = vs.coords.translateXY(cs1, -d.width/2.0, -d.height/2.0)
!             vs.matcher.add(cs1_text, cell.getId()+"__text")
!             self.cellview.place(cell, vs, cs1_text, d.width, d.height, 
self.win, 1)
!             
!             link_end_cs = vs.coords.coordsys(cs1, -20, 0, 0, 0, 0)
  
        vs.matcher.add(main_end_cs, "link"+str(self.link)+str(self.linkindex))
        vs.matcher.add(link_end_cs, "link"+str(self.link)+str(1-self.linkindex))
***************
*** 500,506 ****
        if self.modes[0].context:
            for forwlink in globalforw:
                b = XuPDFBuoy(1, (getattr(forwlink, "from"), forwlink.to),
!                       enfoverlap = enfoverlap)
                b.add(vs, 1, bfforw, maincs = cs1_trans,
                        globalview = self.view,
                        globalusefancypaper = self.usefancypaper,
--- 514,520 ----
        if self.modes[0].context:
            for forwlink in globalforw:
                b = XuPDFBuoy(1, (getattr(forwlink, "from"), forwlink.to),
!                       enfoverlap = enfoverlap, cellview=self.cv, win=self.win)
                b.add(vs, 1, bfforw, maincs = cs1_trans,
                        globalview = self.view,
                        globalusefancypaper = self.usefancypaper,
***************
*** 509,515 ****
                self.buoys.append(b)
            for backlink in globalback:
                b = XuPDFBuoy(0,(getattr(backlink,"from"), backlink.to),
!                       enfoverlap = enfoverlap)
                b.add(vs, 1, bf, maincs = cs1_trans,
                        globalview = self.view,
                        globalusefancypaper = self.usefancypaper,
--- 523,529 ----
                self.buoys.append(b)
            for backlink in globalback:
                b = XuPDFBuoy(0,(getattr(backlink,"from"), backlink.to),
!                       enfoverlap = enfoverlap, cellview=self.cv, win=self.win)
                b.add(vs, 1, bf, maincs = cs1_trans,
                        globalview = self.view,
                        globalusefancypaper = self.usefancypaper,




reply via email to

[Prev in Thread] Current Thread [Next in Thread]