26 |
*/ |
*/ |
27 |
package gzz.loom; |
package gzz.loom; |
28 |
import gzz.vob.*; |
import gzz.vob.*; |
29 |
|
import gzz.vob.vobs.*; |
30 |
import com.hp.hpl.mesa.rdf.jena.model.*; |
import com.hp.hpl.mesa.rdf.jena.model.*; |
31 |
|
|
32 |
/** A very simple view of an RDF graph. |
/** A very simple view of an RDF graph. |
41 |
*/ |
*/ |
42 |
public class SimpleView implements View { |
public class SimpleView implements View { |
43 |
|
|
44 |
|
final RectBgVob bg = new RectBgVob(); |
45 |
|
|
46 |
public void render(VobScene sc, int into, Resource focus, |
public void render(VobScene sc, int into, Resource focus, |
47 |
RDFNode rotation) { |
RDFNode rotation) { |
48 |
try { |
try { |
49 |
int cs = sc.boxCS(into, focus, 0, 0, 50, 20); |
int cs = sc.boxCS(into, focus, 0, 0, 50, 20); |
50 |
int csr = sc.boxCS(into, rotation, 100, 0, 50, 20); |
sc.map.put(bg, cs); |
51 |
|
cs = sc.boxCS(into, rotation, 100, 0, 50, 20); |
52 |
|
sc.map.put(bg, cs); |
53 |
StmtIterator i=focus.listProperties(); |
StmtIterator i=focus.listProperties(); |
54 |
int y = 50; |
int y = 50; |
55 |
for(; i.hasNext();) { |
for(; i.hasNext();) { |
56 |
Statement s = i.next(); |
Statement s = i.next(); |
57 |
if(s.getObject().equals(rotation)) continue; |
if(s.getObject().equals(rotation)) continue; |
58 |
sc.boxCS(into, s.getObject(), 100, y, 50, 20); |
cs = sc.boxCS(into, s.getObject(), 100, y, 50, 20); |
59 |
|
sc.map.put(bg, cs); |
60 |
y += 50; |
y += 50; |
61 |
} |
} |
62 |
i.close(); |
i.close(); |