/[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.4 by benja, Tue Mar 4 12:28:39 2003 UTC revision 1.5 by benja, Wed Mar 5 17:12:40 2003 UTC
# Line 170  public class Cursor { Line 170  public class Cursor {
170          return abs;          return abs;
171      }      }
172    
173      /** Get the selected node in the given direction.      protected Statement getRotationStmt(int dir) {
      *  getRotationNode(1) is the node we go to if  
      *  we hit 'Right.' getRotationNode(-1) is the node  
      *  we go to if we hit 'Left.' getRotationNode(0)  
      *  is the focused node.  
      */  
     public RDFNode getRotationNode(int dir) {  
         if(dir == 0)  
             return focus;  
174          Iterator iter = getConnections(dir).iterator();          Iterator iter = getConnections(dir).iterator();
175          int n = getRotationIndex(dir);          int n = getRotationIndex(dir);
176          if(n < 0)          if(n < 0)
# Line 189  public class Cursor { Line 181  public class Cursor {
181              // nothing there              // nothing there
182              return null;              return null;
183    
184          Statement stmt = (Statement)iter.next();          return (Statement)iter.next();
185        }
186    
187        /** Get the selected node in the given direction.
188         *  getRotationNode(1) is the node we go to if
189         *  we hit 'Right.' getRotationNode(-1) is the node
190         *  we go to if we hit 'Left.' getRotationNode(0)
191         *  is the focused node.
192         */
193        public RDFNode getRotationNode(int dir) {
194            if(dir == 0)
195                return focus;
196    
197            Statement stmt = getRotationStmt(dir);
198            if(stmt == null) return null;
199          return (dir<0) ? stmt.getSubject() : stmt.getObject();          return (dir<0) ? stmt.getSubject() : stmt.getObject();
200      }      }
201    
202        public NodeView.Nodespec getRotationNodespec(int dir) {
203            if(dir == 0)
204                return new NodeView.Nodespec(focus);
205    
206            Statement stmt = getRotationStmt(dir);
207            if(stmt == null) return null;
208            if(dir < 0)
209                return new NodeView.Nodespec(stmt.getSubject(),
210                                             stmt.getPredicate(), -1);
211            else
212                return new NodeView.Nodespec(stmt.getObject(),
213                                             stmt.getPredicate(), 1);
214        }
215    
216      /** Move left/right. XXX      /** Move left/right. XXX
217       */       */
218      public void move(int dir) {      public void move(int dir) {

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

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