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 |
} |
} |
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 |
} |
} |