/* */ package NET.worlds.scape; /* */ /* */ import java.io.FileOutputStream; /* */ import java.io.IOException; /* */ import java.util.Enumeration; /* */ import java.util.Hashtable; /* */ import java.util.Vector; /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public class Manifest /* */ { /* */ private IndentStream _out; /* */ /* */ public Manifest(IndentStream out) /* */ { /* 28 */ this._out = out; /* 29 */ this._out.println("MANIFEST Worlds, Inc."); /* 30 */ this._out.indent(); /* */ } /* */ /* */ public Manifest(String name) throws IOException { /* 34 */ this(new IndentStream(new FileOutputStream(name))); /* */ } /* */ /* */ public void done() { /* 38 */ this._out.undent(); /* 39 */ this._out.println("END MANIFEST"); /* 40 */ this._out.close(); /* 41 */ this._out = null; /* 42 */ this._ht = null; /* */ } /* */ /* */ private void printID(String s) { /* 46 */ this._out.print(" (#" + s + ")"); /* */ } /* */ /* 49 */ private Hashtable _ht = new Hashtable(); /* 50 */ private int _lastID = 0; /* */ /* */ /* */ /* */ /* */ /* */ private void printRef(Object obj) /* */ { /* 58 */ if ((obj instanceof SuperRoot)) { /* 59 */ this._out.print(((SuperRoot)obj).getName()); /* */ } else /* 61 */ this._out.print(""); /* 62 */ if (this._ht.containsKey(obj)) { /* 63 */ printID((String)this._ht.get(obj)); /* 64 */ this._out.println(" --q.v.--"); /* */ } else { /* 66 */ String newID = Integer.toString(this._lastID++); /* 67 */ this._ht.put(obj, newID); /* 68 */ printID(newID); /* 69 */ this._out.println(":" + obj.getClass().getName() + " ["); /* 70 */ this._out.indent(); /* 71 */ saveProps((Properties)obj); /* 72 */ this._out.undent(); /* 73 */ this._out.println("]"); /* */ } /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ private void saveMaybeProp(Object obj) /* */ { /* 84 */ if ((obj instanceof Properties)) /* */ { /* 86 */ if (!obj.getClass().getName().equals("NET.worlds.scape.Transform")) { /* 87 */ printRef(obj); /* 88 */ return; } } /* 89 */ this._out.println(obj); /* */ } /* */ /* */ /* */ /* */ /* */ public void saveProps(Properties obj) /* */ { /* 97 */ Enumeration pe = new EnumProperties(obj); /* 98 */ while (pe.hasMoreElements()) { /* 99 */ Property prop = (Property)pe.nextElement(); /* 100 */ this._out.print(prop.getName()); /* 101 */ this._out.print(" := "); /* 102 */ if ((prop instanceof VectorProperty)) { /* 103 */ this._out.println("{"); /* 104 */ this._out.indent(); /* */ /* 106 */ Vector v = (Vector)prop.get(); /* 107 */ if (v != null) { /* 108 */ Enumeration ve = v.elements(); /* 109 */ while (ve.hasMoreElements()) { /* 110 */ saveMaybeProp(ve.nextElement()); /* */ } /* */ } /* 113 */ this._out.undent(); /* 114 */ this._out.println("}"); /* */ } else { /* 116 */ saveMaybeProp(prop.get()); /* */ } /* */ } /* */ } /* */ } /* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\scape\Manifest.class * Java compiler version: 6 (50.0) * JD-Core Version: 0.7.1 */