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:
drees 2006-06-28 08:31:40 +00:00
parent d2c3c40aa3
commit eba0fcacbf
4 changed files with 32 additions and 38 deletions

View File

@ -1,17 +1,16 @@
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.Font;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.io.Serializable;
import java.text.DecimalFormat;
import javax.swing.JLabel;
import javax.swing.border.LineBorder;
import org.nfunk.jep.*;
import org.nfunk.jep.JEP;
public class DataCell extends JLabel implements MouseListener, Serializable {

View File

@ -8,13 +8,13 @@ import javax.swing.filechooser.FileFilter;
public class XMLFilter extends FileFilter {
private Hashtable filters = null;
private Hashtable<String, FileFilter> filters = null;
private String description = null;
private String fullDescription = null;
private boolean useExtensionsInDescription = true;
public XMLFilter() {
this.filters = new Hashtable();
this.filters = new Hashtable<String, FileFilter>();
this.addExtension("xml");
this.setDescription("ECU Definition Files");
}
@ -46,9 +46,6 @@ public class XMLFilter extends FileFilter {
}
public void addExtension(String extension) {
if (filters == null) {
filters = new Hashtable(5);
}
filters.put(extension.toLowerCase(), this);
fullDescription = null;
}

View File

@ -163,7 +163,8 @@ public class DOMRomUnmarshaller {
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;
return output;
}

View File

@ -1,17 +1,15 @@
package enginuity.xml;
import com.sun.org.apache.xerces.internal.parsers.DOMParser;
import enginuity.Settings;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.Point;
import java.io.File;
import java.io.FileInputStream;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.InputSource;
import enginuity.Settings;
public class DOMSettingsUnmarshaller {
@ -51,10 +49,6 @@ public class DOMSettingsUnmarshaller {
unmarshallAttribute(n, "x", 800)));
} 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),
unmarshallAttribute(n, "y", 0)));
@ -176,29 +170,32 @@ public class DOMSettingsUnmarshaller {
unmarshallAttribute(colorNode, "b", 155));
}
private String unmarshallText(Node textNode) {
StringBuffer buf = new StringBuffer();
// Will this function be used? It is not used now and could be removed...
private String unmarshallText(Node textNode) {
StringBuffer buf = new StringBuffer();
Node n;
NodeList nodes = textNode.getChildNodes();
Node n;
NodeList nodes = textNode.getChildNodes();
for (int i = 0; i < nodes.getLength(); i++) {
n = nodes.item(i);
for (int i = 0; i < nodes.getLength(); i++){
n = nodes.item(i);
if (n.getNodeType() == Node.TEXT_NODE) {
buf.append(n.getNodeValue());
} else {
// expected a text-only node (skip)
}
if (n.getNodeType() == Node.TEXT_NODE) {
buf.append(n.getNodeValue());
}
else {
// expected a text-only node (skip)
}
}
return buf.toString();
}
return buf.toString();
}
private String unmarshallAttribute(Node node, String name, String defaultValue) {
Node n = node.getAttributes().getNamedItem(name);
return (n!=null)?(n.getNodeValue()):(defaultValue);
}
private String unmarshallAttribute(Node node, String name,
String defaultValue) {
Node n = node.getAttributes().getNamedItem(name);
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) {
return Double.parseDouble(unmarshallAttribute(node, name, defaultValue+""));
}