mirror of https://github.com/rusefi/RomRaider.git
More cleanup
This commit is contained in:
parent
0ae900774a
commit
992e51ea3e
|
@ -63,7 +63,7 @@ public class Rom extends DefaultMutableTreeNode implements Serializable {
|
||||||
private static final Logger LOGGER = Logger.getLogger(Rom.class);
|
private static final Logger LOGGER = Logger.getLogger(Rom.class);
|
||||||
private static final ResourceBundle rb = new ResourceUtil().getBundle(
|
private static final ResourceBundle rb = new ResourceUtil().getBundle(
|
||||||
Rom.class.getName());
|
Rom.class.getName());
|
||||||
private RomID romID = new RomID();
|
private RomID romID;
|
||||||
private String fileName = "";
|
private String fileName = "";
|
||||||
private File fullFileName = new File(".");
|
private File fullFileName = new File(".");
|
||||||
private byte[] binData;
|
private byte[] binData;
|
||||||
|
@ -72,7 +72,8 @@ public class Rom extends DefaultMutableTreeNode implements Serializable {
|
||||||
private final Vector<TableTreeNode> tableNodes = new Vector<TableTreeNode>();
|
private final Vector<TableTreeNode> tableNodes = new Vector<TableTreeNode>();
|
||||||
private LinkedList<ChecksumManager> checksumManagers = new LinkedList<ChecksumManager>();
|
private LinkedList<ChecksumManager> checksumManagers = new LinkedList<ChecksumManager>();
|
||||||
|
|
||||||
public Rom() {
|
public Rom(RomID romID) {
|
||||||
|
this.romID = romID;
|
||||||
tableNodes.clear();
|
tableNodes.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -201,8 +202,6 @@ public class Rom extends DefaultMutableTreeNode implements Serializable {
|
||||||
|
|
||||||
Table table = tableNodes.get(i).getTable();
|
Table table = tableNodes.get(i).getTable();
|
||||||
try {
|
try {
|
||||||
// if storageaddress has not been set (or is set to 0) omit table
|
|
||||||
//Why can the address not be zero? - Changed
|
|
||||||
if (table.getStorageAddress() >= 0) {
|
if (table.getStorageAddress() >= 0) {
|
||||||
try {
|
try {
|
||||||
table.populateTable(binData, this.getRomID().getRamOffset());
|
table.populateTable(binData, this.getRomID().getRamOffset());
|
||||||
|
|
|
@ -33,7 +33,7 @@ public class RomPropertyPanel extends javax.swing.JPanel {
|
||||||
private static final long serialVersionUID = 5583360728106071942L;
|
private static final long serialVersionUID = 5583360728106071942L;
|
||||||
private static final ResourceBundle rb = new ResourceUtil().getBundle(
|
private static final ResourceBundle rb = new ResourceUtil().getBundle(
|
||||||
RomPropertyPanel.class.getName());
|
RomPropertyPanel.class.getName());
|
||||||
Rom rom = new Rom();
|
Rom rom;
|
||||||
|
|
||||||
public RomPropertyPanel(Rom rom) {
|
public RomPropertyPanel(Rom rom) {
|
||||||
initComponents();
|
initComponents();
|
||||||
|
|
|
@ -17,8 +17,6 @@
|
||||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//DOM XML parser for ROMs
|
|
||||||
|
|
||||||
package com.romraider.xml;
|
package com.romraider.xml;
|
||||||
|
|
||||||
import static com.romraider.xml.DOMHelper.unmarshallAttribute;
|
import static com.romraider.xml.DOMHelper.unmarshallAttribute;
|
||||||
|
@ -46,18 +44,44 @@ public final class DOMRomUnmarshaller {
|
||||||
.getLogger(DOMRomUnmarshaller.class);
|
.getLogger(DOMRomUnmarshaller.class);
|
||||||
private JProgressPane progress = null;
|
private JProgressPane progress = null;
|
||||||
private ChecksumManager checksumManager = null;
|
private ChecksumManager checksumManager = null;
|
||||||
private TableScaleAttributeHandler tableScaleHandler = new TableScaleAttributeHandler();
|
private TableScaleUnmarshaller tableScaleHandler = new TableScaleUnmarshaller();
|
||||||
|
|
||||||
public Rom unmarshallXMLDefinition(Node rootNode, byte[] input,
|
public Rom unmarshallXMLDefinition(Node rootNode, byte[] input,
|
||||||
JProgressPane progress) throws RomNotFoundException,
|
JProgressPane progress) throws RomNotFoundException,
|
||||||
XMLParseException, StackOverflowError, Exception {
|
XMLParseException, StackOverflowError, Exception {
|
||||||
|
|
||||||
this.progress = progress;
|
this.progress = progress;
|
||||||
|
|
||||||
|
// Unmarshall scales first
|
||||||
|
tableScaleHandler.unmarshallBaseScales(rootNode);
|
||||||
|
|
||||||
|
RomID romId = new RomID();
|
||||||
|
Node n = findRomNodeMatch(rootNode, null, input, romId);
|
||||||
|
|
||||||
|
if(n != null) {
|
||||||
|
Rom rom = new Rom(romId);
|
||||||
|
Rom output = unmarshallRom(n, rom);
|
||||||
|
|
||||||
|
// set ram offset
|
||||||
|
output.getRomID().setRamOffset(
|
||||||
|
output.getRomID().getFileSize()
|
||||||
|
- input.length);
|
||||||
|
|
||||||
|
return output;
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new RomNotFoundException();
|
||||||
|
}
|
||||||
|
|
||||||
|
//Find the correct Rom Node either by xmlID or by input bytes
|
||||||
|
//Supplying both will return null
|
||||||
|
private Node findRomNodeMatch(Node rootNode, String xmlID, byte[] input, RomID romId) {
|
||||||
|
if(xmlID == null && input == null) return null;
|
||||||
|
if(xmlID != null && input != null) return null;
|
||||||
|
|
||||||
Node n;
|
Node n;
|
||||||
NodeList nodes = rootNode.getChildNodes();
|
NodeList nodes = rootNode.getChildNodes();
|
||||||
tableScaleHandler.unmarshallBaseScales(nodes);
|
|
||||||
|
|
||||||
// now unmarshall roms
|
|
||||||
for (int i = 0; i < nodes.getLength(); i++) {
|
for (int i = 0; i < nodes.getLength(); i++) {
|
||||||
n = nodes.item(i);
|
n = nodes.item(i);
|
||||||
|
|
||||||
|
@ -68,30 +92,29 @@ public final class DOMRomUnmarshaller {
|
||||||
|
|
||||||
for (int z = 0; z < nodes2.getLength(); z++) {
|
for (int z = 0; z < nodes2.getLength(); z++) {
|
||||||
n2 = nodes2.item(z);
|
n2 = nodes2.item(z);
|
||||||
|
|
||||||
if (n2.getNodeType() == ELEMENT_NODE
|
if (n2.getNodeType() == ELEMENT_NODE
|
||||||
&& n2.getNodeName().equalsIgnoreCase("romid")) {
|
&& n2.getNodeName().equalsIgnoreCase("romid")) {
|
||||||
|
|
||||||
RomID romID = unmarshallRomID(n2, new RomID());
|
romId = unmarshallRomID(n2, romId);
|
||||||
|
|
||||||
//Check if bytes match in file
|
//Check if bytes match in file
|
||||||
if (romID.checkMatch(input)) {
|
if(input != null && romId.checkMatch(input)) {
|
||||||
Rom output = unmarshallRom(n, new Rom());
|
return n;
|
||||||
|
}
|
||||||
// set ram offset
|
|
||||||
output.getRomID().setRamOffset(
|
//Check if the ID matches
|
||||||
output.getRomID().getFileSize()
|
else if(xmlID != null && romId.getXmlid().equalsIgnoreCase(xmlID)) {
|
||||||
- input.length);
|
return n;
|
||||||
|
|
||||||
return output;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//ROM only has one ID Node, so we can skip the rest after we found it
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
throw new RomNotFoundException();
|
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Rom unmarshallRom(Node rootNode, Rom rom) throws XMLParseException,
|
public Rom unmarshallRom(Node rootNode, Rom rom) throws XMLParseException,
|
||||||
|
@ -123,33 +146,25 @@ public final class DOMRomUnmarshaller {
|
||||||
} else if (n.getNodeName().equalsIgnoreCase("table")) {
|
} else if (n.getNodeName().equalsIgnoreCase("table")) {
|
||||||
Table table = null;
|
Table table = null;
|
||||||
try {
|
try {
|
||||||
table = rom.getTableByName(unmarshallAttribute(n, "name",
|
table = rom.getTableByName(unmarshallAttribute(n, "name", null));
|
||||||
null));
|
|
||||||
} catch (TableNotFoundException e) {
|
} catch (TableNotFoundException e) {
|
||||||
/*
|
//Table does not already exist (do nothing)
|
||||||
* table does not
|
|
||||||
* already exist (do
|
|
||||||
* nothing)
|
|
||||||
*/
|
|
||||||
} catch (InvalidTableNameException iex) {
|
} catch (InvalidTableNameException iex) {
|
||||||
// Table name is null or empty. Do nothing.
|
// Table name is null or empty. Do nothing.
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
table = tableScaleHandler.unmarshallTable(n, table, rom);
|
table = tableScaleHandler.unmarshallTable(n, table, rom);
|
||||||
//rom.addTableByName(table);
|
|
||||||
if (table != null) {
|
if (table != null) {
|
||||||
//rom.removeTableByName(table);
|
|
||||||
rom.addTable(table);
|
rom.addTable(table);
|
||||||
}
|
}
|
||||||
} catch (TableIsOmittedException ex) {
|
} catch (TableIsOmittedException ex) {
|
||||||
// table is not supported in inherited def (skip)
|
// table is not supported in inherited def (skip)
|
||||||
if (table != null) {
|
if (table != null) {
|
||||||
//rom.removeTableByName(table);
|
|
||||||
rom.removeTable(table);
|
rom.removeTable(table);
|
||||||
}
|
}
|
||||||
} catch (XMLParseException ex) {
|
} catch (XMLParseException ex) {
|
||||||
LOGGER.error("Error unmarshalling rom", ex);
|
LOGGER.error(ex.getMessage());
|
||||||
}
|
}
|
||||||
} else if (n.getNodeName().equalsIgnoreCase("checksum")) {
|
} else if (n.getNodeName().equalsIgnoreCase("checksum")) {
|
||||||
rom.getRomID().setChecksum(unmarshallAttribute(n, "type", ""));
|
rom.getRomID().setChecksum(unmarshallAttribute(n, "type", ""));
|
||||||
|
@ -167,32 +182,15 @@ public final class DOMRomUnmarshaller {
|
||||||
public Rom getBaseRom(Node rootNode, String xmlID, Rom rom)
|
public Rom getBaseRom(Node rootNode, String xmlID, Rom rom)
|
||||||
throws XMLParseException, RomNotFoundException, StackOverflowError,
|
throws XMLParseException, RomNotFoundException, StackOverflowError,
|
||||||
Exception {
|
Exception {
|
||||||
Node n;
|
|
||||||
NodeList nodes = rootNode.getChildNodes();
|
|
||||||
|
|
||||||
for (int i = 0; i < nodes.getLength(); i++) {
|
Node n = findRomNodeMatch(rootNode, xmlID, null, new RomID());
|
||||||
n = nodes.item(i);
|
|
||||||
|
|
||||||
if (n.getNodeType() == ELEMENT_NODE
|
if(n != null) {
|
||||||
&& n.getNodeName().equalsIgnoreCase("rom")) {
|
|
||||||
Node n2;
|
|
||||||
NodeList nodes2 = n.getChildNodes();
|
|
||||||
|
|
||||||
for (int z = 0; z < nodes2.getLength(); z++) {
|
|
||||||
n2 = nodes2.item(z);
|
|
||||||
if (n2.getNodeType() == ELEMENT_NODE
|
|
||||||
&& n2.getNodeName().equalsIgnoreCase("romid")) {
|
|
||||||
|
|
||||||
RomID romID = unmarshallRomID(n2, new RomID());
|
|
||||||
if (romID.getXmlid().equalsIgnoreCase(xmlID)) {
|
|
||||||
Rom returnrom = unmarshallRom(n, rom);
|
Rom returnrom = unmarshallRom(n, rom);
|
||||||
returnrom.getRomID().setObsolete(false);
|
returnrom.getRomID().setObsolete(false);
|
||||||
return returnrom;
|
return returnrom;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
throw new RomNotFoundException();
|
throw new RomNotFoundException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -204,56 +202,58 @@ public final class DOMRomUnmarshaller {
|
||||||
n = nodes.item(i);
|
n = nodes.item(i);
|
||||||
|
|
||||||
if (n.getNodeType() == ELEMENT_NODE) {
|
if (n.getNodeType() == ELEMENT_NODE) {
|
||||||
|
String nodeName = n.getNodeName();
|
||||||
|
|
||||||
if (n.getNodeName().equalsIgnoreCase("xmlid")) {
|
if (nodeName.equalsIgnoreCase("xmlid")) {
|
||||||
romID.setXmlid(unmarshallText(n));
|
romID.setXmlid(unmarshallText(n));
|
||||||
|
|
||||||
} else if (n.getNodeName()
|
} else if (nodeName.equalsIgnoreCase("internalidaddress")) {
|
||||||
.equalsIgnoreCase("internalidaddress")) {
|
|
||||||
romID.setInternalIdAddress(RomAttributeParser
|
romID.setInternalIdAddress(RomAttributeParser
|
||||||
.parseHexString(unmarshallText(n)));
|
.parseHexString(unmarshallText(n)));
|
||||||
|
|
||||||
} else if (n.getNodeName().equalsIgnoreCase("internalidstring")) {
|
} else if (nodeName.equalsIgnoreCase("internalidstring")) {
|
||||||
romID.setInternalIdString(unmarshallText(n));
|
romID.setInternalIdString(unmarshallText(n));
|
||||||
|
|
||||||
if (romID.getInternalIdString() == null) {
|
if (romID.getInternalIdString() == null) {
|
||||||
romID.setInternalIdString("");
|
romID.setInternalIdString("");
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (n.getNodeName().equalsIgnoreCase("caseid")) {
|
} else if (nodeName.equalsIgnoreCase("caseid")) {
|
||||||
romID.setCaseId(unmarshallText(n));
|
romID.setCaseId(unmarshallText(n));
|
||||||
|
|
||||||
} else if (n.getNodeName().equalsIgnoreCase("ecuid")) {
|
} else if (nodeName.equalsIgnoreCase("ecuid")) {
|
||||||
romID.setEcuId(unmarshallText(n));
|
romID.setEcuId(unmarshallText(n));
|
||||||
|
|
||||||
} else if (n.getNodeName().equalsIgnoreCase("make")) {
|
} else if (nodeName.equalsIgnoreCase("make")) {
|
||||||
romID.setMake(unmarshallText(n));
|
romID.setMake(unmarshallText(n));
|
||||||
|
|
||||||
} else if (n.getNodeName().equalsIgnoreCase("market")) {
|
} else if (nodeName.equalsIgnoreCase("market")) {
|
||||||
romID.setMarket(unmarshallText(n));
|
romID.setMarket(unmarshallText(n));
|
||||||
|
|
||||||
} else if (n.getNodeName().equalsIgnoreCase("model")) {
|
} else if (nodeName.equalsIgnoreCase("model")) {
|
||||||
romID.setModel(unmarshallText(n));
|
romID.setModel(unmarshallText(n));
|
||||||
|
|
||||||
} else if (n.getNodeName().equalsIgnoreCase("submodel")) {
|
} else if (nodeName.equalsIgnoreCase("submodel")) {
|
||||||
romID.setSubModel(unmarshallText(n));
|
romID.setSubModel(unmarshallText(n));
|
||||||
|
|
||||||
} else if (n.getNodeName().equalsIgnoreCase("transmission")) {
|
} else if (nodeName.equalsIgnoreCase("transmission")) {
|
||||||
romID.setTransmission(unmarshallText(n));
|
romID.setTransmission(unmarshallText(n));
|
||||||
|
|
||||||
} else if (n.getNodeName().equalsIgnoreCase("year")) {
|
} else if (nodeName.equalsIgnoreCase("year")) {
|
||||||
romID.setYear(unmarshallText(n));
|
romID.setYear(unmarshallText(n));
|
||||||
|
|
||||||
} else if (n.getNodeName().equalsIgnoreCase("flashmethod")) {
|
} else if (nodeName.equalsIgnoreCase("flashmethod")) {
|
||||||
romID.setFlashMethod(unmarshallText(n));
|
romID.setFlashMethod(unmarshallText(n));
|
||||||
|
|
||||||
} else if (n.getNodeName().equalsIgnoreCase("memmodel")) {
|
} else if (nodeName.equalsIgnoreCase("memmodel")) {
|
||||||
romID.setMemModel(unmarshallText(n));
|
romID.setMemModel(unmarshallText(n));
|
||||||
tableScaleHandler.setMemModelEndian(unmarshallAttribute(n, "endian", null));
|
tableScaleHandler.setMemModelEndian(unmarshallAttribute(n, "endian", null));
|
||||||
} else if (n.getNodeName().equalsIgnoreCase("filesize")) {
|
|
||||||
|
} else if (nodeName.equalsIgnoreCase("filesize")) {
|
||||||
romID.setFileSize(RomAttributeParser
|
romID.setFileSize(RomAttributeParser
|
||||||
.parseFileSize(unmarshallText(n)));
|
.parseFileSize(unmarshallText(n)));
|
||||||
|
|
||||||
} else if (n.getNodeName().equalsIgnoreCase("obsolete")) {
|
} else if (nodeName.equalsIgnoreCase("obsolete")) {
|
||||||
romID.setObsolete(Boolean.parseBoolean(unmarshallText(n)));
|
romID.setObsolete(Boolean.parseBoolean(unmarshallText(n)));
|
||||||
|
|
||||||
} else { /* unexpected element in RomID (skip) */
|
} else { /* unexpected element in RomID (skip) */
|
||||||
|
|
|
@ -51,22 +51,21 @@ import com.romraider.swing.DebugPanel;
|
||||||
import com.romraider.util.ObjectCloner;
|
import com.romraider.util.ObjectCloner;
|
||||||
import com.romraider.util.SettingsManager;
|
import com.romraider.util.SettingsManager;
|
||||||
|
|
||||||
public class TableScaleAttributeHandler {
|
public class TableScaleUnmarshaller {
|
||||||
private static final Logger LOGGER = Logger.getLogger(TableScaleAttributeHandler.class);
|
private static final Logger LOGGER = Logger.getLogger(TableScaleUnmarshaller.class);
|
||||||
private final Map<String, Integer> tableNames = new HashMap<String, Integer>();
|
private final Map<String, Integer> tableNames = new HashMap<String, Integer>();
|
||||||
private final List<Scale> scales = new ArrayList<Scale>();
|
private final List<Scale> scales = new ArrayList<Scale>();
|
||||||
private String memModelEndian = null;
|
private String memModelEndian = null;
|
||||||
private final Scale rawScale = new Scale();
|
private final Scale rawScale = new Scale();
|
||||||
|
|
||||||
|
|
||||||
public void setMemModelEndian(String endian) {
|
public void setMemModelEndian(String endian) {
|
||||||
|
memModelEndian = endian;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void unmarshallBaseScales(NodeList nodes) {
|
public void unmarshallBaseScales(Node rootNode) {
|
||||||
|
NodeList nodes = rootNode.getChildNodes();
|
||||||
Node n;
|
Node n;
|
||||||
|
|
||||||
// unmarshall scales first
|
|
||||||
for (int i = 0; i < nodes.getLength(); i++) {
|
for (int i = 0; i < nodes.getLength(); i++) {
|
||||||
n = nodes.item(i);
|
n = nodes.item(i);
|
||||||
|
|
||||||
|
@ -88,6 +87,7 @@ public class TableScaleAttributeHandler {
|
||||||
if (!unmarshallAttribute(tableNode, "base", "none").equalsIgnoreCase(
|
if (!unmarshallAttribute(tableNode, "base", "none").equalsIgnoreCase(
|
||||||
"none")) { // copy base table for inheritance
|
"none")) { // copy base table for inheritance
|
||||||
try {
|
try {
|
||||||
|
//Why is this needed?
|
||||||
table = (Table) ObjectCloner
|
table = (Table) ObjectCloner
|
||||||
.deepCopy(rom.getTableByName(unmarshallAttribute(tableNode,
|
.deepCopy(rom.getTableByName(unmarshallAttribute(tableNode,
|
||||||
"base", "none")));
|
"base", "none")));
|
||||||
|
@ -100,7 +100,6 @@ public class TableScaleAttributeHandler {
|
||||||
JOptionPane.showMessageDialog(ECUEditorManager.getECUEditor(),
|
JOptionPane.showMessageDialog(ECUEditorManager.getECUEditor(),
|
||||||
new DebugPanel(ex, SettingsManager.getSettings().getSupportURL()), "Exception",
|
new DebugPanel(ex, SettingsManager.getSettings().getSupportURL()), "Exception",
|
||||||
JOptionPane.ERROR_MESSAGE);
|
JOptionPane.ERROR_MESSAGE);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -108,46 +107,42 @@ public class TableScaleAttributeHandler {
|
||||||
// create new instance (otherwise it
|
// create new instance (otherwise it
|
||||||
// is inherited)
|
// is inherited)
|
||||||
final String tn = unmarshallAttribute(tableNode, "name", "unknown");
|
final String tn = unmarshallAttribute(tableNode, "name", "unknown");
|
||||||
final String type = unmarshallAttribute(tableNode, "type", "unknown");
|
final String type = unmarshallAttribute(tableNode, "type", "none");
|
||||||
|
|
||||||
if (tableNames.containsKey(tn) || type.contains("xis")) {
|
if (tableNames.containsKey(tn) || type.contains("xis")) {
|
||||||
if (unmarshallAttribute(tableNode, "type", "unknown")
|
if (type.equalsIgnoreCase("3D")) {
|
||||||
.equalsIgnoreCase("3D")) {
|
|
||||||
table = new Table3D();
|
table = new Table3D();
|
||||||
table.getScales().add(rawScale);
|
table.getScales().add(rawScale);
|
||||||
((Table3D) table).getXAxis().getScales().add(rawScale);
|
((Table3D) table).getXAxis().getScales().add(rawScale);
|
||||||
((Table3D) table).getYAxis().getScales().add(rawScale);
|
((Table3D) table).getYAxis().getScales().add(rawScale);
|
||||||
|
|
||||||
} else if (unmarshallAttribute(tableNode, "type", "unknown")
|
} else if (type.equalsIgnoreCase("2D")) {
|
||||||
.equalsIgnoreCase("2D")) {
|
|
||||||
table = new Table2D();
|
table = new Table2D();
|
||||||
table.getScales().add(rawScale);
|
table.getScales().add(rawScale);
|
||||||
((Table2D) table).getAxis().getScales().add(rawScale);
|
((Table2D) table).getAxis().getScales().add(rawScale);
|
||||||
|
|
||||||
} else if (unmarshallAttribute(tableNode, "type", "unknown")
|
} else if (type.equalsIgnoreCase("1D")) {
|
||||||
.equalsIgnoreCase("1D")) {
|
|
||||||
table = new Table1D(Table.TableType.TABLE_1D);
|
table = new Table1D(Table.TableType.TABLE_1D);
|
||||||
|
|
||||||
} else if (unmarshallAttribute(tableNode, "type", "unknown")
|
} else if (type.equalsIgnoreCase("X Axis")
|
||||||
.equalsIgnoreCase("X Axis")
|
|| type.equalsIgnoreCase("Static X Axis")) {
|
||||||
|| unmarshallAttribute(tableNode, "type", "unknown")
|
|
||||||
.equalsIgnoreCase("Static X Axis")) {
|
|
||||||
table = new Table1D(Table.TableType.X_AXIS);
|
table = new Table1D(Table.TableType.X_AXIS);
|
||||||
|
|
||||||
} else if (unmarshallAttribute(tableNode, "type", "unknown")
|
} else if (type.equalsIgnoreCase("Y Axis")
|
||||||
.equalsIgnoreCase("Y Axis")
|
|| type.equalsIgnoreCase("Static Y Axis")) {
|
||||||
|| unmarshallAttribute(tableNode, "type", "unknown")
|
|
||||||
.equalsIgnoreCase("Static Y Axis")) {
|
|
||||||
table = new Table1D(Table.TableType.Y_AXIS);
|
table = new Table1D(Table.TableType.Y_AXIS);
|
||||||
} else if (unmarshallAttribute(tableNode, "type", "unknown")
|
} else if (type.equalsIgnoreCase("Switch")) {
|
||||||
.equalsIgnoreCase("Switch")) {
|
|
||||||
table = new TableSwitch();
|
table = new TableSwitch();
|
||||||
|
|
||||||
} else if (unmarshallAttribute(tableNode, "type", "unknown")
|
} else if (type.equalsIgnoreCase("BitwiseSwitch")) {
|
||||||
.equalsIgnoreCase("BitwiseSwitch")) {
|
|
||||||
table = new TableBitwiseSwitch();
|
table = new TableBitwiseSwitch();
|
||||||
}
|
}
|
||||||
|
else if(type.equalsIgnoreCase("none")){
|
||||||
|
throw new XMLParseException("Table type unspecified for "
|
||||||
|
+ tableNode.getAttributes().getNamedItem("name"));
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
throw new XMLParseException("Error loading table, "
|
throw new XMLParseException("Table type " + type + " unknown for "
|
||||||
+ tableNode.getAttributes().getNamedItem("name"));
|
+ tableNode.getAttributes().getNamedItem("name"));
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue