74 |
} |
} |
75 |
} |
} |
76 |
|
|
77 |
|
public SortedSet getNegwardConnections() { |
78 |
|
try { |
79 |
|
SortedSet nodes = new TreeSet(order); |
80 |
|
StmtIterator i = focus.getModel().listStatements(); |
81 |
|
for(; i.hasNext();) { |
82 |
|
Statement stmt = i.next(); |
83 |
|
if(stmt.getObject().equals(focus)) |
84 |
|
nodes.add(stmt.getSubject()); |
85 |
|
} |
86 |
|
i.close(); |
87 |
|
|
88 |
|
return nodes; |
89 |
|
} catch(RDFException e) { |
90 |
|
throw new Error("RDFException: "+e); |
91 |
|
} |
92 |
|
} |
93 |
|
|
94 |
/** Rotate the view up or down. |
/** Rotate the view up or down. |
95 |
* This moves the rotation of the cursor one step up or down. XXX |
* This moves the rotation of the cursor one step up or down. XXX |
96 |
*/ |
*/ |
108 |
rotation = (RDFNode)i.next(); |
rotation = (RDFNode)i.next(); |
109 |
} |
} |
110 |
} |
} |
111 |
|
|
112 |
|
/** Move left/right. XXX |
113 |
|
*/ |
114 |
|
public void move(int dir) { |
115 |
|
if(dir < 0) { |
116 |
|
rotation = focus; |
117 |
|
focus = (Resource)getNegwardConnections().first(); |
118 |
|
} else { |
119 |
|
focus = (Resource)rotation; |
120 |
|
try { |
121 |
|
rotation = (RDFNode)getPoswardConnections().first(); |
122 |
|
} catch(NoSuchElementException _) { |
123 |
|
rotation = null; |
124 |
|
} |
125 |
|
} |
126 |
|
} |
127 |
} |
} |