gzz-commits
[Top][All Lists]
Advanced

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

[Gzz-commits] gzz ./TODO gfx/demo/buoyoing.py gfx/util/demo.p...


From: Tuomas J. Lukka
Subject: [Gzz-commits] gzz ./TODO gfx/demo/buoyoing.py gfx/util/demo.p...
Date: Fri, 07 Feb 2003 03:10:47 -0500

CVSROOT:        /cvsroot/gzz
Module name:    gzz
Changes by:     Tuomas J. Lukka <address@hidden>        03/02/07 03:10:47

Modified files:
        .              : TODO 
        gfx/demo       : buoyoing.py 
        gfx/util       : demo.py 
        gzz/view/buoy  : ScrollblockCellLinker.java buoymanager.py 
                         pagespanNodes.py 

Log message:
        Motion, but slow

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/TODO.diff?tr1=1.564&tr2=1.565&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/demo/buoyoing.py.diff?tr1=1.6&tr2=1.7&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/util/demo.py.diff?tr1=1.13&tr2=1.14&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/view/buoy/ScrollblockCellLinker.java.diff?tr1=1.9&tr2=1.10&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/view/buoy/buoymanager.py.diff?tr1=1.10&tr2=1.11&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/view/buoy/pagespanNodes.py.diff?tr1=1.17&tr2=1.18&r1=text&r2=text

Patches:
Index: gzz/TODO
diff -u gzz/TODO:1.564 gzz/TODO:1.565
--- gzz/TODO:1.564      Thu Feb  6 17:26:15 2003
+++ gzz/TODO    Fri Feb  7 03:10:46 2003
@@ -16,10 +16,11 @@
 HT03 deadline:
     tjl:
        - the great buoy redesign
+           - xu links
            - make pagespan nodes show just the span, when
              shown as buoys!
-           - make buoys return the anchor
            - make buoymanager draw connections
+           - make buoys return the anchor
            - figure out how scrollblock nodes shall be linked back 
              with right
              coordsys
@@ -40,7 +41,12 @@
            1) several articles
            2) pp canvases with transclusions from articles
               and user comments
+           3) zz structure -- important to show that different types
+              of local structure (zz, ppcanvas, entirescrollblock)
+              can be integrated to the global buoy structure
          Must demonstrate the novel linkabilities.
+       - UML diagrams of the structures involved (not real classes,
+         pseudoclasses; e.g. fluidMediaUnit (e.g. character, image pixel, ...))
     humppake:
        - fix umltool graphics to be closer to the UML 3amigos books
        - umltool paper dl 15.2., but should actually be done in the late Jan
@@ -51,6 +57,8 @@
     mudyc:
        - reorganize PP so that there are distinct classes that implement
          CellBuoyViewNodeType and BuoyViewMainNode. Talk to Tjl
+       - add animation to buoymanager. This time it should be easy 
+         with both experience from PP and the fixes to the infrastructure.
     humppake+vegai:
        - reST -> latex: proper latex formatting (style file/abstract/etc.)
          See http://www.ht03.org/submissions.html#formatting
Index: gzz/gfx/demo/buoyoing.py
diff -u gzz/gfx/demo/buoyoing.py:1.6 gzz/gfx/demo/buoyoing.py:1.7
--- gzz/gfx/demo/buoyoing.py:1.6        Thu Feb  6 07:15:39 2003
+++ gzz/gfx/demo/buoyoing.py    Fri Feb  7 03:10:46 2003
@@ -13,10 +13,9 @@
 from gzz.view.buoy import BuoyLinkListener, ScrollblockCellLinker
 from gzz.view.buoy import BuoyAdaptor
 
+buoymanager.replaceNewScene = replaceNewScene
 
-# The test pageimagescroll
-id = "01ACE8A2E202A26072012715A94A270CD012F9B0F2"
-sb = gzz.media.impl.PageImageScroll(None, gzz.mediaserver.Mediaserver.Id(id))
+xulinks = 1
 
 # Create a space
 space = gzz.impl.ModularSpace(*test.tools.tools.spaceArgList())
@@ -24,19 +23,6 @@
 dims = [space.getDim(i) for i in [Ids.d_1, Ids.d_2, Ids.d_3]]
 zzNodes.viewcontext.setDims(jarray.array(dims , gzz.Dim))
 
-wholepage = sb.getCurrent().subSpan(0,1)
-span = wholepage.subArea(10, 10, 400, 400)
-
-# Put a piece of the pagespan into it
-cell = space.getHomeCell()
-cell.N(dims[0]).setText("FOO")
-cell.N(dims[0]).setText("osef")
-cell.N(dims[1]).setText("oiuj")
-cell.N(dims[1]).setText("oijew")
-space.getCellTexter().setEnfilade(
-       cell, pagespanNodes.makeEnf(span))
-
-
 # Create the buoy view elements
 scrollblockLinker = ScrollblockCellLinker(space)
 scrollblockLinker.transclusionPageSpanNodeType = (
@@ -47,10 +33,65 @@
 adaptor.cellLinkers = [scrollblockLinker]
 
 
+if xulinks:
+    xuspace = gzz.impl.ModularSpace(*test.tools.tools.spaceArgList())
+    xuindexer = gzz.index.IndexManager.getXuIndexer(xuspace)
+
+    pagescrolls = (
+    gzz.media.impl.PageImageScroll(None, gzz.mediaserver.Mediaserver.Id(
+    
#"0000000008000000E9573F43E00004CB42D4BEFEBAA27C20403F7D57693141B9E4D9A46329AC9C")),
+    "01E1682758ABF63E7833692653A5DE46EA53A6F8AA")),
+    gzz.media.impl.PageImageScroll(None, gzz.mediaserver.Mediaserver.Id(
+    
#"0000000008000000E9573F40460004592C0AC2038D1250E0ED08F865D8C9148654B87A7AA82CC6")),
+    "010DA2A88F8C71B76061AA8F1418C0CC77C3C3200D")),
+    gzz.media.impl.PageImageScroll(None, gzz.mediaserver.Mediaserver.Id(
+    
#"0000000008000000E9573F38AE000410A88E08C0C3AB6E45E102B9921BBE71DC74E1A7492D70AE")),
+    "010D41691A3EC1332F7D7BC81686F80A6D1362EBE9")),
+    )
+    pagespans = [scroll.getCurrent() for scroll in pagescrolls]
+
+    xuindexer.add(gzz.index.XuLink(
+       pagespanNodes.makeEnf(pagespans[0].subSpan(1,2).subArea(0,50,400,200)),
+       pagespanNodes.makeEnf(pagespans[1].subSpan(2,3).subArea(20,500,350,200))
+       ))
+
+    xuindexer.add(gzz.index.XuLink(
+       pagespanNodes.makeEnf(pagespans[2].subSpan(1,2).subArea(0,300,350,300)),
+       
pagespanNodes.makeEnf(pagespans[0].subSpan(2,3).subArea(300,400,300,100)),
+       ))
+
+    scrollblockLinker.xuIndex = xuindexer
+    scrollblockLinker.xulinkPageSpanNodeType = 
pagespanNodes.AnchorPageSpanNodeType(scrollblockLinker)
+
+    # For now, no transclusions there
+    scrollblockLinker.transclusionPageSpanNodeType = None
+
+    mainNodeType = (scrollblockLinker.xulinkPageSpanNodeType, None, 
pagespans[0])
+
+
+else:
+    # The test pageimagescroll
+    id = "01ACE8A2E202A26072012715A94A270CD012F9B0F2"
+    sb = gzz.media.impl.PageImageScroll(None, 
gzz.mediaserver.Mediaserver.Id(id))
+    wholepage = sb.getCurrent().subSpan(0,1)
+    span = wholepage.subArea(10, 10, 400, 400)
+
+    # Put a piece of the pagespan into it
+    cell = space.getHomeCell()
+    cell.N(dims[0]).setText("FOO")
+    cell.N(dims[0]).setText("osef")
+    cell.N(dims[1]).setText("oiuj")
+    cell.N(dims[1]).setText("oijeu")
+    space.getCellTexter().setEnfilade(
+           cell, pagespanNodes.makeEnf(span))
+
+    mainNodeType = (adaptor, None, cell)
+
+
+
 
 class Scene(buoymanager.RealBuoyManager):
     def __init__(self):
-       buoymanager.RealBuoyManager.__init__(self,
-               adaptor, None, cell)
+       buoymanager.RealBuoyManager.__init__(self, *mainNodeType)
 
 currentScene = Scene()
Index: gzz/gfx/util/demo.py
diff -u gzz/gfx/util/demo.py:1.13 gzz/gfx/util/demo.py:1.14
--- gzz/gfx/util/demo.py:1.13   Wed Feb  5 03:14:45 2003
+++ gzz/gfx/util/demo.py        Fri Feb  7 03:10:46 2003
@@ -13,6 +13,7 @@
 #
 # The demos should make an effort to adapt to any window size.
 
+
 import sys
 import os
 
Index: gzz/gzz/view/buoy/ScrollblockCellLinker.java
diff -u gzz/gzz/view/buoy/ScrollblockCellLinker.java:1.9 
gzz/gzz/view/buoy/ScrollblockCellLinker.java:1.10
--- gzz/gzz/view/buoy/ScrollblockCellLinker.java:1.9    Wed Feb  5 09:09:03 2003
+++ gzz/gzz/view/buoy/ScrollblockCellLinker.java        Fri Feb  7 03:10:46 2003
@@ -22,12 +22,19 @@
 
     public gzz.index.Index enfiladeOverlap;
 
+    public gzz.index.XuIndexer xuIndex;
+
     public ScrollblockCellLinker(Space s) {
        enfiladeOverlap = gzz.index.IndexManager.getEnfiladeOverlap(s);
     }
 
     public BuoyViewNodeType transclusionPageSpanNodeType;
 
+    /** Node type to use for showing scrollblocks xulinked to.
+     */
+    public BuoyViewNodeType xulinkPageSpanNodeType;
+
+
     public BuoyViewNodeType cellNodeType;
 
     public void doLinks(Cell c, VobScene vs, int cs, 
@@ -44,13 +51,10 @@
        //
        Enfilade1D enf = ((VStreamCellTexter)c.space.getCellTexter()).
                                getEnfilade(c, null);
-       List l = enf.getList();
-       Set done = new HashSet();
-       for(Iterator i = l.iterator(); i.hasNext(); ) {
+       for(Iterator i = 
gzz.zzutil.Media.getScrollBlockRepresentatives(enf).iterator(); 
+                       i.hasNext(); ) {
            Span s = (Span)i.next();
            ScrollBlock sb = s.getScrollBlock();
-           if(done.contains(sb)) continue;
-           done.add(sb);
            if(s instanceof PageSpan) {
                sb.getCurrent();
 
@@ -59,6 +63,7 @@
            }
        }
     }
+
 
     // XXX Reverse links! Scrollblock to 
 }
Index: gzz/gzz/view/buoy/buoymanager.py
diff -u gzz/gzz/view/buoy/buoymanager.py:1.10 
gzz/gzz/view/buoy/buoymanager.py:1.11
--- gzz/gzz/view/buoy/buoymanager.py:1.10       Thu Feb  6 07:28:00 2003
+++ gzz/gzz/view/buoy/buoymanager.py    Fri Feb  7 03:10:46 2003
@@ -84,13 +84,13 @@
        # print ev
        x, y = ev.getX(), ev.getY()
        cs = self.vs.getCSAt(0, x, y, None)
-       print "IN CS: ",cs
        link = self.cs.get(cs, None)
+       print "IN CS: ",cs, link
        if link == None:
            if self.mainNode.mouse(ev, self.vs):
-               gfx.util.demo.replaceNewScene(self.vs)
+               replaceNewScene(self.vs) # XXX
                gzz.client.AbstractUpdateManager.setNoAnimation()
-           gzz.client.AbstractUpdateManager.chg()
+               gzz.client.AbstractUpdateManager.chg()
        else:
            self.mainNode = link[0].createMainNode(link[1], link[2], self)
            gzz.client.AbstractUpdateManager.chg()
Index: gzz/gzz/view/buoy/pagespanNodes.py
diff -u gzz/gzz/view/buoy/pagespanNodes.py:1.17 
gzz/gzz/view/buoy/pagespanNodes.py:1.18
--- gzz/gzz/view/buoy/pagespanNodes.py:1.17     Thu Feb  6 08:00:11 2003
+++ gzz/gzz/view/buoy/pagespanNodes.py  Fri Feb  7 03:10:46 2003
@@ -44,7 +44,7 @@
        return into
 
 class AnchorPageSpanNodeType(AbstractPageSpanNodeType):
-    def renderBuoy(self, vs, into, linkId, anchorSpan):
+    def renderBuoy(self, vs, into, linkId, anchorSpan, layout):
        # XXX!!!!
        # Irregu!
        # find edges of span
@@ -53,6 +53,8 @@
        pscv.place(makeEnf(sb.getCurrent()), vs, into, 
                    .5, 200);
 
+size = jarray.zeros(3, 'f')
+
 class PageSpanMainNode(BuoyViewMainNode):
     def __init__(self, nodetype, anchorSpan, listener):
        self.nodetype = nodetype
@@ -67,20 +69,71 @@
 
        self.x = xywh[0] + .5 * xywh[2]
        self.y = xywh[1] + .5 * xywh[3]
+    def setShift(self, vs):
+       vs.coords.setTranslateParams(self.shift, -self.x, -self.y)
+
     def renderMain(self, vs, into):
+       self.vs = vs
+       vs.coords.getSqSize(into, size)
+       print "SQ:", size[0], size[1]
+       
+       self.scale = size[1] / self.layout.h
+       self.ctr = vs.translateCS(into, "ORIGIN", .5 * size[0],
+                   .5 * size[1])
+       self.scale = vs.scaleCS(self.ctr, "SCALE", self.scale, self.scale)
+       self.shift = vs.translateCS(self.scale, "TR", -self.x, -self.y)
+                   
 
        # XXX This is not right: the distortion
        # should be done here.
-       self.layout.placeBoxed(vs, into, 1, 200)
+       self.layout.place(vs, self.shift, 1, 200)
+
+       if self.nodetype.scrollBlockLinker.enfiladeOverlap != None:
+           matches = (self.nodetype.scrollBlockLinker
+                               .enfiladeOverlap.getMatches(self.enf))
+           for m in matches:
+               self.listener.link(-1, into, 
+                       self.nodetype.scrollBlockLinker.cellNodeType,
+                       gzz.util.Pair(m, self.scrollBlock), m)
+
+       if self.nodetype.scrollBlockLinker.xuIndex != None:
+           xuIndex = self.nodetype.scrollBlockLinker.xuIndex
+           for dir, index, otherEndName in [
+                       (1, xuIndex.getForwardIndex(), "to"),
+                       (-1, xuIndex.getBackwardIndex(), "from")]:
+               for xulink in index.getMatches(self.enf):
+                   endenf = getattr(xulink, otherEndName)
+                   for repr in 
gzz.zzutil.Media.getScrollBlockRepresentatives(endenf):
+                       self.listener.link(dir, into,
+                               
self.nodetype.scrollBlockLinker.xulinkPageSpanNodeType,
+                               xulink, repr)
 
-       matches = (self.nodetype.scrollBlockLinker
-                           .enfiladeOverlap.getMatches(self.enf))
-       for m in matches:
-           self.listener.link(-1, into, 
-                   self.nodetype.scrollBlockLinker.cellNodeType,
-                   gzz.util.Pair(m, self.scrollBlock), m)
     def mouse(self, mouseEvent, oldVS):
-       pass
+       if mouseEvent.getID() == mouseEvent.MOUSE_CLICKED:
+           print "MOUSE PSPMAIN ",mouseEvent
+           size[0] = mouseEvent.getX()
+           size[1] = mouseEvent.getY()
+           size[2] = 0
+           tmp = jarray.zeros(3, 'f')
+           oldVS.coords.inverseTransformPoints3(self.ctr, size, tmp)
+           print "Ev - ctr: ",mouseEvent, tmp[0], tmp[1], tmp[2]
+           oldVS.coords.inverseTransformPoints3(self.scale, size, tmp)
+           print "Ev - scale: ",mouseEvent, tmp[0], tmp[1], tmp[2]
+
+           oldVS.coords.inverseTransformPoints3(self.shift, size, size)
+           print "Ev: ",size[0], size[1], size[2]
+           print "Self.xy was",self.x,self.y
+           oldVS.coords.transformPoints3(self.shift, size, tmp)
+           print "Retransformed:", tmp[0], tmp[1], tmp[2]
+           self.x = size[0]
+           self.y = size[1]
+           if self.x < 0: self.x = 0
+           if self.y < 0: self.y = 0
+           if self.x > self.layout.w: self.x = self.layout.w
+           if self.y > self.layout.h: self.y = self.layout.h
+           self.setShift(oldVS)
+           gzz.client.AbstractUpdateManager.chg()
+           return 0
     def keystroke(self, key):
        pass
 




reply via email to

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