gzz-commits
[Top][All Lists]
Advanced

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

[Gzz-commits] fenfire ./TODO-loom org/fenfire/loom/Loom.java


From: Benja Fallenstein
Subject: [Gzz-commits] fenfire ./TODO-loom org/fenfire/loom/Loom.java
Date: Wed, 05 Mar 2003 11:41:52 -0500

CVSROOT:        /cvsroot/fenfire
Module name:    fenfire
Changes by:     Benja Fallenstein <address@hidden>      03/03/05 11:41:52

Modified files:
        .              : TODO-loom 
        org/fenfire/loom: Loom.java 

Log message:
        Fix interpolation (figured out how to do it)

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/fenfire/fenfire/TODO-loom.diff?tr1=1.16&tr2=1.17&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/fenfire/fenfire/org/fenfire/loom/Loom.java.diff?tr1=1.9&tr2=1.10&r1=text&r2=text

Patches:
Index: fenfire/TODO-loom
diff -u fenfire/TODO-loom:1.16 fenfire/TODO-loom:1.17
--- fenfire/TODO-loom:1.16      Tue Mar  4 14:35:55 2003
+++ fenfire/TODO-loom   Wed Mar  5 11:41:52 2003
@@ -14,7 +14,6 @@
 0.1: Working RDF browser
     - README documenting how you can use this so far
 
-    - fix interpolation from/to focus
     - fix selected node algorithm: if the same node is shown
       twice, only the instance actually left/right from focus
       must be shown selected
Index: fenfire/org/fenfire/loom/Loom.java
diff -u fenfire/org/fenfire/loom/Loom.java:1.9 
fenfire/org/fenfire/loom/Loom.java:1.10
--- fenfire/org/fenfire/loom/Loom.java:1.9      Tue Mar  4 14:05:29 2003
+++ fenfire/org/fenfire/loom/Loom.java  Wed Mar  5 11:41:52 2003
@@ -27,6 +27,7 @@
 package gzz.loom;
 import gzz.client.*;
 import gzz.vob.*;
+import gzz.vob.impl.DefaultVobMatcher;
 import gzz.vob.vobs.*;
 
 import java.awt.Color;
@@ -73,6 +74,9 @@
        new Loom(file);
     }
 
+    protected NodeView.Nodespec lastFocus;
+    protected NodeView.Nodespec lastRotation;
+
     public Loom(String file) throws RDFException, IOException {
 
        final Model model = load(file);
@@ -143,9 +147,32 @@
                    this.screen = s;
                }
                public VobScene generate() {
+                   VobScene old = this.screen.getVobSceneForEvents();
                    VobScene sc = this.screen.window.createVobScene();
                    sc.map.put(new SolidBgVob(java.awt.Color.white), 0);
                    views[viewcur].render(sc, 0, cursor);
+
+                   if(lastFocus != null) {
+                       DefaultVobMatcher lm = (DefaultVobMatcher)old.matcher;
+                       DefaultVobMatcher tm = (DefaultVobMatcher)sc.matcher;
+                       NodeView.Nodespec thisRotation =
+                           new NodeView.Nodespec(lastFocus.node,
+                                                 lastRotation.prop,
+                                                 -lastRotation.dir);
+                       NodeView.Nodespec thisFocus =
+                           new NodeView.Nodespec(lastRotation.node);
+                       int tf = tm.getCS(thisFocus);
+                       int lr = lm.getCS(lastRotation);
+                       int tr = tm.getCS(thisRotation);
+                       int lf = lm.getCS(lastFocus);
+                       tm.keymapSingleCoordsys(tf, lr);
+                       tm.keymapSingleCoordsys(tr, lf);
+                       System.out.println(lf+" "+tr+" "+tf+" "+lr);
+                                          
+                       lastFocus = null; lastRotation = null;
+                   }
+                                          
+                                          
                    return sc;
                }
                public void chg() {}
@@ -159,11 +186,29 @@
                        cursor.rotate(-1);
                    else if(s.equals("Down"))
                        cursor.rotate(1);
-                   else if(s.equals("Left"))
+                   else if(s.equals("Left")) {
+                       RDFNode node = cursor.getRotationNode(-1);
+                       if(node == null || !(node instanceof Resource)) return;
+                       lastFocus = new NodeView.Nodespec(cursor.focus);
+                       List l = new ArrayList(cursor.getConnections(-1));
+                       Statement stmt = 
+                           (Statement)l.get(cursor.getRotationIndex(-1));
+                       lastRotation = 
+                           new NodeView.Nodespec(stmt.getSubject(),
+                                                 stmt.getPredicate(), -1);
                        cursor.move(-1);
-                   else if(s.equals("Right"))
+                   } else if(s.equals("Right")) {
+                       RDFNode node = cursor.getRotationNode(1);
+                       if(node == null || !(node instanceof Resource)) return;
+                       lastFocus = new NodeView.Nodespec(cursor.focus);
+                       List l = new ArrayList(cursor.getConnections(1));
+                       Statement stmt = 
+                           (Statement)l.get(cursor.getRotationIndex(1));
+                       lastRotation = 
+                           new NodeView.Nodespec(stmt.getObject(),
+                                                 stmt.getPredicate(), 1);
                        cursor.move(1);
-                   else if(s.equals("PgUp")) // previous view wanted
+                   } else if(s.equals("PgUp")) // previous view wanted
                        viewcur = (viewcur-1+views.length) 
                            % views.length;
                    else if(s.equals("PgDown")) // next view wanted
@@ -183,6 +228,8 @@
                    Object key = vs.matcher.getKey(cs);
                    NodeView.Nodespec spec = (NodeView.Nodespec)key;
                    if(spec.node instanceof Resource) {
+                       lastFocus = new NodeView.Nodespec(cursor.focus);
+                       lastRotation = spec;
                        cursor.set((Resource)spec.node);
                        AbstractUpdateManager.chg();
                    } else if(spec.node instanceof Literal) {




reply via email to

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