29 |
import gzz.vob.*; |
import gzz.vob.*; |
30 |
import gzz.vob.vobs.*; |
import gzz.vob.vobs.*; |
31 |
|
|
|
import java.awt.event.MouseEvent; |
|
|
import java.io.*; |
|
32 |
import java.util.*; |
import java.util.*; |
|
|
|
33 |
import com.hp.hpl.mesa.rdf.jena.model.*; |
import com.hp.hpl.mesa.rdf.jena.model.*; |
|
import com.hp.hpl.mesa.rdf.jena.mem.*; |
|
34 |
|
|
35 |
/** A very simple view of an RDF graph. |
/** A very simple view of an RDF graph. |
36 |
* Example: |
* Example: |
58 |
this.nodeView = nodeView; |
this.nodeView = nodeView; |
59 |
} |
} |
60 |
|
|
61 |
public void render(VobScene sc, int into, Resource focus, |
public void render(VobScene sc, int into, Cursor c) { |
|
RDFNode rotation) { |
|
62 |
try { |
try { |
63 |
int midx = sc.size.width/2, midy = sc.size.height/2; |
int midx = sc.size.width/2, midy = sc.size.height/2; |
64 |
int cs = sc.boxCS(into, focus, midx-25, midy-10, 50, 20); |
int cs = sc.boxCS(into, c.focus, midx-25, midy-10, 50, 20); |
65 |
nodeView.render(sc, cs, focus); |
nodeView.render(sc, cs, c.focus); |
66 |
|
|
67 |
SortedSet nodes = new TreeSet(cmp); |
SortedSet nodes = new TreeSet(cmp); |
68 |
StmtIterator i=focus.listProperties(); |
StmtIterator i=c.focus.listProperties(); |
69 |
for(; i.hasNext();) nodes.add(i.next().getObject()); |
for(; i.hasNext();) nodes.add(i.next().getObject()); |
70 |
i.close(); |
i.close(); |
71 |
|
|
72 |
int before = nodes.headSet(rotation).size(); |
int before = nodes.headSet(c.rotation).size(); |
73 |
|
|
74 |
int x = midx + 75, y = midy-10-before*50; |
int x = midx + 75, y = midy-10-before*50; |
75 |
|
|