[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gzz-commits] gzz/lava gzz/loom/Cursor.java gzz/loom/NodeView...
From: |
Benja Fallenstein |
Subject: |
[Gzz-commits] gzz/lava gzz/loom/Cursor.java gzz/loom/NodeView... |
Date: |
Wed, 26 Feb 2003 14:37:46 -0500 |
CVSROOT: /cvsroot/gzz
Module name: gzz
Changes by: Benja Fallenstein <address@hidden> 03/02/26 14:37:45
Modified files:
lava/gzz/loom : Cursor.java NodeView.java
lava/test/gzz/loom: Cursor.test SimpleView.test
Log message:
Add some javadoc and the tests Tuukka's commit was missing. (See? It's
easy ;-) )
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/lava/gzz/loom/Cursor.java.diff?tr1=1.12&tr2=1.13&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/lava/gzz/loom/NodeView.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.diff?tr1=1.10&tr2=1.11&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/lava/test/gzz/loom/SimpleView.test.diff?tr1=1.17&tr2=1.18&r1=text&r2=text
Patches:
Index: gzz/lava/gzz/loom/Cursor.java
diff -u gzz/lava/gzz/loom/Cursor.java:1.12 gzz/lava/gzz/loom/Cursor.java:1.13
--- gzz/lava/gzz/loom/Cursor.java:1.12 Wed Feb 26 13:03:54 2003
+++ gzz/lava/gzz/loom/Cursor.java Wed Feb 26 14:37:45 2003
@@ -154,6 +154,12 @@
return abs;
}
+ /** Get the selected node in the given direction.
+ * getRotationNode(1) is the node we go to if
+ * we hit 'Right.' getRotationNode(-1) is the node
+ * we go to if we hit 'Left.' getRotationNode(0)
+ * is the focused node.
+ */
public RDFNode getRotationNode(int dir) {
if(dir == 0)
return focus;
Index: gzz/lava/gzz/loom/NodeView.java
diff -u gzz/lava/gzz/loom/NodeView.java:1.2 gzz/lava/gzz/loom/NodeView.java:1.3
--- gzz/lava/gzz/loom/NodeView.java:1.2 Wed Feb 26 13:03:55 2003
+++ gzz/lava/gzz/loom/NodeView.java Wed Feb 26 14:37:45 2003
@@ -34,7 +34,16 @@
*/
public interface NodeView {
- /** Render a node. */
+ /** Render a node.
+ * @param vs The VobScene to render the node into.
+ * @param into The coordinate system inside <code>vs</code>
+ * to render the node into.
+ * @param node The node to render.
+ * @param dir Larger than zero if the node is posward
+ * from the focus; smaller than zero if the node
+ * is negward from the focus; zero if the node
+ * <em>is</em> the focus.
+ */
void render(VobScene vs, int into, RDFNode node, int dir);
/** Get the default size of a node.
Index: gzz/lava/test/gzz/loom/Cursor.test
diff -u gzz/lava/test/gzz/loom/Cursor.test:1.10
gzz/lava/test/gzz/loom/Cursor.test:1.11
--- gzz/lava/test/gzz/loom/Cursor.test:1.10 Wed Feb 26 12:13:07 2003
+++ gzz/lava/test/gzz/loom/Cursor.test Wed Feb 26 14:37:45 2003
@@ -237,3 +237,20 @@
c.move(1)
assert c.focus == n[8] and c.rotation == 0
+
+
+def testGetRotationNode():
+ c.set(n[2])
+ assert c.getRotationNode(-1) == n[1]
+ assert c.getRotationNode(0) == n[2]
+ assert c.getRotationNode(1) == n[6]
+
+ c.rotation = 3
+ assert c.getRotationNode(-1) == None
+ assert c.getRotationNode(0) == n[2]
+ assert c.getRotationNode(1) == n[9]
+
+ c.rotation = -2
+ assert c.getRotationNode(-1) == None
+ assert c.getRotationNode(0) == n[2]
+ assert c.getRotationNode(1) == n[4]
Index: gzz/lava/test/gzz/loom/SimpleView.test
diff -u gzz/lava/test/gzz/loom/SimpleView.test:1.17
gzz/lava/test/gzz/loom/SimpleView.test:1.18
--- gzz/lava/test/gzz/loom/SimpleView.test:1.17 Wed Feb 26 13:03:55 2003
+++ gzz/lava/test/gzz/loom/SimpleView.test Wed Feb 26 14:37:45 2003
@@ -33,11 +33,12 @@
v = model.createResource()
w = model.createResource()
-nodes = {}
+nodes, dirs = {}, {}
class NodeView(gzz.loom.NodeView):
def render(self, vs, cs, node, dir):
nodes[node] = cs
+ dirs[node] = dir
class Cmp(java.util.Comparator):
def compare(self, r1, r2):
@@ -112,3 +113,7 @@
assert nodes[u] == cs_u
assert nodes[v] == cs_v
assert nodes[w] == cs_w
+
+ assert dirs[r] == 0
+ assert dirs[s] == dirs[t] == dirs[u] == dirs[v] == 1
+ assert dirs[w] == -1
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gzz-commits] gzz/lava gzz/loom/Cursor.java gzz/loom/NodeView...,
Benja Fallenstein <=