18 |
protected static void pa(String s) { System.out.println("PPActionsImpl: "+s); } |
protected static void pa(String s) { System.out.println("PPActionsImpl: "+s); } |
19 |
|
|
20 |
private Fen fen = null; |
private Fen fen = null; |
21 |
public void setSwamp(Fen fen) { this.fen = fen; } |
private AlphContent alphContent; |
22 |
|
public void setSwamp(Fen fen) { |
23 |
|
this.fen = fen; |
24 |
|
this.alphContent = new AlphContent(fen); |
25 |
|
} |
26 |
|
|
27 |
public PPActionsImpl(Fen fen) throws RemoteException { |
public PPActionsImpl(Fen fen) throws RemoteException { |
28 |
super(); |
super(); |
94 |
// set depth... |
// set depth... |
95 |
fen.graph.set1_11X(note, PP.depth, Nodes.getStringLiteral("10") ); |
fen.graph.set1_11X(note, PP.depth, Nodes.getStringLiteral("10") ); |
96 |
|
|
97 |
|
// Set text |
98 |
|
alphContent.setText(note, text, true); |
99 |
|
|
100 |
// scale etc.. XXX |
// scale etc.. XXX |
101 |
return note.toString(); |
return note.toString(); |
102 |
}} |
}} |
222 |
|
|
223 |
public void insertText(String noteURI, int offs, String text) |
public void insertText(String noteURI, int offs, String text) |
224 |
throws RemoteException |
throws RemoteException |
225 |
{ synchronized(fen) { //try { |
{ synchronized(fen) { |
226 |
/* |
alphContent.insertText( |
227 |
Cell note = space.getCell(noteId); |
Nodes.get(noteURI), offs, text, true |
228 |
note.insertText(offs, text); |
); |
|
*/ |
|
|
|
|
|
/* |
|
|
Resource note = model.getResource(noteURI); |
|
|
|
|
|
// find actual data |
|
|
Selector s = |
|
|
new SelectorImpl(note, PP.LinkToContentRef, (RDFNode) null); |
|
|
StmtIterator iter = model.listStatements(s); |
|
|
Statement stmt = null; |
|
|
while (iter.hasNext()) { |
|
|
if (stmt != null) throw new Error("Too many data!!"); |
|
|
stmt = iter.next(); |
|
|
} |
|
|
|
|
|
Resource data = (Resource) stmt.getObject(); |
|
|
|
|
|
// find literal |
|
|
s = new SelectorImpl(data, PP.Data, (RDFNode) null); |
|
|
iter = model.listStatements(s); |
|
|
stmt = null; |
|
|
while (iter.hasNext()) { |
|
|
if (stmt != null) throw new Error("Too many data!!"); |
|
|
stmt = iter.next(); |
|
|
} |
|
|
|
|
|
StringBuffer str = new StringBuffer(stmt.getObject().toString()); |
|
|
model.remove(stmt); |
|
|
str.insert(offs, text); |
|
|
data.addProperty(PP.Data, str.toString()); |
|
|
|
|
|
} catch (RDFException e) { |
|
|
pa("Fault inserting text to note: "+e); |
|
|
} */ |
|
229 |
}} |
}} |
230 |
|
|
231 |
|
|
232 |
public void deleteText(String noteURI, int begin, int end) |
public void deleteText(String noteURI, int begin, int end) |
233 |
throws RemoteException |
throws RemoteException |
234 |
{ synchronized(fen) { // try { |
{ synchronized(fen) { |
235 |
/* |
alphContent.deleteText( |
236 |
Cell note = space.getCell(noteId); |
Nodes.get(noteURI), begin, end); |
|
note.deleteText(begin, end); |
|
|
*/ |
|
|
|
|
|
/* |
|
|
Resource note = model.getResource(noteURI); |
|
|
|
|
|
// find actual data |
|
|
Selector s = |
|
|
new SelectorImpl(note, PP.LinkToContentRef, (RDFNode) null); |
|
|
StmtIterator iter = model.listStatements(s); |
|
|
Statement stmt = null; |
|
|
while (iter.hasNext()) { |
|
|
if (stmt != null) throw new Error("Too many data!!"); |
|
|
stmt = iter.next(); |
|
|
} |
|
|
|
|
|
Resource data = (Resource) stmt.getObject(); |
|
|
|
|
|
// find literal |
|
|
s = new SelectorImpl(data, PP.Data, (RDFNode) null); |
|
|
iter = model.listStatements(s); |
|
|
stmt = null; |
|
|
while (iter.hasNext()) { |
|
|
if (stmt != null) throw new Error("Too many data!!"); |
|
|
stmt = iter.next(); |
|
|
} |
|
|
|
|
|
StringBuffer str = new StringBuffer(stmt.getObject().toString()); |
|
|
model.remove(stmt); |
|
|
str.delete(begin, end); |
|
|
data.addProperty(PP.Data, str.toString()); |
|
|
|
|
|
} catch (RDFException e) { |
|
|
pa("Fault deleting text from the note: "+e); |
|
|
} |
|
|
*/ |
|
237 |
}} |
}} |
238 |
} |
} |