gzz-commits
[Top][All Lists]
Advanced

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

[Gzz-commits] fenfire/org/fenfire bin/fenpdf10.py modules/pp/...


From: Tuomas J. Lukka
Subject: [Gzz-commits] fenfire/org/fenfire bin/fenpdf10.py modules/pp/...
Date: Mon, 11 Aug 2003 07:07:27 -0400

CVSROOT:        /cvsroot/fenfire
Module name:    fenfire
Branch:         
Changes by:     Tuomas J. Lukka <address@hidden>        03/08/11 07:07:27

Modified files:
        org/fenfire/bin: fenpdf10.py 
        org/fenfire/modules/pp: PPActionsImpl.java 
        org/fenfire/view/buoy: TTConnector.java 

Log message:
        Treetime: now the correct buoys are printed out

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/fenfire/fenfire/org/fenfire/bin/fenpdf10.py.diff?tr1=1.12&tr2=1.13&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/fenfire/fenfire/org/fenfire/modules/pp/PPActionsImpl.java.diff?tr1=1.32&tr2=1.33&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/fenfire/fenfire/org/fenfire/view/buoy/TTConnector.java.diff?tr1=1.1&tr2=1.2&r1=text&r2=text

Patches:
Index: fenfire/org/fenfire/bin/fenpdf10.py
diff -u fenfire/org/fenfire/bin/fenpdf10.py:1.12 
fenfire/org/fenfire/bin/fenpdf10.py:1.13
--- fenfire/org/fenfire/bin/fenpdf10.py:1.12    Mon Aug 11 05:14:05 2003
+++ fenfire/org/fenfire/bin/fenpdf10.py Mon Aug 11 07:07:26 2003
@@ -137,7 +137,10 @@
 fen.txt = ff.impl.SimpleNodeContent(fen, myalph);
 fen.txtfunc = fen.txt.getNodeFunction()
 fen.enfiladeOverlap = fen.txt.getTransclusionIndex()
+
 ppAct = ff.modules.pp.PPActionsImpl(fen)
+treetime = ff.structure.TreeTime(ff.vocab.TREETIME.follows)
+ppAct.treeTime = treetime
 
 # Now, before reading the xu stuff, render something 
 # to try to prevent NV driver
@@ -148,10 +151,13 @@
 vs.put(background((.8, .4, .9)))
 w.renderStill(vs, 0)
 
+
 paperA = "urn:urn-5:P7OMBN+yp3-m-AkulZN-NeaJV9Sl:_1"
 paperHome = "urn:urn-5:COz-fSvNBZRieCdefRTKO2Mgcjmz:_1"
 if not do_load_graph:
     fen.graph.add(Nodes.get(paperA), RDF.type, CANVAS2D.Canvas);
+    treetime.addLatest(fen.graph, Nodes.get(paperHome))
+    treetime.addLatest(fen.graph, Nodes.get(paperA))
     noteA1 = Nodes.get(ppAct.newNote(paperA, -30,-30, 'This is a test!'))
     noteA2 = Nodes.get(ppAct.newNote(paperA, -60,-70, 'This is a test2!'))
     noteA3 = Nodes.get(ppAct.newNote(paperA, 100, 100, ''))
@@ -298,7 +304,7 @@
     ff.view.buoy.FisheyeMainNode2D.FisheyeMainNode2DFactory(mainMouse))
 
 # Treetime
-ttconnector = ff.view.buoy.TTConnector()
+ttconnector = ff.view.buoy.TTConnector(fen, ff.vocab.TREETIME.follows)
 
 class DoubleGeometer:
     def __init__(self, mgr, context, nodeview):
Index: fenfire/org/fenfire/modules/pp/PPActionsImpl.java
diff -u fenfire/org/fenfire/modules/pp/PPActionsImpl.java:1.32 
fenfire/org/fenfire/modules/pp/PPActionsImpl.java:1.33
--- fenfire/org/fenfire/modules/pp/PPActionsImpl.java:1.32      Thu Jul 17 
12:28:18 2003
+++ fenfire/org/fenfire/modules/pp/PPActionsImpl.java   Mon Aug 11 07:07:26 2003
@@ -45,7 +45,7 @@
  *  UnicastRemoteObject' for now. -benja
  */
 public class PPActionsImpl /*extends UnicastRemoteObject*/ implements 
PPActions {
-public static final String rcsid = "$Id: PPActionsImpl.java,v 1.32 2003/07/17 
16:28:18 mudyc Exp $";
+public static final String rcsid = "$Id: PPActionsImpl.java,v 1.33 2003/08/11 
11:07:26 tjl Exp $";
     public static boolean dbg = false;
     protected static void p(String s) { System.out.println("PPActionsImpl: 
"+s); }
 
@@ -56,6 +56,8 @@
        this.alphContent = new AlphContent(fen);
     }
 
+    public org.fenfire.structure.TreeTime treeTime;
+
     public PPActionsImpl(Fen fen)  throws RemoteException {
        super();
        if(dbg) p("UnicastRemoteObject created");
@@ -70,6 +72,9 @@
     { synchronized(fen) {
        if(dbg) p("make a new paper");
        Object paper = RDFUtil.N(fen.graph, CANVAS2D.Canvas);
+       if(dbg) p("new paper treetime.");
+       if(treeTime != null)
+           treeTime.addLatest(fen.graph, paper);
        if(dbg) p("new paper done.");
 
        // set creation time
Index: fenfire/org/fenfire/view/buoy/TTConnector.java
diff -u fenfire/org/fenfire/view/buoy/TTConnector.java:1.1 
fenfire/org/fenfire/view/buoy/TTConnector.java:1.2
--- fenfire/org/fenfire/view/buoy/TTConnector.java:1.1  Mon Aug 11 05:14:05 2003
+++ fenfire/org/fenfire/view/buoy/TTConnector.java      Mon Aug 11 07:07:27 2003
@@ -1,6 +1,7 @@
 // (c) Tuomas J. Lukka
 
 package org.fenfire.view.buoy;
+import java.util.Iterator;
 import org.fenfire.*;
 import org.fenfire.swamp.*;
 import org.fenfire.view.*;
@@ -14,11 +15,35 @@
 import org.nongnu.alph.*;
 
 /** A Buoy connector for TreeTime.
+ * XXX Generalize to general page / block relation!
+ * Note that this connector gives a null anchor.
  */
 public class TTConnector implements BuoyViewConnector {
     public static boolean dbg = false;
     private static void p(String s) { System.out.println("TTConnector:: "+s); }
 
+    private Fen fen;
+    private Object relation;
+
+    public AbstractNodeType2D pageImageScrollNodeType;
+    public AbstractNodeType2D normalNodeNodeType;
+
+    public TTConnector(Fen fen, Object relation) {
+       this.fen = fen;
+       this.relation = relation;
+    }
+
+    private void addBuoy(VobScene vs, Object node, int direction,
+                       BuoyLinkListener l) {
+       String s = Nodes.toString(node);
+       if(s.startsWith("urn:x-storm:1.0:application/pdf") ||
+          s.startsWith("urn:x-storm:1.0:application/postscript")) {
+           if(dbg) p("Got "+s+" was pagescroll " + direction);
+       } else {
+           if(dbg) p("Got "+s+" was plane " + direction);
+       }
+    }
+
     public void addBuoys(VobScene vs, int parentCs,
                         BuoyViewMainNode mainNode0,
                         BuoyLinkListener l) {
@@ -30,13 +55,33 @@
        // 1) a PageScrollBlock, or
        // 2) a canvas.
        
+       Object node;
+       
        if(plane instanceof PageScrollBlock) {
            PageScrollBlock sb = (PageScrollBlock)plane;
            if(dbg) p("Scrollblock: "+sb.getID());
+           node = Nodes.get(sb.getID());
        } else {
            if(dbg) p("Plane: "+plane);
+           node = plane;
+       }
+
+       for(
+           Iterator ileft = fen.constgraph.findN_11X_Iter(node, relation);
+           ileft.hasNext();) {
+           Object linknode = ileft.next();
+           addBuoy(vs, linknode, -1, l);
+       }
+       
 
+       for(
+           Iterator iright = fen.constgraph.findN_X11_Iter(relation, node);
+           iright.hasNext();) {
+           Object linknode = iright.next();
+           addBuoy(vs, linknode, 1, l);
        }
+
+       
 
     }
 }




reply via email to

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