[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gzz-commits] gzz/lava gzz/loom/Cursor.java test/gzz/loom/Cur...
From: |
Benja Fallenstein |
Subject: |
[Gzz-commits] gzz/lava gzz/loom/Cursor.java test/gzz/loom/Cur... |
Date: |
Sun, 23 Feb 2003 10:17:36 -0500 |
CVSROOT: /cvsroot/gzz
Module name: gzz
Changes by: Benja Fallenstein <address@hidden> 03/02/23 10:17:36
Modified files:
lava/gzz/loom : Cursor.java
Added files:
lava/test/gzz/loom: Cursor.test
Log message:
refactor, test
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/lava/gzz/loom/Cursor.java.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/lava/test/gzz/loom/Cursor.test?rev=1.1
Patches:
Index: gzz/lava/gzz/loom/Cursor.java
diff -u gzz/lava/gzz/loom/Cursor.java:1.2 gzz/lava/gzz/loom/Cursor.java:1.3
--- gzz/lava/gzz/loom/Cursor.java:1.2 Sun Feb 23 09:45:14 2003
+++ gzz/lava/gzz/loom/Cursor.java Sun Feb 23 10:17:36 2003
@@ -49,6 +49,10 @@
public Cursor(Comparator order, Resource focus, RDFNode rotation) {
this(order);
+ set(focus, rotation);
+ }
+
+ public void set(Resource focus, RDFNode rotation) {
this.focus = focus;
this.rotation = rotation;
}
@@ -67,6 +71,24 @@
return nodes;
} catch(RDFException e) {
throw new Error("RDFException: "+e);
+ }
+ }
+
+ /** Rotate the view up or down.
+ * This moves the rotation of the cursor one step up or down. XXX
+ */
+ public void rotate(int dir) {
+ SortedSet s = getPoswardConnections();
+ if(dir < 0) {
+ try {
+ rotation = (RDFNode)s.headSet(rotation).last();
+ } catch(NoSuchElementException _) {
+ }
+ } else if(dir > 0) {
+ Iterator i = s.tailSet(rotation).iterator();
+ if(!i.hasNext()) return; i.next();
+ if(!i.hasNext()) return;
+ rotation = (RDFNode)i.next();
}
}
}
- [Gzz-commits] gzz/lava gzz/loom/Cursor.java test/gzz/loom/Cur...,
Benja Fallenstein <=