Changeset 319
- Timestamp:
- 01/31/2011 11:37:49 PM (2 years ago)
- Location:
- branches/dev_xmlmerge
- Files:
-
- 7 added
- 7 edited
- 2 moved
-
settings.xml (added)
-
src/com/romraider/maps/Rom.java (modified) (1 diff)
-
src/com/romraider/metadata/AbstractTableMetadata.java (modified) (1 diff)
-
src/com/romraider/metadata/RomMetadataHandler.java (modified) (1 diff)
-
src/com/romraider/metadata/RomMetadataIndex.java (modified) (1 diff)
-
src/com/romraider/metadata/RomMetadataIndexBuilder.java (modified) (4 diffs)
-
src/com/romraider/metadata/ScalingMetadata.java (added)
-
src/com/romraider/metadata/ScalingMetadataList.java (added)
-
src/com/romraider/metadata/TableMetadataList.java (added)
-
src/com/romraider/metadata/exception (added)
-
src/com/romraider/metadata/exception/RomNotFoundException.java (moved) (moved from branches/dev_xmlmerge/src/com/romraider/metadata/RomNotFoundException.java) (1 diff)
-
src/com/romraider/metadata/exception/ScalingNotFoundException.java (added)
-
src/com/romraider/metadata/exception/TableNotFoundException.java (moved) (moved from branches/dev_xmlmerge/src/com/romraider/xml/TableNotFoundException.java) (1 diff)
-
src/com/romraider/xml/DOMRomMetadataUnmarshaller.java (modified) (1 diff)
-
src/com/romraider/xml/DOMRomUnmarshaller.java (modified) (1 diff)
-
xmlmerge.properties (added)
Legend:
- Unmodified
- Added
- Removed
-
branches/dev_xmlmerge/src/com/romraider/maps/Rom.java
r282 r319 22 22 import com.romraider.editor.ecu.ECUEditor; 23 23 import com.romraider.logger.ecu.ui.handler.table.TableUpdateHandler; 24 import com.romraider.metadata.exception.TableNotFoundException; 24 25 import com.romraider.swing.JProgressPane; 25 import com.romraider.xml.TableNotFoundException;26 26 import org.apache.log4j.Logger; 27 27 import javax.swing.JOptionPane; -
branches/dev_xmlmerge/src/com/romraider/metadata/AbstractTableMetadata.java
r316 r319 3 3 public abstract class AbstractTableMetadata { 4 4 5 private String name; 6 7 public String getName() { 8 return this.name; 9 } 10 11 public void setName(String name) { 12 this.name = name; 13 } 5 14 } -
branches/dev_xmlmerge/src/com/romraider/metadata/RomMetadataHandler.java
r316 r319 10 10 import org.xml.sax.InputSource; 11 11 import org.xml.sax.SAXException; 12 13 import com.romraider.metadata.exception.RomNotFoundException; 12 14 import com.romraider.xml.DOMRomMetadataRefactorUtil; 13 15 import com.romraider.xml.DOMRomMetadataUnmarshaller; -
branches/dev_xmlmerge/src/com/romraider/metadata/RomMetadataIndex.java
r316 r319 1 1 package com.romraider.metadata; 2 3 import com.romraider.metadata.exception.RomNotFoundException; 2 4 3 5 -
branches/dev_xmlmerge/src/com/romraider/metadata/RomMetadataIndexBuilder.java
r316 r319 1 1 package com.romraider.metadata; 2 2 3 import java.io.BufferedWriter;4 5 import com.sun.org.apache.xml.internal.serialize.OutputFormat;6 import com.sun.org.apache.xml.internal.serialize.XMLSerializer;7 3 import java.io.File; 8 import java.io.FileInputStream;9 4 import java.io.FileNotFoundException; 10 5 import java.io.FileOutputStream; 11 import java.io.FileWriter;12 import java.util.Iterator;13 6 import java.util.List; 14 7 import java.util.Vector; 15 import javax.management.modelmbean.XMLParseException;16 8 import javax.xml.transform.Transformer; 17 9 import javax.xml.transform.TransformerFactory; 18 19 import org.w3c.dom.Document;20 import org.w3c.dom.Node;21 import org.xml.sax.InputSource;22 import ch.elca.el4j.services.xmlmerge.XmlMerge;23 import ch.elca.el4j.services.xmlmerge.merge.DefaultXmlMerge;24 import com.romraider.maps.Rom;25 import com.romraider.swing.JProgressPane;26 10 import com.romraider.util.FileListing; 27 11 import com.romraider.xml.DOMRomMetadataUnmarshaller; … … 40 24 41 25 try { 42 romVector.addAll(DOMRomMetadataUnmarshaller.unmarshallRomIDIndex(f));26 //romVector.addAll(DOMRomMetadataUnmarshaller.unmarshallRomIDIndex(f)); 43 27 44 28 } catch (Exception x) { … … 67 51 68 52 69 /*long time1 = System.currentTimeMillis();53 long time1 = System.currentTimeMillis(); 70 54 try { 71 55 … … 76 60 System.out.println(romIndex.size() + " index built in " + (time2 - time1) + "ms"); 77 61 78 RomMetadataHandler.getMetadata(input, romIndex);*/ 79 80 81 82 /*InputSource src1 = new InputSource(new FileInputStream(new File("c:\\users\\owner\\desktop\\16BITBASE.xml"))); 83 DOMParser parser = new DOMParser(); 84 parser.parse(src1); 85 Document root1 = parser.getDocument(); 86 87 InputSource src2 = new InputSource(new FileInputStream(new File("c:\\users\\owner\\desktop\\A4TF400E.xml"))); 88 parser.parse(src2); 89 Document root2 = parser.getDocument(); 90 91 Document[] docs = new Document[] {root1, root2}; 92 93 XmlMerge merge = new DefaultXmlMerge(); 94 Document mergedDoc = merge.merge(docs); 95 96 File output = new File("c:\\users\\owner\\desktop\\new.xml"); 97 FileOutputStream fos = new FileOutputStream(output); 98 OutputFormat of = new OutputFormat("XML", "ISO-8859-1", true); 99 of.setIndent(1); 100 of.setIndenting(true); 101 102 try { 103 XMLSerializer serializer = new XMLSerializer(fos, of); 104 serializer.serialize(mergedDoc); 105 fos.flush(); 106 } finally { 107 fos.close(); 108 } 109 62 RomMetadataHandler.getMetadata(input, romIndex); 110 63 111 64 112 65 } catch (Exception e) { 113 66 e.printStackTrace(); 114 } */67 } 115 68 116 69 } -
branches/dev_xmlmerge/src/com/romraider/metadata/exception/RomNotFoundException.java
r318 r319 1 package com.romraider.metadata ;1 package com.romraider.metadata.exception; 2 2 3 3 public class RomNotFoundException extends Exception { -
branches/dev_xmlmerge/src/com/romraider/metadata/exception/TableNotFoundException.java
r318 r319 18 18 */ 19 19 20 package com.romraider. xml;20 package com.romraider.metadata.exception; 21 21 22 22 public final class TableNotFoundException extends Exception { -
branches/dev_xmlmerge/src/com/romraider/xml/DOMRomMetadataUnmarshaller.java
r316 r319 13 13 import org.xml.sax.SAXException; 14 14 import com.romraider.metadata.RomIndexID; 15 import com.romraider.metadata.RomMetadata; 15 16 import com.sun.org.apache.xerces.internal.parsers.DOMParser; 16 17 17 18 public class DOMRomMetadataUnmarshaller { 19 20 private RomMetadata r; 21 22 public DOMRomMetadataUnmarshaller() { 23 r = new RomMetadata(); 24 } 18 25 19 public staticVector<RomIndexID> unmarshallRomIDIndex(File file) throws SAXException, IOException {26 public Vector<RomIndexID> unmarshallRomIDIndex(File file) throws SAXException, IOException { 20 27 21 28 Vector<RomIndexID> romVector = new Vector<RomIndexID>(); -
branches/dev_xmlmerge/src/com/romraider/xml/DOMRomUnmarshaller.java
r306 r319 33 33 import com.romraider.maps.Table3D; 34 34 import com.romraider.maps.TableSwitch; 35 import com.romraider.metadata.exception.TableNotFoundException; 35 36 import com.romraider.swing.DebugPanel; 36 37 import com.romraider.swing.JProgressPane;
Note: See TracChangeset
for help on using the changeset viewer.