/[gzz]/gzz/lava/gzz/loom/Cursor.java
ViewVC logotype

Diff of /gzz/lava/gzz/loom/Cursor.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by benja, Sun Feb 23 14:45:14 2003 UTC revision 1.3 by benja, Sun Feb 23 15:17:36 2003 UTC
# Line 49  public class Cursor { Line 49  public class Cursor {
49    
50      public Cursor(Comparator order, Resource focus, RDFNode rotation) {      public Cursor(Comparator order, Resource focus, RDFNode rotation) {
51          this(order);          this(order);
52            set(focus, rotation);
53        }
54    
55        public void set(Resource focus, RDFNode rotation) {
56          this.focus = focus;          this.focus = focus;
57          this.rotation = rotation;          this.rotation = rotation;
58      }      }
# Line 69  public class Cursor { Line 73  public class Cursor {
73              throw new Error("RDFException: "+e);              throw new Error("RDFException: "+e);
74          }          }
75      }      }
76    
77        /** Rotate the view up or down.
78         *  This moves the rotation of the cursor one step up or down. XXX
79         */
80        public void rotate(int dir) {
81            SortedSet s = getPoswardConnections();
82            if(dir < 0) {
83                try {
84                    rotation = (RDFNode)s.headSet(rotation).last();
85                } catch(NoSuchElementException _) {
86                }
87            } else if(dir > 0) {
88                Iterator i = s.tailSet(rotation).iterator();
89                if(!i.hasNext()) return; i.next();
90                if(!i.hasNext()) return;
91                rotation = (RDFNode)i.next();
92            }
93        }
94  }  }

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26