[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gzz-commits] fenfire/org/fenfire/modules/pp PPActionsImpl.ja...
From: |
Matti Katila |
Subject: |
[Gzz-commits] fenfire/org/fenfire/modules/pp PPActionsImpl.ja... |
Date: |
Sat, 08 Mar 2003 18:32:40 -0500 |
CVSROOT: /cvsroot/fenfire
Module name: fenfire
Changes by: Matti Katila <address@hidden> 03/03/08 18:32:40
Modified files:
org/fenfire/modules/pp: PPActionsImpl.java PPVocab.java
Log message:
implemented movenote
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/fenfire/fenfire/org/fenfire/modules/pp/PPActionsImpl.java.diff?tr1=1.5&tr2=1.6&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/fenfire/fenfire/org/fenfire/modules/pp/PPVocab.java.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
Patches:
Index: fenfire/org/fenfire/modules/pp/PPActionsImpl.java
diff -u fenfire/org/fenfire/modules/pp/PPActionsImpl.java:1.5
fenfire/org/fenfire/modules/pp/PPActionsImpl.java:1.6
--- fenfire/org/fenfire/modules/pp/PPActionsImpl.java:1.5 Fri Mar 7
11:47:20 2003
+++ fenfire/org/fenfire/modules/pp/PPActionsImpl.java Sat Mar 8 18:32:39 2003
@@ -12,7 +12,7 @@
/** The implementation of PPActions.
*/
public class PPActionsImpl extends UnicastRemoteObject implements PPActions {
-public static final String rcsid = "$Id: PPActionsImpl.java,v 1.5 2003/03/07
16:47:20 mudyc Exp $";
+public static final String rcsid = "$Id: PPActionsImpl.java,v 1.6 2003/03/08
23:32:39 mudyc Exp $";
public static final boolean dbg = true;
protected static void p(String s) { if(dbg) pa(s); }
protected static void pa(String s) { System.out.println(s); }
@@ -103,7 +103,7 @@
public void deleteNote(String noteURI)
throws RemoteException
- { synchronized(model) {
+ { synchronized(model) { try {
/*
// MUST DELETE ALL ASSOCS FIRST
@@ -139,24 +139,42 @@
// not implemented
// ===============
+ Resource note = model.getResource(noteURI);
- }}
+ } catch (RDFException e) {
+ pa("Fault deleting a note: "+e);
+ }}}
public void moveNote(String noteURI, int x, int y)
- throws RemoteException { synchronized(model) {
- /*
- Cell note = space.getCell(noteId);
- Cell arg = note.s(d.pan);
- arg.setText("" + x);
- arg = arg.s(d.pan);
- arg.setText("" + y);
- */
+ throws RemoteException
+ { synchronized(model) { try {
- // not implemented
- // ===============
+ Resource note = model.getResource(noteURI);
+ if (note == null) return;
+ // delete all old coords
+ RDFNode empty = null;
+ Selector selector = new SelectorImpl(note, PP.CoordX, empty);
+ StmtIterator it = model.listStatements(selector);
+ while (it.hasNext()) {
+ Statement stmt = it.next();
+ p("deleting "+stmt);
+ model.remove(stmt);
+ }
+ selector = new SelectorImpl(note, PP.CoordY, empty);
+ it = model.listStatements(selector);
+ while (it.hasNext()) {
+ Statement stmt = it.next();
+ p("deleting "+stmt);
+ model.remove(stmt);
+ }
- }}
+ // set coords
+ note.addProperty(PP.CoordX, ""+x);
+ note.addProperty(PP.CoordX, ""+x);
+ } catch (RDFException e) {
+ pa("Fault moving note: "+e);
+ }}}
public void assocNotes(String noteURI, int side, String assocURI)
Index: fenfire/org/fenfire/modules/pp/PPVocab.java
diff -u fenfire/org/fenfire/modules/pp/PPVocab.java:1.1
fenfire/org/fenfire/modules/pp/PPVocab.java:1.2
--- fenfire/org/fenfire/modules/pp/PPVocab.java:1.1 Fri Mar 7 11:47:21 2003
+++ fenfire/org/fenfire/modules/pp/PPVocab.java Sat Mar 8 18:32:39 2003
@@ -5,7 +5,7 @@
import com.hp.hpl.mesa.rdf.jena.common.*;
public class PPVocab {
-public static final String rcsid = "$Id: PPVocab.java,v 1.1 2003/03/07
16:47:21 mudyc Exp $";
+public static final String rcsid = "$Id: PPVocab.java,v 1.2 2003/03/08
23:32:39 mudyc Exp $";
public static final boolean dbg = true;
protected static void p(String s) { if(dbg) pa(s); }
protected static void pa(String s) { System.out.println(s); }
@@ -23,13 +23,14 @@
public PPVocab() {
String pp_voc = "http://fenfire.org/vocabulary/pp.html";
+ String spatial_voc = "http://fenfire.org/vocabulary/spatial.html";
try {
// Propertys
Contains = new PropertyImpl(pp_voc+"#contains");
CreationTime = new PropertyImpl(pp_voc + "#creationTime");
- CoordX = new PropertyImpl(pp_voc + "#coordX");
- CoordY = new PropertyImpl(pp_voc + "#coordY");
- Depth = new PropertyImpl(pp_voc + "#depth");
+ CoordX = new PropertyImpl(spatial_voc + "#coordX");
+ CoordY = new PropertyImpl(spatial_voc + "#coordY");
+ Depth = new PropertyImpl(spatial_voc + "#depth");
// Resources
PaperType = new ResourceImpl(pp_voc + "#paper_type");
- [Gzz-commits] fenfire/org/fenfire/modules/pp PPActionsImpl.ja...,
Matti Katila <=