gzz-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gzz-commits] fenfire/org/fenfire/modules/pp PPActionsImpl.java


From: Matti Katila
Subject: [Gzz-commits] fenfire/org/fenfire/modules/pp PPActionsImpl.java
Date: Fri, 07 Mar 2003 09:58:28 -0500

CVSROOT:        /cvsroot/fenfire
Module name:    fenfire
Changes by:     Matti Katila <address@hidden>   03/03/07 09:58:27

Modified files:
        org/fenfire/modules/pp: PPActionsImpl.java 

Log message:
        clean a bit

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/fenfire/fenfire/org/fenfire/modules/pp/PPActionsImpl.java.diff?tr1=1.3&tr2=1.4&r1=text&r2=text

Patches:
Index: fenfire/org/fenfire/modules/pp/PPActionsImpl.java
diff -u fenfire/org/fenfire/modules/pp/PPActionsImpl.java:1.3 
fenfire/org/fenfire/modules/pp/PPActionsImpl.java:1.4
--- fenfire/org/fenfire/modules/pp/PPActionsImpl.java:1.3       Fri Mar  7 
09:24:51 2003
+++ fenfire/org/fenfire/modules/pp/PPActionsImpl.java   Fri Mar  7 09:58:27 2003
@@ -15,7 +15,7 @@
 /** The implementation of PPActions.
  */
 public class PPActionsImpl extends UnicastRemoteObject implements PPActions {
-public static final String rcsid = "$Id: PPActionsImpl.java,v 1.3 2003/03/07 
14:24:51 mudyc Exp $";
+public static final String rcsid = "$Id: PPActionsImpl.java,v 1.4 2003/03/07 
14:58:27 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); }
@@ -26,6 +26,7 @@
     }
 
 
+    // Propertys
     static public Property CONTAINS;
     static public Property CREATION_TIME;
     static public Property COORD_X; 
@@ -33,6 +34,7 @@
     static public Property DEPTH;
 
 
+    // Resources
     static public Resource PAPER_TYPE;
     static public Resource NOTE;
 
@@ -42,26 +44,18 @@
        super();
        setModel(model);
 
+       String pp_voc = "http://fenfire.org/vocabulary/pp.html";;
        try {
-           CONTAINS =
-               new 
PropertyImpl("http://fenfire.org/vocabularity/pp.html#contains";);
-           CREATION_TIME =
-               new 
PropertyImpl("http://fenfire.org/vocabularity/pp.html#creationTime";);
-           COORD_X = 
-               new 
PropertyImpl("http://fenfire.org/vocabularity/pp.html#coordX";);
-           COORD_Y =
-               new 
PropertyImpl("http://fenfire.org/vocabularity/pp.html#coordY";);
-           DEPTH = 
-               new 
PropertyImpl("http://fenfire.org/vocabularity/pp.html#depth";);
-
+           // Propertys
+           CONTAINS = new PropertyImpl(pp_voc+"#contains");
+           CREATION_TIME = new PropertyImpl(pp_voc + "#creationTime");
+           COORD_X = new PropertyImpl(pp_voc + "#coordX");
+           COORD_Y = new PropertyImpl(pp_voc + "#coordY");
+           DEPTH = new PropertyImpl(pp_voc + "#depth");
 
            // Resources
-           PAPER_TYPE =
-               new 
ResourceImpl("http://fenfire.org/vocabularity/pp.html#paper_type";);
-           NOTE =
-               new 
ResourceImpl("http://fenfire.org/vocabularity/pp.html#note";);
-
-
+           PAPER_TYPE = new ResourceImpl(pp_voc + "#paper_type");
+           NOTE = new ResourceImpl(pp_voc + "#note");
        } catch (RDFException e) {
            pa("Failed: "+e);
        }
@@ -123,49 +117,33 @@
 
     public String newNote(String paperURI, int x, int y, String text)
        throws RemoteException 
-    { synchronized(model) {
-       /*
-       Cell c = space.getCell(paperId);
+    { synchronized(model) { try {
 
-       p("New note\n");
-       c = c.N(d.contains);
-       c.setText(text); // XXX null content crashes
-       Cell arg = c.N(d.pan);
-       arg.setText("" + x);
-       arg = arg.N(d.pan);
-       arg.setText("" + y);
-       return c.getId();
-       */
+       // find the paper
+       Resource paper = model.getResource(paperURI);
        
-       try {
-
-           // find the paper
-           Resource paper = model.getResource(paperURI);
-       
-           // We need a unique uri for note    
-           String uri = (new URN5NameSpace()).generateId();
-           Resource note = model.createResource(uri);
-           note.addProperty(RDF.type, NOTE);
-
-           // set note to paper
-           paper.addProperty(CONTAINS, note);
-
-           // set coords
-           note.addProperty(COORD_X, ""+x);
-           note.addProperty(COORD_X, ""+x);
-
-           // set depth...
-           note.addProperty(DEPTH,  "5");
-
-           // scale etc..  XXX
-
-           return uri;
-
-       } catch (RDFException e) {
-           pa("Fault doing a new note: "+e);
-           return "";
-       }
-    }}
+       // We need a unique uri for note        
+       String uri = (new URN5NameSpace()).generateId();
+       Resource note = model.createResource(uri);
+       note.addProperty(RDF.type, NOTE);
+
+       // set note to paper
+       paper.addProperty(CONTAINS, note);
+
+       // set coords
+       note.addProperty(COORD_X, ""+x);
+       note.addProperty(COORD_X, ""+x);
+
+       // set depth...
+       note.addProperty(DEPTH,  "5");
+
+       // scale etc..  XXX
+
+       return uri;
+    } catch (RDFException e) {
+       pa("Fault doing a new note: "+e);
+       return "";
+    }}}
 
     public void deleteNote(String noteURI)
                    throws RemoteException 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]