43 |
public Object newRSTCanvas() throws RemoteException |
public Object newRSTCanvas() throws RemoteException |
44 |
{ synchronized(fen) { |
{ synchronized(fen) { |
45 |
if(dbg) p("make a new rst canvas"); |
if(dbg) p("make a new rst canvas"); |
46 |
Object canvas = RDFUtil.N(fen, RST.Canvas); |
Object canvas = RDFUtil.N(fen.graph, RST.Canvas); |
47 |
fen.graph.add(canvas, RDF.type, CANVAS2D.Canvas); |
fen.graph.add(canvas, RDF.type, CANVAS2D.Canvas); |
48 |
return canvas; |
return canvas; |
49 |
}} |
}} |
51 |
public Object newParagraph(Object canvas, int width, int x, int y) |
public Object newParagraph(Object canvas, int width, int x, int y) |
52 |
throws RemoteException |
throws RemoteException |
53 |
{ synchronized(fen) { |
{ synchronized(fen) { |
54 |
if (! RDFUtil.isNodeType(fen, canvas, RST.Canvas)) |
if (! RDFUtil.isNodeType(fen.graph, canvas, RST.Canvas)) |
55 |
throw new Error("canvas is not canvas! "+canvas); |
throw new Error("canvas is not canvas! "+canvas); |
56 |
if (canvas == null) throw new Error("canvas is null!"); |
if (canvas == null) throw new Error("canvas is null!"); |
57 |
Object parag = RDFUtil.N(fen, RST.Paragraph); |
Object parag = RDFUtil.N(fen.graph, RST.Paragraph); |
58 |
|
|
59 |
fen.graph.set1_11X(parag, RST.width, Nodes.getStringLiteral(""+width) ); |
fen.graph.set1_11X(parag, RST.width, Nodes.getStringLiteral(""+width) ); |
60 |
|
|
73 |
public Object newSentence(Object paragraph, int num) |
public Object newSentence(Object paragraph, int num) |
74 |
throws RemoteException |
throws RemoteException |
75 |
{ synchronized(fen) { |
{ synchronized(fen) { |
76 |
if (! RDFUtil.isNodeType(fen, paragraph, RST.Paragraph)) |
if (! RDFUtil.isNodeType(fen.graph, paragraph, RST.Paragraph)) |
77 |
throw new Error("paragraph is not paragraph! "+paragraph); |
throw new Error("paragraph is not paragraph! "+paragraph); |
78 |
Object senten = RDFUtil.N(fen, RST.Sentence); |
Object senten = RDFUtil.N(fen.graph, RST.Sentence); |
79 |
|
|
80 |
if (num < 0) throw new Error("Num is too small"+num); |
if (num < 0) throw new Error("Num is too small"+num); |
81 |
else if (num == 0) { |
else if (num == 0) { |
119 |
public void insertNode(Object sentence, Object node, int offset) |
public void insertNode(Object sentence, Object node, int offset) |
120 |
throws RemoteException |
throws RemoteException |
121 |
{ synchronized(fen) { |
{ synchronized(fen) { |
122 |
if (! RDFUtil.isNodeType(fen, sentence, RST.Sentence)) |
if (! RDFUtil.isNodeType(fen.graph, sentence, RST.Sentence)) |
123 |
throw new Error("sentence is not sentence! "+sentence); |
throw new Error("sentence is not sentence! "+sentence); |
124 |
|
|
125 |
if (offset < 0) throw new Error("Offset is too small"+offset); |
if (offset < 0) throw new Error("Offset is too small"+offset); |
151 |
if (next != null) |
if (next != null) |
152 |
fen.graph.set1_11X(node, RST.nextNode, next); |
fen.graph.set1_11X(node, RST.nextNode, next); |
153 |
} |
} |
154 |
if (! RDFUtil.isNodeType(fen, node, RST.Node)) |
if (! RDFUtil.isNodeType(fen.graph, node, RST.Node)) |
155 |
fen.graph.add(node, RDF.type, RST.Node); |
fen.graph.add(node, RDF.type, RST.Node); |
156 |
|
|
157 |
Object canvas = util.getCanvas( |
Object canvas = util.getCanvas( |