mirror of https://github.com/rusefi/RomRaider.git
More misc warning fixes/cleanups.
git-svn-id: http://svn.3splooges.com/romraider-arch/trunk@46 d2e2e1cd-ba16-0410-be16-b7c4453c7c2d
This commit is contained in:
parent
d2c3c40aa3
commit
eba0fcacbf
|
@ -1,17 +1,16 @@
|
||||||
package enginuity.maps;
|
package enginuity.maps;
|
||||||
|
|
||||||
import com.sun.corba.se.spi.activation._ActivatorImplBase;
|
|
||||||
import enginuity.maps.Scale;
|
|
||||||
import enginuity.maps.Table;
|
|
||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
import java.awt.Font;
|
import java.awt.Font;
|
||||||
import java.awt.event.MouseEvent;
|
import java.awt.event.MouseEvent;
|
||||||
import java.awt.event.MouseListener;
|
import java.awt.event.MouseListener;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.text.DecimalFormat;
|
import java.text.DecimalFormat;
|
||||||
|
|
||||||
import javax.swing.JLabel;
|
import javax.swing.JLabel;
|
||||||
import javax.swing.border.LineBorder;
|
import javax.swing.border.LineBorder;
|
||||||
import org.nfunk.jep.*;
|
|
||||||
|
import org.nfunk.jep.JEP;
|
||||||
|
|
||||||
public class DataCell extends JLabel implements MouseListener, Serializable {
|
public class DataCell extends JLabel implements MouseListener, Serializable {
|
||||||
|
|
||||||
|
|
|
@ -8,13 +8,13 @@ import javax.swing.filechooser.FileFilter;
|
||||||
|
|
||||||
public class XMLFilter extends FileFilter {
|
public class XMLFilter extends FileFilter {
|
||||||
|
|
||||||
private Hashtable filters = null;
|
private Hashtable<String, FileFilter> filters = null;
|
||||||
private String description = null;
|
private String description = null;
|
||||||
private String fullDescription = null;
|
private String fullDescription = null;
|
||||||
private boolean useExtensionsInDescription = true;
|
private boolean useExtensionsInDescription = true;
|
||||||
|
|
||||||
public XMLFilter() {
|
public XMLFilter() {
|
||||||
this.filters = new Hashtable();
|
this.filters = new Hashtable<String, FileFilter>();
|
||||||
this.addExtension("xml");
|
this.addExtension("xml");
|
||||||
this.setDescription("ECU Definition Files");
|
this.setDescription("ECU Definition Files");
|
||||||
}
|
}
|
||||||
|
@ -46,9 +46,6 @@ public class XMLFilter extends FileFilter {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addExtension(String extension) {
|
public void addExtension(String extension) {
|
||||||
if (filters == null) {
|
|
||||||
filters = new Hashtable(5);
|
|
||||||
}
|
|
||||||
filters.put(extension.toLowerCase(), this);
|
filters.put(extension.toLowerCase(), this);
|
||||||
fullDescription = null;
|
fullDescription = null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -163,7 +163,8 @@ public class DOMRomUnmarshaller {
|
||||||
return romID;
|
return romID;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Table copyTable(Table input) {
|
// Will this function be used? It is not used now and could be removed...
|
||||||
|
private Table copyTable(Table input) {
|
||||||
Table output = input;
|
Table output = input;
|
||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,17 +1,15 @@
|
||||||
package enginuity.xml;
|
package enginuity.xml;
|
||||||
|
|
||||||
import com.sun.org.apache.xerces.internal.parsers.DOMParser;
|
|
||||||
import enginuity.Settings;
|
|
||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
import java.awt.Dimension;
|
import java.awt.Dimension;
|
||||||
import java.awt.Font;
|
import java.awt.Font;
|
||||||
import java.awt.Point;
|
import java.awt.Point;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileInputStream;
|
|
||||||
import org.w3c.dom.Document;
|
|
||||||
import org.w3c.dom.Node;
|
import org.w3c.dom.Node;
|
||||||
import org.w3c.dom.NodeList;
|
import org.w3c.dom.NodeList;
|
||||||
import org.xml.sax.InputSource;
|
|
||||||
|
import enginuity.Settings;
|
||||||
|
|
||||||
public class DOMSettingsUnmarshaller {
|
public class DOMSettingsUnmarshaller {
|
||||||
|
|
||||||
|
@ -51,10 +49,6 @@ public class DOMSettingsUnmarshaller {
|
||||||
unmarshallAttribute(n, "x", 800)));
|
unmarshallAttribute(n, "x", 800)));
|
||||||
|
|
||||||
} else if (n.getNodeType() == Node.ELEMENT_NODE && n.getNodeName().equalsIgnoreCase("location")) {
|
} else if (n.getNodeType() == Node.ELEMENT_NODE && n.getNodeName().equalsIgnoreCase("location")) {
|
||||||
// set default location in center of screen
|
|
||||||
Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
|
|
||||||
Point location = new Point(((int)(screenSize.getWidth() - settings.getWindowSize().getWidth()) / 2),
|
|
||||||
((int)(screenSize.getHeight() - settings.getWindowSize().getHeight()) / 2));
|
|
||||||
settings.setWindowLocation(new Point(unmarshallAttribute(n, "x", 0),
|
settings.setWindowLocation(new Point(unmarshallAttribute(n, "x", 0),
|
||||||
unmarshallAttribute(n, "y", 0)));
|
unmarshallAttribute(n, "y", 0)));
|
||||||
|
|
||||||
|
@ -176,29 +170,32 @@ public class DOMSettingsUnmarshaller {
|
||||||
unmarshallAttribute(colorNode, "b", 155));
|
unmarshallAttribute(colorNode, "b", 155));
|
||||||
}
|
}
|
||||||
|
|
||||||
private String unmarshallText(Node textNode) {
|
// Will this function be used? It is not used now and could be removed...
|
||||||
StringBuffer buf = new StringBuffer();
|
private String unmarshallText(Node textNode) {
|
||||||
|
StringBuffer buf = new StringBuffer();
|
||||||
|
Node n;
|
||||||
|
NodeList nodes = textNode.getChildNodes();
|
||||||
|
|
||||||
Node n;
|
for (int i = 0; i < nodes.getLength(); i++) {
|
||||||
NodeList nodes = textNode.getChildNodes();
|
n = nodes.item(i);
|
||||||
|
|
||||||
for (int i = 0; i < nodes.getLength(); i++){
|
if (n.getNodeType() == Node.TEXT_NODE) {
|
||||||
n = nodes.item(i);
|
buf.append(n.getNodeValue());
|
||||||
|
}
|
||||||
if (n.getNodeType() == Node.TEXT_NODE) {
|
else {
|
||||||
buf.append(n.getNodeValue());
|
// expected a text-only node (skip)
|
||||||
} else {
|
}
|
||||||
// expected a text-only node (skip)
|
}
|
||||||
}
|
return buf.toString();
|
||||||
}
|
}
|
||||||
return buf.toString();
|
|
||||||
}
|
private String unmarshallAttribute(Node node, String name,
|
||||||
|
String defaultValue) {
|
||||||
private String unmarshallAttribute(Node node, String name, String defaultValue) {
|
Node n = node.getAttributes().getNamedItem(name);
|
||||||
Node n = node.getAttributes().getNamedItem(name);
|
return (n != null) ? (n.getNodeValue()) : (defaultValue);
|
||||||
return (n!=null)?(n.getNodeValue()):(defaultValue);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
// Will this function be used? It is not used now and could be removed...
|
||||||
private Double unmarshallAttribute(Node node, String name, double defaultValue) {
|
private Double unmarshallAttribute(Node node, String name, double defaultValue) {
|
||||||
return Double.parseDouble(unmarshallAttribute(node, name, defaultValue+""));
|
return Double.parseDouble(unmarshallAttribute(node, name, defaultValue+""));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue