[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gzz-commits] fenfire ./TODO-loom org/fenfire/loom/Loom.java ...
From: |
Benja Fallenstein |
Subject: |
[Gzz-commits] fenfire ./TODO-loom org/fenfire/loom/Loom.java ... |
Date: |
Sat, 08 Mar 2003 19:58:00 -0500 |
CVSROOT: /cvsroot/fenfire
Module name: fenfire
Changes by: Benja Fallenstein <address@hidden> 03/03/08 19:57:59
Modified files:
. : TODO-loom
org/fenfire/loom: Loom.java
Added files:
org/fenfire/loom: NamespaceMap.java NamespaceMap.test
Log message:
Use namespace prefixes from XML file
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/fenfire/fenfire/TODO-loom.diff?tr1=1.24&tr2=1.25&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/fenfire/fenfire/org/fenfire/loom/NamespaceMap.java?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/fenfire/fenfire/org/fenfire/loom/NamespaceMap.test?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/fenfire/fenfire/org/fenfire/loom/Loom.java.diff?tr1=1.17&tr2=1.18&r1=text&r2=text
Patches:
Index: fenfire/TODO-loom
diff -u fenfire/TODO-loom:1.24 fenfire/TODO-loom:1.25
--- fenfire/TODO-loom:1.24 Sat Mar 8 19:09:04 2003
+++ fenfire/TODO-loom Sat Mar 8 19:57:58 2003
@@ -22,10 +22,6 @@
if only three nodes are shown, the angles still
aren't greater than 45 degs or so
- - allow specifying namespaces (as in RDF/XML) and display
- URIs using those namespaces-- i.e., rdf:type instead of
- http://www.w3.org/1999/02/22-rdf-syntax-ns#type
-
- PUI menu bar:
- File: Open, Quit
- View: Simple, Wheel
Index: fenfire/org/fenfire/loom/Loom.java
diff -u fenfire/org/fenfire/loom/Loom.java:1.17
fenfire/org/fenfire/loom/Loom.java:1.18
--- fenfire/org/fenfire/loom/Loom.java:1.17 Sat Mar 8 19:09:06 2003
+++ fenfire/org/fenfire/loom/Loom.java Sat Mar 8 19:57:59 2003
@@ -49,15 +49,21 @@
protected ColorScheme colors;
- public static Model load(String filename) throws RDFException,
- IOException {
- Model model = new ModelMem();
+ protected Model model;
+ protected NamespaceMap names;
+
+ public void load(String filename) throws RDFException,
+ IOException,
+ org.xml.sax.SAXException {
+ model = new ModelMem();
model.read(new java.io.FileReader(filename), "");
- return model;
+
+ names = new NamespaceMap();
+ names.loadMappings(new java.io.FileReader(filename));
}
- public static void main(String[] args) throws RDFException, IOException {
- gzz.vob.impl.DefaultVobMatcher.dbg = true;
+ public static void main(String[] args) throws RDFException, IOException,
+ org.xml.sax.SAXException {
String file = "";
System.err.println("Fenfire Loom starting...");
@@ -81,11 +87,11 @@
protected NodeView.Nodespec lastRotation;
public Loom(String file, ColorScheme colors0)
- throws RDFException, IOException {
+ throws RDFException, IOException, org.xml.sax.SAXException {
+ load(file);
this.colors = colors0;
- final Model model = load(file);
final Statement stmt = model.listStatements().next();
final GraphicsAPI api = GraphicsAPI.getInstance();
@@ -114,6 +120,7 @@
}
String s = node.toString();
+ if(node instanceof Resource) s = names.getAbbrev(s);
if(s.length() > 27) s = "..." + s.substring(s.length()-24);
float w = style.getWidth(s, 1);
@@ -128,6 +135,7 @@
if(prop != null) {
s = prop.toString();
+ s = names.getAbbrev(s);
if(s.length() > 25) s = s.substring(s.length()-25);
sc.map.put(new TextVob(style, s), propCs);
}