gzz-commits
[Top][All Lists]
Advanced

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

[Gzz-commits] fenfire/org/fenfire demo/buoyoing.py view/lava/...


From: Matti Katila
Subject: [Gzz-commits] fenfire/org/fenfire demo/buoyoing.py view/lava/...
Date: Mon, 26 May 2003 15:05:18 -0400

CVSROOT:        /cvsroot/fenfire
Module name:    fenfire
Changes by:     Matti Katila <address@hidden>   03/05/26 15:05:18

Modified files:
        org/fenfire/demo: buoyoing.py 
        org/fenfire/view/lava: FenPDFContext.java 

Log message:
        more save and load

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/fenfire/fenfire/org/fenfire/demo/buoyoing.py.diff?tr1=1.56&tr2=1.57&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/fenfire/fenfire/org/fenfire/view/lava/FenPDFContext.java.diff?tr1=1.23&tr2=1.24&r1=text&r2=text

Patches:
Index: fenfire/org/fenfire/demo/buoyoing.py
diff -u fenfire/org/fenfire/demo/buoyoing.py:1.56 
fenfire/org/fenfire/demo/buoyoing.py:1.57
--- fenfire/org/fenfire/demo/buoyoing.py:1.56   Fri May 23 11:02:53 2003
+++ fenfire/org/fenfire/demo/buoyoing.py        Mon May 26 15:05:18 2003
@@ -57,10 +57,10 @@
 vob.buoy.buoymanager.replaceNewScene = vob.putil.demo.replacingScene
 vob.buoy.buoymanager.w = vob.putil.demo.w
 
-DIR = 'myFenfire'
+DIR = 'myFenfire/'
 os.system('mkdir -p '+DIR)
-pool = storm.impl.TransientPool(java.util.HashSet())
-# pool = storm.impl.DirPool(java.io.File(DIR), java.util.HashSet())
+#pool = storm.impl.TransientPool(java.util.HashSet())
+pool = storm.impl.DirPool(java.io.File(DIR), java.util.HashSet())
 myalph = alph.impl.StormAlph(pool)
 sc = myalph.addFile(java.io.File('../alph/testdata/test1.pdf'), 
'application/pdf')
 enfMaker = alph.impl.Enfilade1DImpl.Enfilade1DImplMaker()
Index: fenfire/org/fenfire/view/lava/FenPDFContext.java
diff -u fenfire/org/fenfire/view/lava/FenPDFContext.java:1.23 
fenfire/org/fenfire/view/lava/FenPDFContext.java:1.24
--- fenfire/org/fenfire/view/lava/FenPDFContext.java:1.23       Fri May 23 
18:07:58 2003
+++ fenfire/org/fenfire/view/lava/FenPDFContext.java    Mon May 26 15:05:18 2003
@@ -196,9 +196,13 @@
      * or what??? XXX
      * what this should even do?
      */
-    public Object doMouse(MouseEvent e, VobScene oldVS) 
+    public Object[] doMouse(MouseEvent e, VobScene oldVS,
+                            AbstractMainNode2D[] mainNodes) 
        throws RemoteException, IOException, RDFException
     {
+        p("planes: " + mainNodes);
+        for (int i=0; i<mainNodes.length; i++) p("foo: "+ mainNodes[i]);
+
         if (e.getID() != MouseEvent.MOUSE_CLICKED) return null;
         int cs = oldVS.coords.getCSAt(0, e.getX(), e.getY(), null);
        if(cs < 0) return null;
@@ -217,38 +221,73 @@
                p("ps/pdf to be added: "+fd.getDirectory()+fd.getFile());
                if (fd.getDirectory() == null) return null;
 
-               ScrollBlock sc = alph.addFile(new 
File(fd.getDirectory()+fd.getFile()),
-                                             "application/pdf");
+               ScrollBlock sc = alph.addFile(
+                    new File(fd.getDirectory()+fd.getFile()),
+                    "application/pdf");
                p("sc: "+sc+" foo: " + sc.getID());
-               return new FisheyeMainNode2D(sc, new PageScrollView2D(), 0,0);
+               mainNodes[CURR]= new 
+                    FisheyeMainNode2D(sc, new PageScrollView2D(), 0,0);
+                return mainNodes;
            }
            else if (key.equals("LINK")) {
                if (CURR >0) actionLink(1); else actionLink(-1);
            }
            else if (key.equals("NEW_PAPER")) {
                String paper = ppAct.newPaper();
-               return new MainNode2D(Nodes.get(paper), ppView, 0,0,1);
+               mainNodes[CURR] = new MainNode2D(Nodes.get(paper), 
+                                                ppView, 0,0,1);
+                return mainNodes;
            }
            else if (key.equals("SAVE")) {
                p("going to save");
-                fen.graph.rm_1AA(SAVE.State);
+
+                Iterator it = fen.graph.findN_1XA_Iter(SAVE.State);
+                while(it.hasNext()) {
+                    Object p = it.next();
+                    p("p: "+p);
+                    Iterator ite = fen.graph.findN_11X_Iter(SAVE.State, p);
+                    while(ite.hasNext()) {
+                        Object o = ite.next();
+                        p("o: "+o);
+                        
+                        fen.graph.rm_111(SAVE.State, p,o);
+                    }
+                }
+                
+                // There's a bug in rm_1AA - needs a test!
+                //fen.graph.rm_1AA(SAVE.State);
                p("rm all worked out");
-                for (int i=0; i<accursed.length; i++) {
-                   if (accursed[i] == null) continue;
-                    fen.graph.add(SAVE.State, SAVE.point, accursed[i]);
+                for (int i=0; i<mainNodes.length; i++) {
+                    p("accursed: " + accursed[i]+ 
+                      ", main:"+mainNodes[i]+
+                        ", plane: "+ mainNodes[i].getPlane()); 
+
+                   //if (accursed[i] == null) continue;
+                    fen.graph.add(SAVE.State, SAVE.point, 
+                                  mainNodes[i].getPlane());
                 }
                Model m = Graphs.toModel(fen.graph);
-               m.write(new FileWriter("mygraph.rdf"));
+               m.write(new FileWriter("myFenfire/mygraph.rdf"));
                return null;
            } 
            else if (key.equals("LOAD")) {
                Model m = new ModelMem();
-               m.read(new FileReader("mygraph.rdf"), "");
+               m.read(new FileReader("myFenfire/mygraph.rdf"), null);
                fen.constgraph = fen.graph = Graphs.toGraph(m);
                 int i = 0;
                 Iterator it = fen.graph.findN_11X_Iter(SAVE.State, SAVE.point);
-                while (it.hasNext() && i<accursed.length) {
-                    accursed[i++] = it.next();
+                while (it.hasNext() && i<mainNodes.length) {
+                    Object plane = it.next();
+                    if (fen.graph.find1_11X(accursed[i], RDF.type) == 
+                        CANVAS2D.Canvas) {
+                        mainNodes[i] = new MainNode2D(plane, 
+                                                      ppView, 0,0,1);
+                    } else {
+                        mainNodes[i] = new 
+                            FisheyeMainNode2D(plane, 
+                                              new PageScrollView2D(), 0,0);
+                    }
+                    i++;
                 }
                 AbstractUpdateManager.chg();
                return null;




reply via email to

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