154 |
return rotation; |
return rotation; |
155 |
} |
} |
156 |
|
|
157 |
public SortedSet getConnections(int dir) { |
/** Get the connections of a given node in a given direction, |
158 |
Collection c = statementSelector.getConnections(focus, dir); |
* as determined by the statementSelector, |
159 |
|
* sorted according to the subjOrder/objOrder of this cursor. |
160 |
|
* XXX make public once tested |
161 |
|
* @return A set of statements, one for each connection. |
162 |
|
*/ |
163 |
|
protected SortedSet getConnections(Resource of, int dir) { |
164 |
|
Collection c = statementSelector.getConnections(of, dir); |
165 |
SortedSet s = new TreeSet(dir<0 ? subjOrder : objOrder); |
SortedSet s = new TreeSet(dir<0 ? subjOrder : objOrder); |
166 |
s.addAll(c); |
s.addAll(c); |
167 |
return s; |
return s; |
168 |
} |
} |
169 |
|
|
170 |
|
/** Get the focus's connections in a given direction. |
171 |
|
* @return A set of statements, one for each connection. |
172 |
|
*/ |
173 |
|
public SortedSet getConnections(int dir) { |
174 |
|
return getConnections(focus, dir); |
175 |
|
} |
176 |
|
|
177 |
public int getConnectionCount() { |
public int getConnectionCount() { |
178 |
int negn = getConnections(-1).size(); |
int negn = getConnections(-1).size(); |
179 |
int posn = getConnections(1).size(); |
int posn = getConnections(1).size(); |
237 |
|
|
238 |
Statement stmt = getRotationStmt(dir); |
Statement stmt = getRotationStmt(dir); |
239 |
if(stmt == null) return null; |
if(stmt == null) return null; |
240 |
if(dir < 0) |
return new NodeView.Nodespec(stmt, dir); |
|
return new NodeView.Nodespec(stmt.getSubject(), |
|
|
stmt.getPredicate(), -1); |
|
|
else |
|
|
return new NodeView.Nodespec(stmt.getObject(), |
|
|
stmt.getPredicate(), 1); |
|
241 |
} |
} |
242 |
|
|
243 |
/** Move left/right. Focuses the node currently selected |
/** Move left/right. Focuses the node currently selected |