/[fenfire]/fenfire/org/fenfire/loom/Cursor.java
ViewVC logotype

Diff of /fenfire/org/fenfire/loom/Cursor.java

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

revision 1.7 by benja, Fri Mar 7 21:03:43 2003 UTC revision 1.8 by benja, Sat Mar 8 21:54:15 2003 UTC
# Line 154  public class Cursor { Line 154  public class Cursor {
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();
# Line 224  public class Cursor { Line 237  public class Cursor {
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

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8

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