13 |
*/ |
*/ |
14 |
public class PPActionsImpl extends UnicastRemoteObject implements PPActions { |
public class PPActionsImpl extends UnicastRemoteObject implements PPActions { |
15 |
public static final String rcsid = "$Id$"; |
public static final String rcsid = "$Id$"; |
16 |
public static final boolean dbg = false; |
public static final boolean dbg = true; |
17 |
protected static void p(String s) { if(dbg) pa(s); } |
protected static void p(String s) { if(dbg) pa(s); } |
18 |
protected static void pa(String s) { System.out.println("PPActionsImpl: "+s); } |
protected static void pa(String s) { System.out.println("PPActionsImpl: "+s); } |
19 |
|
|
49 |
|
|
50 |
public void deletePaper(String paperURI) throws RemoteException |
public void deletePaper(String paperURI) throws RemoteException |
51 |
{ synchronized(fen) { |
{ synchronized(fen) { |
52 |
|
if(dbg) pa("DeletePaper [NOT IMPLEMENTED]: "+paperURI); |
53 |
/* |
/* |
54 |
// must delete all notes first |
// must delete all notes first |
55 |
Cell paper = space.getCell(paperId).h(d.contains, -1); |
Cell paper = space.getCell(paperId).h(d.contains, -1); |
72 |
public String newNote(String paperURI, int x, int y, String text) |
public String newNote(String paperURI, int x, int y, String text) |
73 |
throws RemoteException |
throws RemoteException |
74 |
{ synchronized(fen) { |
{ synchronized(fen) { |
75 |
|
if(dbg) pa("New note: "+paperURI+" "+x+" "+y+" "+text); |
76 |
|
|
77 |
// find the paper |
// find the paper |
78 |
Object paper = Nodes.get(paperURI); |
Object paper = Nodes.get(paperURI); |
107 |
public void deleteNote(String noteURI) |
public void deleteNote(String noteURI) |
108 |
throws RemoteException |
throws RemoteException |
109 |
{ synchronized(fen) { |
{ synchronized(fen) { |
110 |
|
if(dbg) pa("Delete note [NOT IMPLEMENTED]: "+noteURI); |
111 |
/* |
/* |
112 |
// MUST DELETE ALL ASSOCS FIRST |
// MUST DELETE ALL ASSOCS FIRST |
113 |
|
|
148 |
public void moveNote(String noteURI, int x, int y) |
public void moveNote(String noteURI, int x, int y) |
149 |
throws RemoteException |
throws RemoteException |
150 |
{ synchronized(fen) { |
{ synchronized(fen) { |
151 |
|
if(dbg) pa("Move note: "+noteURI+" "+x+" "+y); |
152 |
Object note = Nodes.get(noteURI); |
Object note = Nodes.get(noteURI); |
153 |
if (note == null) return; |
if (note == null) return; |
154 |
|
|
165 |
public void assocNotes(String noteURI, int side, String assocURI) |
public void assocNotes(String noteURI, int side, String assocURI) |
166 |
throws RemoteException |
throws RemoteException |
167 |
{ synchronized(fen) { |
{ synchronized(fen) { |
168 |
|
if(dbg) pa("Assoc notes: "+noteURI+" "+side+" "+assocURI); |
169 |
Object note = Nodes.get(noteURI); |
Object note = Nodes.get(noteURI); |
170 |
Object assoc = Nodes.get(assocURI); |
Object assoc = Nodes.get(assocURI); |
171 |
|
|
198 |
public void detachNotes(String id1, int side, String id2) |
public void detachNotes(String id1, int side, String id2) |
199 |
throws RemoteException |
throws RemoteException |
200 |
{ synchronized(fen) { |
{ synchronized(fen) { |
201 |
|
if(dbg) pa("Detach notes: "+id1+" "+side+" "+id2); |
202 |
|
|
203 |
/* |
/* |
204 |
Cell c1 = space.getCell(id1).h(d.clone); |
Cell c1 = space.getCell(id1).h(d.clone); |
228 |
public void insertText(String noteURI, int offs, String text) |
public void insertText(String noteURI, int offs, String text) |
229 |
throws RemoteException |
throws RemoteException |
230 |
{ synchronized(fen) { |
{ synchronized(fen) { |
231 |
alphContent.insertText( |
if(dbg) pa("Insert text: "+noteURI+" "+offs+" "+text); |
232 |
Nodes.get(noteURI), offs, text, true |
alphContent.insertText( |
233 |
|
Nodes.get(noteURI), offs, text, true |
234 |
); |
); |
235 |
}} |
}} |
236 |
|
|
238 |
public void deleteText(String noteURI, int begin, int end) |
public void deleteText(String noteURI, int begin, int end) |
239 |
throws RemoteException |
throws RemoteException |
240 |
{ synchronized(fen) { |
{ synchronized(fen) { |
241 |
alphContent.deleteText( |
if(dbg) pa("Delete text: "+noteURI+" "+begin+" "+end); |
242 |
Nodes.get(noteURI), begin, end); |
alphContent.deleteText( |
243 |
|
Nodes.get(noteURI), begin, end); |
244 |
}} |
}} |
245 |
} |
} |