/[fenfire]/fenfire/org/fenfire/loom/Loom.java
ViewVC logotype

Diff of /fenfire/org/fenfire/loom/Loom.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.17 by benja, Sun Mar 9 00:09:06 2003 UTC revision 1.18 by benja, Sun Mar 9 00:57:59 2003 UTC
# Line 49  public class Loom { Line 49  public class Loom {
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...");
# Line 81  public class Loom { Line 87  public class Loom {
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    
# Line 114  public class Loom { Line 120  public class Loom {
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);
# Line 128  public class Loom { Line 135  public class Loom {
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                      }                      }

Legend:
Removed from v.1.17  
changed lines
  Added in v.1.18

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26