Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Eclipse is puking, I need to re-check out the whole project. I think.

git-svn-id: https://svn2.assembla.com/svn/romraider/branches/dev_xmlmerge@319 38686702-15cf-42e4-a595-3071df8bf5ea
  • Loading branch information...
commit 6768bf949f4fd5e520b8c4268a222b20627b1827 1 parent 260e4ff
@qoncept96 qoncept96 authored
View
46 settings.xml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<settings>
+ <window>
+ <maximized value="false"/>
+ <size x="600" y="800"/>
+ <location x="400" y="150"/>
+ <splitpane location="150"/>
+ </window>
+ <files>
+ <image_dir path="C:\workspace\romraider\images"/>
+ </files>
+ <options>
+ <obsoletewarning value="true"/>
+ <calcconflictwarning value="true"/>
+ <debug value="false"/>
+ <userlevel value="1"/>
+ <tableclickcount value="1"/>
+ <version value="0.5.3 Beta RC7"/>
+ <savedebugtables value="true"/>
+ <displayhightables value="true"/>
+ <valuelimitwarning value="true"/>
+ </options>
+ <tabledisplay>
+ <font face="Arial" size="11" decoration="1"/>
+ <cellsize height="18" width="42"/>
+ <colors>
+ <max r="255" g="102" b="102"/>
+ <min r="153" g="153" b="255"/>
+ <highlight r="204" g="204" b="204"/>
+ <increaseborder r="255" g="0" b="0"/>
+ <decreaseborder r="0" g="0" b="255"/>
+ <axis r="255" g="255" b="255"/>
+ <warning r="255" g="0" b="0"/>
+ </colors>
+ </tabledisplay>
+ <logger>
+ <serial port="" refresh="true"/>
+ <maximized value="false"/>
+ <size x="600" y="1000"/>
+ <location x="0" y="0"/>
+ <tabs selected="0" showlist="true"/>
+ <definition path=""/>
+ <profile path=""/>
+ <filelogging path="C:\Users\owner" switchid="S20" active="true" absolutetimestamp="false"/>
+ </logger>
+</settings>
View
2  src/com/romraider/maps/Rom.java
@@ -21,8 +21,8 @@
import com.romraider.editor.ecu.ECUEditor;
import com.romraider.logger.ecu.ui.handler.table.TableUpdateHandler;
+import com.romraider.metadata.exception.TableNotFoundException;
import com.romraider.swing.JProgressPane;
-import com.romraider.xml.TableNotFoundException;
import org.apache.log4j.Logger;
import javax.swing.JOptionPane;
import java.io.File;
View
9 src/com/romraider/metadata/AbstractTableMetadata.java
@@ -2,4 +2,13 @@
public abstract class AbstractTableMetadata {
+ private String name;
+
+ public String getName() {
+ return this.name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
}
View
2  src/com/romraider/metadata/RomMetadataHandler.java
@@ -9,6 +9,8 @@
import org.w3c.dom.NodeList;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
+
+import com.romraider.metadata.exception.RomNotFoundException;
import com.romraider.xml.DOMRomMetadataRefactorUtil;
import com.romraider.xml.DOMRomMetadataUnmarshaller;
import com.sun.org.apache.xerces.internal.parsers.DOMParser;
View
2  src/com/romraider/metadata/RomMetadataIndex.java
@@ -1,5 +1,7 @@
package com.romraider.metadata;
+import com.romraider.metadata.exception.RomNotFoundException;
+
public class RomMetadataIndex {
View
55 src/com/romraider/metadata/RomMetadataIndexBuilder.java
@@ -1,28 +1,12 @@
package com.romraider.metadata;
-import java.io.BufferedWriter;
-
-import com.sun.org.apache.xml.internal.serialize.OutputFormat;
-import com.sun.org.apache.xml.internal.serialize.XMLSerializer;
import java.io.File;
-import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
-import java.io.FileWriter;
-import java.util.Iterator;
import java.util.List;
import java.util.Vector;
-import javax.management.modelmbean.XMLParseException;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-import org.xml.sax.InputSource;
-import ch.elca.el4j.services.xmlmerge.XmlMerge;
-import ch.elca.el4j.services.xmlmerge.merge.DefaultXmlMerge;
-import com.romraider.maps.Rom;
-import com.romraider.swing.JProgressPane;
import com.romraider.util.FileListing;
import com.romraider.xml.DOMRomMetadataUnmarshaller;
import com.sun.org.apache.xerces.internal.parsers.DOMParser;
@@ -39,7 +23,7 @@ public static RomMetadataIndex createIndex(File path) throws FileNotFoundExcepti
if (f.isFile()) {
try {
- romVector.addAll(DOMRomMetadataUnmarshaller.unmarshallRomIDIndex(f));
+ //romVector.addAll(DOMRomMetadataUnmarshaller.unmarshallRomIDIndex(f));
} catch (Exception x) {
// TODO: Handle invalid definitions
@@ -66,7 +50,7 @@ public static void main(String[] args) {
}
- /*long time1 = System.currentTimeMillis();
+ long time1 = System.currentTimeMillis();
try {
File testdir = new File("c:\\users\\owner\\desktop\\rommetadata");
@@ -75,43 +59,12 @@ public static void main(String[] args) {
long time2 = System.currentTimeMillis();
System.out.println(romIndex.size() + " index built in " + (time2 - time1) + "ms");
- RomMetadataHandler.getMetadata(input, romIndex);*/
-
-
-
- /*InputSource src1 = new InputSource(new FileInputStream(new File("c:\\users\\owner\\desktop\\16BITBASE.xml")));
- DOMParser parser = new DOMParser();
- parser.parse(src1);
- Document root1 = parser.getDocument();
-
- InputSource src2 = new InputSource(new FileInputStream(new File("c:\\users\\owner\\desktop\\A4TF400E.xml")));
- parser.parse(src2);
- Document root2 = parser.getDocument();
-
- Document[] docs = new Document[] {root1, root2};
-
- XmlMerge merge = new DefaultXmlMerge();
- Document mergedDoc = merge.merge(docs);
-
- File output = new File("c:\\users\\owner\\desktop\\new.xml");
- FileOutputStream fos = new FileOutputStream(output);
- OutputFormat of = new OutputFormat("XML", "ISO-8859-1", true);
- of.setIndent(1);
- of.setIndenting(true);
-
- try {
- XMLSerializer serializer = new XMLSerializer(fos, of);
- serializer.serialize(mergedDoc);
- fos.flush();
- } finally {
- fos.close();
- }
-
+ RomMetadataHandler.getMetadata(input, romIndex);
} catch (Exception e) {
e.printStackTrace();
- }*/
+ }
}
View
13 src/com/romraider/metadata/ScalingMetadata.java
@@ -0,0 +1,13 @@
+package com.romraider.metadata;
+
+public class ScalingMetadata {
+ private String name;
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+}
View
14 src/com/romraider/metadata/ScalingMetadataList.java
@@ -0,0 +1,14 @@
+package com.romraider.metadata;
+
+import java.util.ArrayList;
+import com.romraider.metadata.exception.ScalingNotFoundException;
+
+public class ScalingMetadataList<ScalingMetadata> extends ArrayList<ScalingMetadata> {
+
+ public ScalingMetadata get(String name) {
+ for (ScalingMetadata s : this) {
+ if (s.getName().equalsIgnoreCase(name)) return s;
+ }
+ throw new ScalingNotFoundException();
+ }
+}
View
2  src/com/romraider/metadata/Table1DMetadata.java
@@ -2,4 +2,4 @@
public class Table1DMetadata extends AbstractTableMetadata {
-}
+}
View
15 src/com/romraider/metadata/TableMetadataList.java
@@ -0,0 +1,15 @@
+package com.romraider.metadata;
+
+import java.util.ArrayList;
+
+import com.romraider.metadata.exception.TableNotFoundException;
+
+public class TableMetadataList<TableMetadata> extends ArrayList<AbstractTableMetadata> {
+
+ public AbstractTableMetadata get(String name) throws TableNotFoundException {
+ for (AbstractTableMetadata t : this) {
+ if (t.getName().equalsIgnoreCase(name)) return t;
+ }
+ throw new TableNotFoundException();
+ }
+}
View
2  src/com/romraider/metadata/RomNotFoundException.java → ...ider/metadata/exception/RomNotFoundException.java
@@ -1,4 +1,4 @@
-package com.romraider.metadata;
+package com.romraider.metadata.exception;
public class RomNotFoundException extends Exception {
View
29 src/com/romraider/metadata/exception/ScalingNotFoundException.java
@@ -0,0 +1,29 @@
+/*
+ * RomRaider Open-Source Tuning, Logging and Reflashing
+ * Copyright (C) 2006-2010 RomRaider.com
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+package com.romraider.metadata.exception;
+
+public final class ScalingNotFoundException extends Exception {
+
+ private static final long serialVersionUID = -7492075561444288417L;
+
+ public String getMessage() {
+ return "Scaling not found.";
+ }
+}
View
2  src/com/romraider/xml/TableNotFoundException.java → ...er/metadata/exception/TableNotFoundException.java
@@ -17,7 +17,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-package com.romraider.xml;
+package com.romraider.metadata.exception;
public final class TableNotFoundException extends Exception {
View
9 src/com/romraider/xml/DOMRomMetadataUnmarshaller.java
@@ -12,11 +12,18 @@
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import com.romraider.metadata.RomIndexID;
+import com.romraider.metadata.RomMetadata;
import com.sun.org.apache.xerces.internal.parsers.DOMParser;
public class DOMRomMetadataUnmarshaller {
+
+ private RomMetadata r;
+
+ public DOMRomMetadataUnmarshaller() {
+ r = new RomMetadata();
+ }
- public static Vector<RomIndexID> unmarshallRomIDIndex(File file) throws SAXException, IOException {
+ public Vector<RomIndexID> unmarshallRomIDIndex(File file) throws SAXException, IOException {
Vector<RomIndexID> romVector = new Vector<RomIndexID>();
InputSource src = new InputSource(new FileInputStream(file));
View
1  src/com/romraider/xml/DOMRomUnmarshaller.java
@@ -32,6 +32,7 @@
import com.romraider.maps.Table2D;
import com.romraider.maps.Table3D;
import com.romraider.maps.TableSwitch;
+import com.romraider.metadata.exception.TableNotFoundException;
import com.romraider.swing.DebugPanel;
import com.romraider.swing.JProgressPane;
import com.romraider.util.LogManager;
View
37 xmlmerge.properties
@@ -0,0 +1,37 @@
+action.default=MERGE
+
+xpath.path1=/rom/romid/xmlid
+action.path1=REPLACE
+
+xpath.path2=/rom/romid/internalidaddress
+action.path2=REPLACE
+
+xpath.path3=/rom/romid/inernalidstring
+action.path3=REPLACE
+
+xpath.path4=/rom/romid/ecuid
+action.path4=REPLACE
+
+xpath.path5=/rom/romid/year
+action.path5=REPLACE
+
+xpath.path6=/rom/romid/market
+action.path6=REPLACE
+
+xpath.make=/rom/romid/make
+action.make=REPLACE
+
+xpath.path8=/rom/romid/model
+action.path8=REPLACE
+
+xpath.path8=/rom/romid/submodel
+action.path8=REPLACE
+
+xpath.path9=/rom/romid/transmission
+action.path1=REPLACE
+
+xpath.path9=/rom/romid/memmodel
+action.path1=REPLACE
+
+xpath.path10=/rom/romid/flashmethod
+action.path10=REPLACE
Please sign in to comment.
Something went wrong with that request. Please try again.