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

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

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

revision 1.2 by benja, Sat Apr 5 21:09:51 2003 UTC revision 1.2.2.1 by benja, Tue Apr 29 18:07:15 2003 UTC
# Line 53  public class LoomBindings implements Bin Line 53  public class LoomBindings implements Bin
53              System.exit(0);              System.exit(0);
54          if(loom.model == null) return;          if(loom.model == null) return;
55    
56            VobScene vs = screen.getVobSceneForEvents();
57            LoomVobMatcher matcher = (LoomVobMatcher)vs.matcher;
58    
59          if(s.equals("m")) {          if(s.equals("m")) {
60              Resource r = loom.cursor.focus;              Resource r = loom.cursor.focus;
61              if(!loom.markedNodes.contains(r))              if(!loom.markedNodes.contains(r))
# Line 86  public class LoomBindings implements Bin Line 89  public class LoomBindings implements Bin
89          else if(s.equals("j") || s.equals("Left")) {          else if(s.equals("j") || s.equals("Left")) {
90              RDFNode node = loom.cursor.getRotationNode(-1);              RDFNode node = loom.cursor.getRotationNode(-1);
91              if(node == null || !(node instanceof Resource)) return;              if(node == null || !(node instanceof Resource)) return;
92              loom.lastFocus = new NodeView.Nodespec(loom.cursor.focus);              //loom.lastFocus = new NodeView.Nodespec(loom.cursor.focus);
93              List l = new ArrayList(loom.cursor.getConnections(-1));              List l = new ArrayList(loom.cursor.getConnections(-1));
94              Statement stmt =              Statement stmt =
95                  (Statement)l.get(loom.cursor.getRotationIndex(-1));                  (Statement)l.get(loom.cursor.getRotationIndex(-1));
96              loom.lastRotation =              /*loom.lastRotation =
97                  new NodeView.Nodespec(stmt.getSubject(),                  new NodeView.Nodespec(stmt.getSubject(),
98                                        stmt.getPredicate(), -1);                  stmt.getPredicate(), -1);*/
99                matcher.setNextFocus(matcher.getLink(matcher.getFocus(), -1,
100                                                     stmt.getSubject(),
101                                                     stmt.getPredicate()));
102              loom.cursor.move(-1);              loom.cursor.move(-1);
103          } else if(s.equals("l") || s.equals("Right")) {          } else if(s.equals("l") || s.equals("Right")) {
104              RDFNode node = loom.cursor.getRotationNode(1);              RDFNode node = loom.cursor.getRotationNode(1);
105              if(node == null || !(node instanceof Resource)) return;              if(node == null || !(node instanceof Resource)) return;
106              loom.lastFocus = new NodeView.Nodespec(loom.cursor.focus);              //loom.lastFocus = new NodeView.Nodespec(loom.cursor.focus);
107              List l = new ArrayList(loom.cursor.getConnections(1));              List l = new ArrayList(loom.cursor.getConnections(1));
108              Statement stmt =              Statement stmt =
109                  (Statement)l.get(loom.cursor.getRotationIndex(1));                  (Statement)l.get(loom.cursor.getRotationIndex(1));
110              loom.lastRotation =              /*loom.lastRotation =
111                  new NodeView.Nodespec(stmt.getObject(),                  new NodeView.Nodespec(stmt.getObject(),
112                                        stmt.getPredicate(), 1);                  stmt.getPredicate(), 1);*/
113                matcher.setNextFocus(matcher.getLink(matcher.getFocus(), 1,
114                                                     stmt.getObject(),
115                                                     stmt.getPredicate()));
116              loom.cursor.move(1);              loom.cursor.move(1);
117          } else if(s.equals("PgUp")) // previous view wanted          } else if(s.equals("PgUp")) // previous view wanted
118              loom.view.changeView(-1);              loom.view.changeView(-1);
# Line 116  public class LoomBindings implements Bin Line 125  public class LoomBindings implements Bin
125          if(m.getID() != m.MOUSE_CLICKED) return;          if(m.getID() != m.MOUSE_CLICKED) return;
126                    
127          VobScene vs = screen.getVobSceneForEvents();          VobScene vs = screen.getVobSceneForEvents();
128            LoomVobMatcher matcher = (LoomVobMatcher)vs.matcher;
129          int cs = vs.coords.getCSAt(0, m.getX(), m.getY(),          int cs = vs.coords.getCSAt(0, m.getX(), m.getY(),
130                                     null);                                     null);
131          if(cs < 0) return;          if(cs < 0) return;
132          Object key = vs.matcher.getKey(cs);          Object key = matcher.getKey(cs);
133          NodeView.Nodespec spec = (NodeView.Nodespec)key;          //NodeView.Nodespec spec = (NodeView.Nodespec)key;
134            RDFNode node = (RDFNode)key;
135          if((m.getModifiers() & m.BUTTON3_MASK) > 0 ||          if((m.getModifiers() & m.BUTTON3_MASK) > 0 ||
136             spec.node instanceof Literal) {             /*spec.node*/ node instanceof Literal) {
137              loom.cursor.set(loom.cursor.focus, spec.dir, spec.node);              if(cs == matcher.getFocus()) return;
138    
139                int foc = matcher.getLinkParent(cs);
140                matcher.setNextFocus(foc);
141    
142                loom.cursor.set((Resource)matcher.getKey(foc),
143                                matcher.getLinkDirTo(cs),
144                                (Property)matcher.getLinkKeyTo(cs),
145                                (RDFNode)matcher.getKey(cs));
146              AbstractUpdateManager.chg();              AbstractUpdateManager.chg();
147          } else {          } else {
148              loom.lastFocus = new NodeView.Nodespec(loom.cursor.focus);              //loom.lastFocus = new NodeView.Nodespec(loom.cursor.focus);
149              loom.lastRotation = spec;              //loom.lastRotation = spec;
150              loom.cursor.set((Resource)spec.node, -spec.dir, loom.cursor.focus);  
151                matcher.setNextFocus(cs);
152                loom.cursor.set((Resource)key, -matcher.getLinkDirTo(cs),
153                                (Property)matcher.getLinkKeyTo(cs),
154                                (RDFNode)matcher.getKey(matcher.getLinkParent(cs)));
155              AbstractUpdateManager.chg();              AbstractUpdateManager.chg();
156          }          }
157      }      }

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.2.2.1

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