/[fenfire]/fenfire/org/fenfire/view/lava/FenPDFContext.java
ViewVC logotype

Diff of /fenfire/org/fenfire/view/lava/FenPDFContext.java

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

revision 1.23 by mudyc, Fri May 23 22:07:58 2003 UTC revision 1.24 by mudyc, Mon May 26 19:05:18 2003 UTC
# Line 196  public class FenPDFContext implements Line 196  public class FenPDFContext implements
196       * or what??? XXX       * or what??? XXX
197       * what this should even do?       * what this should even do?
198       */       */
199      public Object doMouse(MouseEvent e, VobScene oldVS)      public Object[] doMouse(MouseEvent e, VobScene oldVS,
200                                AbstractMainNode2D[] mainNodes)
201          throws RemoteException, IOException, RDFException          throws RemoteException, IOException, RDFException
202      {      {
203            p("planes: " + mainNodes);
204            for (int i=0; i<mainNodes.length; i++) p("foo: "+ mainNodes[i]);
205    
206          if (e.getID() != MouseEvent.MOUSE_CLICKED) return null;          if (e.getID() != MouseEvent.MOUSE_CLICKED) return null;
207          int cs = oldVS.coords.getCSAt(0, e.getX(), e.getY(), null);          int cs = oldVS.coords.getCSAt(0, e.getX(), e.getY(), null);
208          if(cs < 0) return null;          if(cs < 0) return null;
# Line 217  public class FenPDFContext implements Line 221  public class FenPDFContext implements
221                  p("ps/pdf to be added: "+fd.getDirectory()+fd.getFile());                  p("ps/pdf to be added: "+fd.getDirectory()+fd.getFile());
222                  if (fd.getDirectory() == null) return null;                  if (fd.getDirectory() == null) return null;
223    
224                  ScrollBlock sc = alph.addFile(new File(fd.getDirectory()+fd.getFile()),                  ScrollBlock sc = alph.addFile(
225                                                "application/pdf");                      new File(fd.getDirectory()+fd.getFile()),
226                        "application/pdf");
227                  p("sc: "+sc+" foo: " + sc.getID());                  p("sc: "+sc+" foo: " + sc.getID());
228                  return new FisheyeMainNode2D(sc, new PageScrollView2D(), 0,0);                  mainNodes[CURR]= new
229                        FisheyeMainNode2D(sc, new PageScrollView2D(), 0,0);
230                    return mainNodes;
231              }              }
232              else if (key.equals("LINK")) {              else if (key.equals("LINK")) {
233                  if (CURR >0) actionLink(1); else actionLink(-1);                  if (CURR >0) actionLink(1); else actionLink(-1);
234              }              }
235              else if (key.equals("NEW_PAPER")) {              else if (key.equals("NEW_PAPER")) {
236                  String paper = ppAct.newPaper();                  String paper = ppAct.newPaper();
237                  return new MainNode2D(Nodes.get(paper), ppView, 0,0,1);                  mainNodes[CURR] = new MainNode2D(Nodes.get(paper),
238                                                    ppView, 0,0,1);
239                    return mainNodes;
240              }              }
241              else if (key.equals("SAVE")) {              else if (key.equals("SAVE")) {
242                  p("going to save");                  p("going to save");
243                  fen.graph.rm_1AA(SAVE.State);  
244                    Iterator it = fen.graph.findN_1XA_Iter(SAVE.State);
245                    while(it.hasNext()) {
246                        Object p = it.next();
247                        p("p: "+p);
248                        Iterator ite = fen.graph.findN_11X_Iter(SAVE.State, p);
249                        while(ite.hasNext()) {
250                            Object o = ite.next();
251                            p("o: "+o);
252                            
253                            fen.graph.rm_111(SAVE.State, p,o);
254                        }
255                    }
256                    
257                    // There's a bug in rm_1AA - needs a test!
258                    //fen.graph.rm_1AA(SAVE.State);
259                  p("rm all worked out");                  p("rm all worked out");
260                  for (int i=0; i<accursed.length; i++) {                  for (int i=0; i<mainNodes.length; i++) {
261                      if (accursed[i] == null) continue;                      p("accursed: " + accursed[i]+
262                      fen.graph.add(SAVE.State, SAVE.point, accursed[i]);                        ", main:"+mainNodes[i]+
263                            ", plane: "+ mainNodes[i].getPlane());
264    
265                        //if (accursed[i] == null) continue;
266                        fen.graph.add(SAVE.State, SAVE.point,
267                                      mainNodes[i].getPlane());
268                  }                  }
269                  Model m = Graphs.toModel(fen.graph);                  Model m = Graphs.toModel(fen.graph);
270                  m.write(new FileWriter("mygraph.rdf"));                  m.write(new FileWriter("myFenfire/mygraph.rdf"));
271                  return null;                  return null;
272              }              }
273              else if (key.equals("LOAD")) {              else if (key.equals("LOAD")) {
274                  Model m = new ModelMem();                  Model m = new ModelMem();
275                  m.read(new FileReader("mygraph.rdf"), "");                  m.read(new FileReader("myFenfire/mygraph.rdf"), null);
276                  fen.constgraph = fen.graph = Graphs.toGraph(m);                  fen.constgraph = fen.graph = Graphs.toGraph(m);
277                  int i = 0;                  int i = 0;
278                  Iterator it = fen.graph.findN_11X_Iter(SAVE.State, SAVE.point);                  Iterator it = fen.graph.findN_11X_Iter(SAVE.State, SAVE.point);
279                  while (it.hasNext() && i<accursed.length) {                  while (it.hasNext() && i<mainNodes.length) {
280                      accursed[i++] = it.next();                      Object plane = it.next();
281                        if (fen.graph.find1_11X(accursed[i], RDF.type) ==
282                            CANVAS2D.Canvas) {
283                            mainNodes[i] = new MainNode2D(plane,
284                                                          ppView, 0,0,1);
285                        } else {
286                            mainNodes[i] = new
287                                FisheyeMainNode2D(plane,
288                                                  new PageScrollView2D(), 0,0);
289                        }
290                        i++;
291                  }                  }
292                  AbstractUpdateManager.chg();                  AbstractUpdateManager.chg();
293                  return null;                  return null;

Legend:
Removed from v.1.23  
changed lines
  Added in v.1.24

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