49 |
|
|
50 |
protected ColorScheme colors; |
protected ColorScheme colors; |
51 |
|
|
52 |
public static Model load(String filename) throws RDFException, |
protected Model model; |
53 |
IOException { |
protected NamespaceMap names; |
54 |
Model model = new ModelMem(); |
|
55 |
|
public void load(String filename) throws RDFException, |
56 |
|
IOException, |
57 |
|
org.xml.sax.SAXException { |
58 |
|
model = new ModelMem(); |
59 |
model.read(new java.io.FileReader(filename), ""); |
model.read(new java.io.FileReader(filename), ""); |
60 |
return model; |
|
61 |
|
names = new NamespaceMap(); |
62 |
|
names.loadMappings(new java.io.FileReader(filename)); |
63 |
} |
} |
64 |
|
|
65 |
public static void main(String[] args) throws RDFException, IOException { |
public static void main(String[] args) throws RDFException, IOException, |
66 |
gzz.vob.impl.DefaultVobMatcher.dbg = true; |
org.xml.sax.SAXException { |
67 |
String file = ""; |
String file = ""; |
68 |
|
|
69 |
System.err.println("Fenfire Loom starting..."); |
System.err.println("Fenfire Loom starting..."); |
87 |
protected NodeView.Nodespec lastRotation; |
protected NodeView.Nodespec lastRotation; |
88 |
|
|
89 |
public Loom(String file, ColorScheme colors0) |
public Loom(String file, ColorScheme colors0) |
90 |
throws RDFException, IOException { |
throws RDFException, IOException, org.xml.sax.SAXException { |
91 |
|
|
92 |
|
load(file); |
93 |
this.colors = colors0; |
this.colors = colors0; |
94 |
|
|
|
final Model model = load(file); |
|
95 |
final Statement stmt = model.listStatements().next(); |
final Statement stmt = model.listStatements().next(); |
96 |
final GraphicsAPI api = GraphicsAPI.getInstance(); |
final GraphicsAPI api = GraphicsAPI.getInstance(); |
97 |
|
|
120 |
} |
} |
121 |
|
|
122 |
String s = node.toString(); |
String s = node.toString(); |
123 |
|
if(node instanceof Resource) s = names.getAbbrev(s); |
124 |
if(s.length() > 27) s = "..." + s.substring(s.length()-24); |
if(s.length() > 27) s = "..." + s.substring(s.length()-24); |
125 |
|
|
126 |
float w = style.getWidth(s, 1); |
float w = style.getWidth(s, 1); |
135 |
|
|
136 |
if(prop != null) { |
if(prop != null) { |
137 |
s = prop.toString(); |
s = prop.toString(); |
138 |
|
s = names.getAbbrev(s); |
139 |
if(s.length() > 25) s = s.substring(s.length()-25); |
if(s.length() > 25) s = s.substring(s.length()-25); |
140 |
sc.map.put(new TextVob(style, s), propCs); |
sc.map.put(new TextVob(style, s), propCs); |
141 |
} |
} |