mirror of https://github.com/rusefi/RomRaider.git
Enginuity 0.2.7 Beta
git-svn-id: http://svn.3splooges.com/romraider-arch/trunk@24 d2e2e1cd-ba16-0410-be16-b7c4453c7c2d
This commit is contained in:
parent
0ae35300ed
commit
4b47fb54c8
File diff suppressed because it is too large
Load Diff
|
@ -4,24 +4,32 @@ Enginuity is currently in BETA TEST status, meaning it is not thoroughly tested
|
|||
|
||||
Until Enginuity reaches a mature point, releases will be quite frequent and will usually contain significant changes. However, some times I may release a revision to add a single feature I'd like users to have, or maybe just to add a certain ECU version. Until more features are complete, version support will be quite limited. If you'd like your ECU version to be added, please visit openecu.org and post a message in the Technical Tuning Software forum, with your image attached.
|
||||
|
||||
0.2.6b Release Notes
|
||||
--------------------
|
||||
This release should make Enginuity a lot more convenient to use. The main new features are keyboard navigation and map copying and pasting. Tables are now navigable using the following key commands:
|
||||
0.2.7b Release Notes (4/12/2006)
|
||||
--------------------------------
|
||||
The main goal of this release was fixing known issues and adding a settings panel. The settings panel now allows you to choose the way tables are displayed, which warnings will be displayed and specify system files. Settings are now stored in settings.xml -- the old method caused settings to be lost whenever a new feature was introduced with a release. A message will appear the first time you run the new version telling you Enginuity is creating a new settings file.
|
||||
|
||||
Arrow keys: move cursor
|
||||
+/-: Adjust values
|
||||
ctrl +/-: Adjust values (fine)
|
||||
ctrl up and down: Adjust values
|
||||
ctrl+c: copy selection
|
||||
ctrl+v: paste
|
||||
|
||||
In addition, typing numbers when a cell is selected will automatically set focus to the "Set Value" field, and pressing enter will commit the change.
|
||||
|
||||
Map copying is now supported. Pressing ctrl-c and ctrl-v will copy and paste a selection. To copy an entire table, select Edit->Copy Table on the table menu. Tables are copied to the clipboard in a tab-delimited string which can be pasted in Excel or other spreadsheet applications, or in a text editor.
|
||||
Bug fixes are listed in the changes below. A memory usage issue still exists in 0.2.7b which. Opening or refreshing several images will continue to result in increased memory usage, even after an image is closed. This bug will be looked in to and should be fixed for the next release.
|
||||
|
||||
|
||||
Changes:
|
||||
--------
|
||||
0.2.7b (4/12/2006)
|
||||
------------------
|
||||
- Replace serialized settings object with XML
|
||||
- Settings panel
|
||||
- Custom sizes/fonts/colors for tables
|
||||
- Fix blue 2D table axiis
|
||||
- Fix exception when clicking on table list
|
||||
- Expression/to_byte conflict warning
|
||||
- Rename packages to conventional lowercase
|
||||
- Improve refresh method when saving
|
||||
- Improve exception reporting
|
||||
- Implement "obsolete" tag -- set up wiki with ROM revision info
|
||||
- Group tables by category
|
||||
- Fix descriptions not working
|
||||
- Fix 2D table navigation
|
||||
|
||||
|
||||
0.2.6b (4/5/2006)
|
||||
-----------------
|
||||
- Shortcut keys
|
||||
|
|
|
@ -1,76 +0,0 @@
|
|||
package Enginuity;
|
||||
|
||||
import java.awt.Dimension;
|
||||
import java.io.File;
|
||||
import java.io.Serializable;
|
||||
|
||||
public class Settings implements Serializable {
|
||||
|
||||
private int[] windowSize = new int[2];
|
||||
private int[] windowLocation = new int[2];
|
||||
private int splitPaneLocation = 150;
|
||||
private boolean windowMaximized = false;
|
||||
private File ecuDefinitionFile = new File("./ecu_defs.xml");
|
||||
private File lastImageDir = new File("./images");
|
||||
private boolean debug = false;
|
||||
|
||||
public Settings() {
|
||||
windowSize[0] = 800;
|
||||
windowSize[1] = 600;
|
||||
|
||||
//center window by default
|
||||
Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
|
||||
windowLocation[0] = (int)(screenSize.getWidth() - windowSize[0]) / 2;
|
||||
windowLocation[1] = (int)(screenSize.getHeight() - windowSize[1]) / 2;
|
||||
}
|
||||
|
||||
public int[] getWindowSize() {
|
||||
return windowSize;
|
||||
}
|
||||
|
||||
public int[] getWindowLocation() {
|
||||
return windowLocation;
|
||||
}
|
||||
|
||||
public void setWindowSize(int x, int y) {
|
||||
windowSize[0] = x;
|
||||
windowSize[1] = y;
|
||||
}
|
||||
|
||||
public void setWindowLocation(int x, int y) {
|
||||
windowLocation[0] = x;
|
||||
windowLocation[1] = y;
|
||||
}
|
||||
|
||||
public File getEcuDefinitionFile() {
|
||||
return ecuDefinitionFile;
|
||||
}
|
||||
|
||||
public void setEcuDefinitionFile(File ecuDefinitionFile) {
|
||||
this.ecuDefinitionFile = ecuDefinitionFile;
|
||||
}
|
||||
|
||||
public File getLastImageDir() {
|
||||
return lastImageDir;
|
||||
}
|
||||
|
||||
public void setLastImageDir(File lastImageDir) {
|
||||
this.lastImageDir = lastImageDir;
|
||||
}
|
||||
|
||||
public int getSplitPaneLocation() {
|
||||
return splitPaneLocation;
|
||||
}
|
||||
|
||||
public void setSplitPaneLocation(int splitPaneLocation) {
|
||||
this.splitPaneLocation = splitPaneLocation;
|
||||
}
|
||||
|
||||
public boolean isWindowMaximized() {
|
||||
return windowMaximized;
|
||||
}
|
||||
|
||||
public void setWindowMaximized(boolean windowMaximized) {
|
||||
this.windowMaximized = windowMaximized;
|
||||
}
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
package Enginuity.XML;
|
||||
|
||||
public class TableNotFoundException extends Exception { }
|
|
@ -1,64 +1,79 @@
|
|||
package Enginuity;
|
||||
package enginuity;
|
||||
|
||||
import Enginuity.Maps.Rom;
|
||||
import Enginuity.Maps.Table;
|
||||
import Enginuity.SwingComponents.ECUEditorToolBar;
|
||||
import Enginuity.SwingComponents.ECUEditorMenuBar;
|
||||
import Enginuity.SwingComponents.MDIDesktopPane;
|
||||
import Enginuity.SwingComponents.RomTree;
|
||||
import Enginuity.SwingComponents.RomTreeNode;
|
||||
import Enginuity.SwingComponents.TableFrame;
|
||||
import com.sun.org.apache.xerces.internal.parsers.DOMParser;
|
||||
import enginuity.maps.Rom;
|
||||
import enginuity.maps.Table;
|
||||
import enginuity.swing.ECUEditorToolBar;
|
||||
import enginuity.swing.ECUEditorMenuBar;
|
||||
import enginuity.swing.MDIDesktopPane;
|
||||
import enginuity.swing.RomTree;
|
||||
import enginuity.swing.RomTreeNode;
|
||||
import enginuity.swing.TableTreeNode;
|
||||
import enginuity.swing.TableFrame;
|
||||
import enginuity.net.URL;
|
||||
import enginuity.xml.DOMSettingsBuilder;
|
||||
import enginuity.xml.DOMSettingsUnmarshaller;
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Color;
|
||||
import java.awt.GridLayout;
|
||||
import java.awt.event.WindowEvent;
|
||||
import java.awt.event.WindowListener;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.ObjectInputStream;
|
||||
import java.io.ObjectOutputStream;
|
||||
import javax.swing.ImageIcon;
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.JScrollPane;
|
||||
import javax.swing.JSplitPane;
|
||||
import java.util.Vector;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JOptionPane;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.tree.DefaultMutableTreeNode;
|
||||
import org.w3c.dom.Document;
|
||||
import org.xml.sax.InputSource;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
public class ECUEditor extends JFrame implements WindowListener {
|
||||
|
||||
private JScrollPane imagePane = new JScrollPane();
|
||||
private DefaultMutableTreeNode imageRoot = new DefaultMutableTreeNode("ECU Images");
|
||||
private DefaultMutableTreeNode imageRoot = new DefaultMutableTreeNode("Open Images");
|
||||
private RomTree imageList = new RomTree(imageRoot);
|
||||
private Vector<Rom> images = new Vector<Rom>();
|
||||
private Settings settings = new Settings();
|
||||
private String version = new String("0.2.6 Beta");
|
||||
private String version = new String("0.2.7 Beta");
|
||||
private String versionDate = new String("4/12/2006");
|
||||
private String titleText = new String("Enginuity v" + version);
|
||||
private MDIDesktopPane rightPanel = new MDIDesktopPane();
|
||||
private MDIDesktopPane rightPanel = new MDIDesktopPane();
|
||||
private Rom lastSelectedRom = null;
|
||||
private JSplitPane splitPane = new JSplitPane();
|
||||
private ECUEditorToolBar toolBar;
|
||||
private ECUEditorMenuBar menuBar;
|
||||
|
||||
public ECUEditor() {
|
||||
//load settings from disk
|
||||
try {
|
||||
ObjectInputStream in = new ObjectInputStream(
|
||||
new FileInputStream(new File("./settings.dat")));
|
||||
settings = (Settings)in.readObject();
|
||||
in.close();
|
||||
} catch (FileNotFoundException ex) {
|
||||
} catch (IOException ex) {
|
||||
} catch (ClassNotFoundException ex) {
|
||||
}
|
||||
setSize(getSettings().getWindowSize()[0], getSettings().getWindowSize()[1]);
|
||||
setLocation(getSettings().getWindowLocation()[0], getSettings().getWindowLocation()[1]);
|
||||
|
||||
// get settings from xml
|
||||
try {
|
||||
InputSource src = new InputSource(new FileInputStream(new File("./settings.xml")));
|
||||
DOMSettingsUnmarshaller domUms = new DOMSettingsUnmarshaller();
|
||||
DOMParser parser = new DOMParser();
|
||||
parser.parse(src);
|
||||
Document doc = parser.getDocument();
|
||||
settings = domUms.unmarshallSettings(doc.getDocumentElement());
|
||||
} catch (Exception ex) {
|
||||
new JOptionPane().showMessageDialog(this, "Settings file not found.\n" +
|
||||
"A new file will be created.", "Error Loading Settings", JOptionPane.INFORMATION_MESSAGE);
|
||||
}
|
||||
|
||||
setSize(getSettings().getWindowSize());
|
||||
setLocation(getSettings().getWindowLocation());
|
||||
if (getSettings().isWindowMaximized() == true) setExtendedState(JFrame.MAXIMIZED_BOTH);
|
||||
|
||||
JScrollPane rightScrollPane = new JScrollPane(rightPanel, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
|
||||
JScrollPane leftScrollPane = new JScrollPane(imageList, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
|
||||
JScrollPane rightScrollPane = new JScrollPane(rightPanel,
|
||||
JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
|
||||
JScrollPane leftScrollPane = new JScrollPane(imageList,
|
||||
JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
|
||||
splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, leftScrollPane, rightScrollPane);
|
||||
splitPane.setDividerSize(4);
|
||||
splitPane.setDividerLocation(getSettings().getSplitPaneLocation());
|
||||
|
@ -86,20 +101,14 @@ public class ECUEditor extends JFrame implements WindowListener {
|
|||
if (getExtendedState() == JFrame.MAXIMIZED_BOTH) getSettings().setWindowMaximized(true);
|
||||
else {
|
||||
getSettings().setWindowMaximized(false);
|
||||
getSettings().setWindowSize(getSize().width, getSize().height);
|
||||
getSettings().setWindowLocation(getLocation().x, getLocation().y);
|
||||
getSettings().setWindowSize(getSize());
|
||||
getSettings().setWindowLocation(getLocation());
|
||||
}
|
||||
|
||||
DOMSettingsBuilder builder = new DOMSettingsBuilder();
|
||||
try {
|
||||
ObjectOutputStream out = new ObjectOutputStream(
|
||||
new FileOutputStream(new File("./settings.dat")));
|
||||
out.writeObject(getSettings());
|
||||
out.close();
|
||||
} catch (FileNotFoundException ex) {
|
||||
new JOptionPane().showMessageDialog(this, ex.getStackTrace(), "Exception", JOptionPane.ERROR_MESSAGE);
|
||||
} catch (IOException ex) {
|
||||
new JOptionPane().showMessageDialog(this, ex.getStackTrace(), "Exception", JOptionPane.ERROR_MESSAGE);
|
||||
}
|
||||
builder.buildSettings(settings, new File("./settings.xml"));
|
||||
} catch (IOException ex) { }
|
||||
}
|
||||
public void windowOpened(WindowEvent e) { }
|
||||
public void windowClosed(WindowEvent e) { }
|
||||
|
@ -123,27 +132,32 @@ public class ECUEditor extends JFrame implements WindowListener {
|
|||
public void addRom(Rom input) {
|
||||
// add to image vector
|
||||
images.add(input);
|
||||
input.setContainer(this);
|
||||
|
||||
// add to ecu image list pane
|
||||
RomTreeNode node = new RomTreeNode(input);
|
||||
imageRoot.add(node);
|
||||
RomTreeNode romNode = new RomTreeNode(input);
|
||||
imageRoot.add(romNode);
|
||||
imageList.updateUI();
|
||||
|
||||
// add tables
|
||||
Vector<Table> tables = input.getTables();
|
||||
RomTreeNode[] tableNodes = new RomTreeNode[tables.size()];
|
||||
TableTreeNode[] tableNodes = new TableTreeNode[tables.size()];
|
||||
for (int i = 0; i < tables.size(); i++) {
|
||||
tableNodes[i] = new RomTreeNode(tables.get(i));
|
||||
node.add(tableNodes[i]);
|
||||
|
||||
TableFrame frame = new TableFrame(tables.get(i));
|
||||
tableNodes[i].setFrame(frame);
|
||||
//rightPanel.add(frame);
|
||||
romNode.add(tables.get(i));
|
||||
}
|
||||
imageList.expandRow(imageList.getRowCount() - 1);
|
||||
imageList.updateUI();
|
||||
this.setLastSelectedRom(input);
|
||||
|
||||
if (input.getRomID().isObsolete() && settings.isObsoleteWarning()) {
|
||||
JPanel infoPanel = new JPanel();
|
||||
infoPanel.setLayout(new GridLayout(4, 1));
|
||||
infoPanel.add(new JLabel("A newer version of this ECU revision exists."));
|
||||
infoPanel.add(new JLabel("Please visit the following link to download the latest revision:"));
|
||||
infoPanel.add(new JLabel());
|
||||
infoPanel.add(new URL(getSettings().getRomRevisionURL()));
|
||||
new JOptionPane().showMessageDialog(this, infoPanel, "ECU Revision is Obsolete", JOptionPane.INFORMATION_MESSAGE);
|
||||
}
|
||||
input.setContainer(this);
|
||||
}
|
||||
|
||||
public void displayTable(TableFrame frame) {
|
||||
|
@ -166,23 +180,37 @@ public class ECUEditor extends JFrame implements WindowListener {
|
|||
public void closeImage() {
|
||||
for (int i = 0; i < imageRoot.getChildCount(); i++) {
|
||||
if (((RomTreeNode)imageRoot.getChildAt(i)).getRom() == lastSelectedRom) {
|
||||
|
||||
for (int j = 0; j < images.get(i).getTables().size(); j++) {
|
||||
rightPanel.remove(((Table)images.get(i).getTables().get(i)).getFrame());
|
||||
}
|
||||
|
||||
((Rom)images.get(i)).closeImage();
|
||||
imageRoot.remove((DefaultMutableTreeNode)imageRoot.getChildAt(i));
|
||||
imageRoot.remove((RomTreeNode)imageRoot.getChildAt(i));
|
||||
images.remove(i);
|
||||
}
|
||||
}
|
||||
imageList.updateUI();
|
||||
setLastSelectedRom(null);
|
||||
try {
|
||||
setLastSelectedRom(((RomTreeNode)imageRoot.getChildAt(0)).getRom());
|
||||
} catch (Exception ex) {
|
||||
// no other images open
|
||||
setLastSelectedRom(null);
|
||||
}
|
||||
rightPanel.repaint();
|
||||
}
|
||||
|
||||
public void closeAllImages() {
|
||||
while (imageRoot.getChildCount() > 0) {
|
||||
((Rom)images.get(0)).closeImage();
|
||||
imageRoot.remove(0);
|
||||
images.remove(0);
|
||||
}
|
||||
images.removeAllElements();
|
||||
imageRoot.removeAllChildren();
|
||||
imageList.updateUI();
|
||||
setLastSelectedRom(null);
|
||||
rightPanel.removeAll();
|
||||
rightPanel.repaint();
|
||||
}
|
||||
|
||||
public Rom getLastSelectedRom() {
|
||||
|
@ -196,8 +224,15 @@ public class ECUEditor extends JFrame implements WindowListener {
|
|||
} else {
|
||||
this.setTitle(titleText + " - " + lastSelectedRom.getFileName());
|
||||
}
|
||||
|
||||
// update filenames
|
||||
for (int i = 0; i < imageRoot.getChildCount(); i++) {
|
||||
((RomTreeNode)imageRoot.getChildAt(i)).updateFileName();
|
||||
}
|
||||
|
||||
toolBar.updateButtons();
|
||||
menuBar.updateMenu();
|
||||
imageList.updateUI();
|
||||
}
|
||||
|
||||
public ECUEditorToolBar getToolBar() {
|
||||
|
@ -207,4 +242,11 @@ public class ECUEditor extends JFrame implements WindowListener {
|
|||
public void setToolBar(ECUEditorToolBar toolBar) {
|
||||
this.toolBar = toolBar;
|
||||
}
|
||||
|
||||
public void setSettings(Settings settings) {
|
||||
this.settings = settings;
|
||||
for (int i = 0; i < images.size(); i++) {
|
||||
images.get(i).setContainer(this);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,206 @@
|
|||
package enginuity;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.Font;
|
||||
import java.awt.Point;
|
||||
import java.io.File;
|
||||
import java.io.Serializable;
|
||||
import java.util.Vector;
|
||||
|
||||
public class Settings implements Serializable {
|
||||
|
||||
private Dimension windowSize = new Dimension(800, 600);
|
||||
private Point windowLocation = new Point();
|
||||
private int splitPaneLocation = 150;
|
||||
private boolean windowMaximized = false;
|
||||
|
||||
private String romRevisionURL = "http://www.scoobypedia.co.uk/index.php/Knowledge/ECUVersionCompatibilityList";
|
||||
private String supportURL = "http://www.enginuity.org";
|
||||
|
||||
private Vector<File> ecuDefinitionFiles = new Vector<File>();
|
||||
private File lastImageDir = new File("images");
|
||||
private boolean obsoleteWarning = true;
|
||||
private boolean calcConflictWarning = true; //////
|
||||
private boolean debug = false;
|
||||
|
||||
private Font tableFont = new Font("Arial", Font.BOLD, 12);
|
||||
private Dimension cellSize = new Dimension(42, 18);
|
||||
private Color maxColor = new Color(255, 155, 155);
|
||||
private Color minColor = new Color(255, 255, 155);
|
||||
private Color highlightColor = new Color(155, 155, 255);
|
||||
private Color increaseBorder = new Color(255, 0, 0);
|
||||
private Color decreaseBorder = new Color(0, 0, 255);
|
||||
private Color axisColor = new Color(255, 255, 255);
|
||||
private boolean singleTableView = false; //////
|
||||
|
||||
public Settings() {
|
||||
//center window by default
|
||||
addEcuDefinitionFile(new File("ecu_defs.xml"));
|
||||
Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
|
||||
windowLocation.move(((int)(screenSize.getWidth() - windowSize.getWidth()) / 2),
|
||||
((int)(screenSize.getHeight() - windowSize.getHeight()) / 2));
|
||||
}
|
||||
|
||||
public Dimension getWindowSize() {
|
||||
return windowSize;
|
||||
}
|
||||
|
||||
public Point getWindowLocation() {
|
||||
return windowLocation;
|
||||
}
|
||||
|
||||
public void setWindowSize(Dimension size) {
|
||||
windowSize.setSize(size);
|
||||
}
|
||||
|
||||
public void setWindowLocation(Point location) {
|
||||
windowLocation.setLocation(location);
|
||||
}
|
||||
|
||||
public File getEcuDefinitionFile() {
|
||||
return ecuDefinitionFiles.elementAt(0);
|
||||
}
|
||||
|
||||
public void addEcuDefinitionFile(File ecuDefinitionFile) {
|
||||
if (ecuDefinitionFiles.size() == 0)
|
||||
ecuDefinitionFiles.add(ecuDefinitionFile);
|
||||
else ecuDefinitionFiles.set(0, ecuDefinitionFile);
|
||||
}
|
||||
|
||||
public File getLastImageDir() {
|
||||
return lastImageDir;
|
||||
}
|
||||
|
||||
public void setLastImageDir(File lastImageDir) {
|
||||
this.lastImageDir = lastImageDir;
|
||||
}
|
||||
|
||||
public int getSplitPaneLocation() {
|
||||
return splitPaneLocation;
|
||||
}
|
||||
|
||||
public void setSplitPaneLocation(int splitPaneLocation) {
|
||||
this.splitPaneLocation = splitPaneLocation;
|
||||
}
|
||||
|
||||
public boolean isWindowMaximized() {
|
||||
return windowMaximized;
|
||||
}
|
||||
|
||||
public void setWindowMaximized(boolean windowMaximized) {
|
||||
this.windowMaximized = windowMaximized;
|
||||
}
|
||||
|
||||
public String getRomRevisionURL() {
|
||||
return romRevisionURL;
|
||||
}
|
||||
|
||||
public void setRomRevisionURL(String romRevisionURL) {
|
||||
this.romRevisionURL = romRevisionURL;
|
||||
}
|
||||
|
||||
public String getSupportURL() {
|
||||
return supportURL;
|
||||
}
|
||||
|
||||
public void setSupportURL(String supportURL) {
|
||||
this.supportURL = supportURL;
|
||||
}
|
||||
|
||||
public Font getTableFont() {
|
||||
return tableFont;
|
||||
}
|
||||
|
||||
public void setTableFont(Font tableFont) {
|
||||
this.tableFont = tableFont;
|
||||
}
|
||||
|
||||
public boolean isObsoleteWarning() {
|
||||
return obsoleteWarning;
|
||||
}
|
||||
|
||||
public void setObsoleteWarning(boolean obsoleteWarning) {
|
||||
this.obsoleteWarning = obsoleteWarning;
|
||||
}
|
||||
|
||||
public boolean isDebug() {
|
||||
return debug;
|
||||
}
|
||||
|
||||
public void setDebug(boolean debug) {
|
||||
this.debug = debug;
|
||||
}
|
||||
|
||||
public Dimension getCellSize() {
|
||||
return cellSize;
|
||||
}
|
||||
|
||||
public void setCellSize(Dimension cellSize) {
|
||||
this.cellSize = cellSize;
|
||||
}
|
||||
|
||||
public Color getMaxColor() {
|
||||
return maxColor;
|
||||
}
|
||||
|
||||
public void setMaxColor(Color maxColor) {
|
||||
this.maxColor = maxColor;
|
||||
}
|
||||
|
||||
public Color getMinColor() {
|
||||
return minColor;
|
||||
}
|
||||
|
||||
public void setMinColor(Color minColor) {
|
||||
this.minColor = minColor;
|
||||
}
|
||||
|
||||
public boolean isSingleTableView() {
|
||||
return singleTableView;
|
||||
}
|
||||
|
||||
public void setSingleTableView(boolean singleTableView) {
|
||||
this.singleTableView = singleTableView;
|
||||
}
|
||||
|
||||
public Color getHighlightColor() {
|
||||
return highlightColor;
|
||||
}
|
||||
|
||||
public void setHighlightColor(Color highlightColor) {
|
||||
this.highlightColor = highlightColor;
|
||||
}
|
||||
|
||||
public boolean isCalcConflictWarning() {
|
||||
return calcConflictWarning;
|
||||
}
|
||||
|
||||
public void setCalcConflictWarning(boolean calcConflictWarning) {
|
||||
this.calcConflictWarning = calcConflictWarning;
|
||||
}
|
||||
|
||||
public Color getIncreaseBorder() {
|
||||
return increaseBorder;
|
||||
}
|
||||
|
||||
public void setIncreaseBorder(Color increaseBorder) {
|
||||
this.increaseBorder = increaseBorder;
|
||||
}
|
||||
|
||||
public Color getDecreaseBorder() {
|
||||
return decreaseBorder;
|
||||
}
|
||||
|
||||
public void setDecreaseBorder(Color decreaseBorder) {
|
||||
this.decreaseBorder = decreaseBorder;
|
||||
}
|
||||
|
||||
public Color getAxisColor() {
|
||||
return axisColor;
|
||||
}
|
||||
|
||||
public void setAxisColor(Color axisColor) {
|
||||
this.axisColor = axisColor;
|
||||
}
|
||||
}
|
|
@ -1,7 +1,9 @@
|
|||
package Enginuity.DefinitionBuilder;
|
||||
package enginuity.definitionbuilder;
|
||||
|
||||
import Enginuity.Maps.Rom;
|
||||
import Enginuity.XML.RomAttributeParser;
|
||||
import enginuity.definitionbuilder.DefinitionBuilder;
|
||||
import enginuity.definitionbuilder.SubaruMapDefinitionParser;
|
||||
import enginuity.maps.Rom;
|
||||
import enginuity.xml.RomAttributeParser;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
|
@ -14,10 +16,14 @@ public class DefinitionBuilder extends javax.swing.JFrame {
|
|||
|
||||
public DefinitionBuilder(Rom rom, File imageDir) {
|
||||
initComponents();
|
||||
setVisible(true);
|
||||
|
||||
inputFile.setText(rom.getFullFileName().getAbsolutePath());
|
||||
try {
|
||||
setLocationRelativeTo(rom.getContainer());
|
||||
inputFile.setText(rom.getFullFileName().getAbsolutePath());
|
||||
} catch (NullPointerException ex) { }
|
||||
|
||||
this.imageDir = imageDir;
|
||||
setVisible(true);
|
||||
}
|
||||
|
||||
public DefinitionBuilder() {
|
||||
|
@ -225,22 +231,6 @@ public class DefinitionBuilder extends javax.swing.JFrame {
|
|||
inputFile.setText(fc.getSelectedFile().getAbsolutePath());
|
||||
}
|
||||
}//GEN-LAST:event_browseBtnActionPerformed
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static void main(String args[]) {
|
||||
java.awt.EventQueue.invokeLater(new Runnable() {
|
||||
public void run() {
|
||||
new DefinitionBuilder().setVisible(true);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private javax.swing.JLabel addressLabel;
|
|
@ -1,6 +1,6 @@
|
|||
package Enginuity.DefinitionBuilder;
|
||||
package enginuity.definitionbuilder;
|
||||
|
||||
import Enginuity.XML.RomAttributeParser;
|
||||
import enginuity.xml.RomAttributeParser;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
|
@ -1,5 +1,7 @@
|
|||
package Enginuity.Maps;
|
||||
package enginuity.maps;
|
||||
|
||||
import enginuity.maps.Scale;
|
||||
import enginuity.maps.Table;
|
||||
import java.awt.Color;
|
||||
import java.awt.Font;
|
||||
import java.awt.event.MouseEvent;
|
||||
|
@ -18,21 +20,21 @@ public class DataCell extends JLabel implements MouseListener, Serializable {
|
|||
private String displayValue = "";
|
||||
private Color scaledColor = new Color(0,0,0);
|
||||
private Color highlightColor = new Color(155,155,255);
|
||||
private Color increaseBorder = Color.RED;
|
||||
private Color decreaseBorder = Color.BLUE;
|
||||
private Boolean selected = false;
|
||||
private Boolean highlighted = false;
|
||||
private Table table;
|
||||
private int x = 0;
|
||||
private int y = 0;
|
||||
|
||||
public DataCell() {
|
||||
this(new Scale());
|
||||
}
|
||||
public DataCell() { }
|
||||
|
||||
public DataCell(Scale scale) {
|
||||
this.scale = scale;
|
||||
this.setHorizontalAlignment(CENTER);
|
||||
this.setVerticalAlignment(CENTER);
|
||||
this.setFont(new Font("Arial", Font.BOLD, 12));
|
||||
this.setFont(new Font("Arial", Font.BOLD, 12));
|
||||
this.setBorder(new LineBorder(Color.BLACK, 1));
|
||||
this.setOpaque(true);
|
||||
this.setVisible(true);
|
||||
|
@ -40,16 +42,16 @@ public class DataCell extends JLabel implements MouseListener, Serializable {
|
|||
}
|
||||
|
||||
public void updateDisplayValue() {
|
||||
DecimalFormat formatter = new DecimalFormat(scale.getFormat());
|
||||
displayValue = formatter.format(calcDisplayValue(binValue, table.getScale().getExpression()));
|
||||
DecimalFormat formatter = new DecimalFormat(scale.getFormat());
|
||||
displayValue = formatter.format(calcDisplayValue(binValue, table.getScale().getExpression()));
|
||||
this.setText(displayValue);
|
||||
}
|
||||
|
||||
public double calcDisplayValue(int input, String expression) {
|
||||
JEP parser = new JEP();
|
||||
parser.initSymTab(); // clear the contents of the symbol table
|
||||
parser.addStandardConstants();
|
||||
parser.addComplex(); // among other things adds i to the symbol table
|
||||
/*parser.addStandardConstants();
|
||||
parser.addComplex(); // among other things adds i to the symbol table*/
|
||||
parser.addVariable("x", input);
|
||||
parser.parseExpression(expression);
|
||||
return parser.getValue();
|
||||
|
@ -75,42 +77,42 @@ public class DataCell extends JLabel implements MouseListener, Serializable {
|
|||
}
|
||||
this.updateDisplayValue();
|
||||
if (binValue > getOriginalValue()) {
|
||||
this.setBorder(new LineBorder(Color.RED, 2));
|
||||
this.setBorder(new LineBorder(increaseBorder, 2));
|
||||
} else if (binValue < getOriginalValue()) {
|
||||
this.setBorder(new LineBorder(Color.BLUE, 2));
|
||||
this.setBorder(new LineBorder(decreaseBorder, 2));
|
||||
} else {
|
||||
this.setBorder(new LineBorder(Color.BLACK, 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public int getBinValue() {
|
||||
return binValue;
|
||||
}
|
||||
|
||||
|
||||
public String toString() {
|
||||
return displayValue;
|
||||
}
|
||||
|
||||
|
||||
public Boolean isSelected() {
|
||||
return selected;
|
||||
}
|
||||
|
||||
|
||||
public void setSelected(Boolean selected) {
|
||||
this.selected = selected;
|
||||
if (selected) {
|
||||
this.setBackground(highlightColor);
|
||||
table.getFrame().getToolBar().setCoarseValue(Math.abs(table.getScale().getIncrement()));
|
||||
this.setBackground(getHighlightColor());
|
||||
table.getFrame().getToolBar().setCoarseValue(Math.abs(table.getScale().getIncrement()));
|
||||
} else {
|
||||
this.setBackground(scaledColor);
|
||||
}
|
||||
requestFocus();
|
||||
}
|
||||
|
||||
|
||||
public void setHighlighted(Boolean highlighted) {
|
||||
if (!table.isStatic()) {
|
||||
this.highlighted = highlighted;
|
||||
if (highlighted) {
|
||||
this.setBackground(highlightColor);
|
||||
this.setBackground(getHighlightColor());
|
||||
} else {
|
||||
if (!selected) this.setBackground(scaledColor);
|
||||
}
|
||||
|
@ -125,15 +127,15 @@ public class DataCell extends JLabel implements MouseListener, Serializable {
|
|||
table.highlight(x, y);
|
||||
}
|
||||
|
||||
public void mousePressed(MouseEvent e) {
|
||||
if (!table.isStatic()) {
|
||||
public void mousePressed(MouseEvent e) {
|
||||
if (!table.isStatic()) {
|
||||
if (!e.isControlDown()) table.clearSelection();
|
||||
table.startHighlight(x, y);
|
||||
table.startHighlight(x, y);
|
||||
}
|
||||
requestFocus();
|
||||
}
|
||||
|
||||
public void mouseReleased(MouseEvent e) {
|
||||
public void mouseReleased(MouseEvent e) {
|
||||
if (!table.isStatic()) {
|
||||
table.stopHighlight();
|
||||
}
|
||||
|
@ -146,31 +148,30 @@ public class DataCell extends JLabel implements MouseListener, Serializable {
|
|||
if (table.getScale().getIncrement() < 0) increment = 0 - increment;
|
||||
this.setBinValue(binValue + increment);
|
||||
}
|
||||
|
||||
|
||||
public void setTable(Table table) {
|
||||
this.table = table;
|
||||
this.setInputMap(this.WHEN_FOCUSED, table.getInputMap(this.WHEN_FOCUSED));
|
||||
}
|
||||
|
||||
|
||||
public void setXCoord(int x) {
|
||||
this.x = x;
|
||||
}
|
||||
|
||||
|
||||
public void setYCoord(int y) {
|
||||
this.y = y;
|
||||
}
|
||||
|
||||
|
||||
public int getOriginalValue() {
|
||||
return originalValue;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void setOriginalValue(int originalValue) {
|
||||
this.originalValue = originalValue;
|
||||
if (binValue != getOriginalValue()) {
|
||||
this.setBorder(new LineBorder(Color.RED, 3));
|
||||
} else {
|
||||
this.setBorder(new LineBorder(Color.BLACK, 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void undo() {
|
||||
|
@ -181,7 +182,7 @@ public class DataCell extends JLabel implements MouseListener, Serializable {
|
|||
this.setOriginalValue(binValue);
|
||||
}
|
||||
|
||||
public void setRealValue(String input) {
|
||||
public void setRealValue(String input) {
|
||||
// create parser
|
||||
if (!input.equalsIgnoreCase("x")) {
|
||||
JEP parser = new JEP();
|
||||
|
@ -193,4 +194,28 @@ public class DataCell extends JLabel implements MouseListener, Serializable {
|
|||
this.setBinValue((int)Math.round(parser.getValue()));
|
||||
}
|
||||
}
|
||||
|
||||
public Color getHighlightColor() {
|
||||
return highlightColor;
|
||||
}
|
||||
|
||||
public void setHighlightColor(Color highlightColor) {
|
||||
this.highlightColor = highlightColor;
|
||||
}
|
||||
|
||||
public Color getIncreaseBorder() {
|
||||
return increaseBorder;
|
||||
}
|
||||
|
||||
public void setIncreaseBorder(Color increaseBorder) {
|
||||
this.increaseBorder = increaseBorder;
|
||||
}
|
||||
|
||||
public Color getDecreaseBorder() {
|
||||
return decreaseBorder;
|
||||
}
|
||||
|
||||
public void setDecreaseBorder(Color decreaseBorder) {
|
||||
this.decreaseBorder = decreaseBorder;
|
||||
}
|
||||
}
|
|
@ -1,13 +1,16 @@
|
|||
//base ECU version
|
||||
package enginuity.maps;
|
||||
|
||||
package Enginuity.Maps;
|
||||
|
||||
import Enginuity.ECUEditor;
|
||||
import Enginuity.XML.TableNotFoundException;
|
||||
import enginuity.maps.RomID;
|
||||
import enginuity.maps.Table;
|
||||
import enginuity.ECUEditor;
|
||||
import enginuity.xml.TableNotFoundException;
|
||||
import java.awt.GridLayout;
|
||||
import java.io.File;
|
||||
import java.io.Serializable;
|
||||
import java.util.Vector;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JOptionPane;
|
||||
import javax.swing.JPanel;
|
||||
|
||||
//import Enginuity.
|
||||
|
||||
|
@ -63,11 +66,12 @@ public class Rom implements Serializable {
|
|||
i--;
|
||||
}
|
||||
} catch (ArrayIndexOutOfBoundsException ex) {
|
||||
new JOptionPane().showMessageDialog(container, "Storage address for table \"" + tables.get(i).getName() + "\" is out of bounds.\nPlease check ECU definition file.", "ECU Definition Error", JOptionPane.ERROR_MESSAGE);
|
||||
tables.remove(i);
|
||||
new JOptionPane().showMessageDialog(container, "Storage address for table \"" + tables.get(i).getName() +
|
||||
"\" is out of bounds.\nPlease check ECU definition file.", "ECU Definition Error", JOptionPane.ERROR_MESSAGE);
|
||||
tables.removeElementAt(i);
|
||||
} catch (NullPointerException ex) {
|
||||
new JOptionPane().showMessageDialog(container, "There was an error loading table " + tables.get(i).getName(), "ECU Definition Error", JOptionPane.ERROR_MESSAGE);
|
||||
tables.remove(i);
|
||||
tables.removeElementAt(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -113,6 +117,11 @@ public class Rom implements Serializable {
|
|||
|
||||
public void setContainer(ECUEditor container) {
|
||||
this.container = container;
|
||||
// apply settings to tables
|
||||
for (int i = 0; i < tables.size(); i++) {
|
||||
tables.get(i).finalize(container.getSettings());
|
||||
tables.get(i).resize();
|
||||
}
|
||||
}
|
||||
|
||||
public byte[] saveFile() {
|
||||
|
@ -138,5 +147,6 @@ public class Rom implements Serializable {
|
|||
|
||||
public void setFullFileName(File fullFileName) {
|
||||
this.fullFileName = fullFileName;
|
||||
this.setFileName(fullFileName.getName());
|
||||
}
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
//ECU version definition
|
||||
|
||||
package Enginuity.Maps;
|
||||
package enginuity.maps;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
//This object defines the scaling factor and offset for calculating real values
|
||||
|
||||
package Enginuity.Maps;
|
||||
package enginuity.maps;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
|
@ -1,7 +1,8 @@
|
|||
package Enginuity.Maps;
|
||||
package enginuity.maps;
|
||||
|
||||
import Enginuity.XML.RomAttributeParser;
|
||||
import Enginuity.SwingComponents.TableFrame;
|
||||
import enginuity.Settings;
|
||||
import enginuity.xml.RomAttributeParser;
|
||||
import enginuity.swing.TableFrame;
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Color;
|
||||
import java.awt.Dimension;
|
||||
|
@ -22,6 +23,7 @@ import javax.swing.InputMap;
|
|||
import javax.swing.JOptionPane;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.KeyStroke;
|
||||
import org.nfunk.jep.JEP;
|
||||
|
||||
public abstract class Table extends JPanel implements Serializable {
|
||||
|
||||
|
@ -35,8 +37,8 @@ public abstract class Table extends JPanel implements Serializable {
|
|||
|
||||
protected String name;
|
||||
protected int type;
|
||||
protected String category;
|
||||
protected String description;
|
||||
protected String category = "Other";
|
||||
protected String description = "";
|
||||
protected Scale scale = new Scale();
|
||||
protected int storageAddress;
|
||||
protected int storageType;//number of bytes per cell
|
||||
|
@ -61,6 +63,8 @@ public abstract class Table extends JPanel implements Serializable {
|
|||
protected int highlightY;
|
||||
protected boolean highlight = false;
|
||||
protected Table axisParent;
|
||||
protected Color maxColor;
|
||||
protected Color minColor;
|
||||
|
||||
public Table() {
|
||||
this.setLayout(borderLayout);
|
||||
|
@ -268,7 +272,7 @@ public abstract class Table extends JPanel implements Serializable {
|
|||
}
|
||||
}
|
||||
}
|
||||
this.colorize();
|
||||
//this.colorize();
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
|
@ -398,6 +402,7 @@ public abstract class Table extends JPanel implements Serializable {
|
|||
if (!isStatic) {
|
||||
int high = 0;
|
||||
int low = 999999999;
|
||||
|
||||
for (int i = 0; i < data.length; i++) {
|
||||
if (data[i].getBinValue() > high) {
|
||||
high = data[i].getBinValue();
|
||||
|
@ -408,9 +413,11 @@ public abstract class Table extends JPanel implements Serializable {
|
|||
}
|
||||
for (int i = 0; i < data.length; i++) {
|
||||
double scale = (double)(data[i].getBinValue() - low) / (high - low);
|
||||
int g = (int)(255 - (255 - 140) * scale);
|
||||
if (g > 255) g = 255;
|
||||
data[i].setColor(new Color(255, g, 125));
|
||||
int r = (int)((maxColor.getRed() - minColor.getRed()) * scale) + minColor.getRed();
|
||||
int g = (int)((maxColor.getGreen() - minColor.getGreen()) * scale) + minColor.getGreen();
|
||||
int b = (int)((maxColor.getBlue() - minColor.getBlue()) * scale) + minColor.getBlue();
|
||||
|
||||
data[i].setColor(new Color(r, g, b));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -448,11 +455,11 @@ public abstract class Table extends JPanel implements Serializable {
|
|||
}
|
||||
}
|
||||
|
||||
public Rom getContainer() {
|
||||
public Rom getRom() {
|
||||
return container;
|
||||
}
|
||||
|
||||
public void setContainer(Rom container) {
|
||||
public void setRom(Rom container) {
|
||||
this.container = container;
|
||||
}
|
||||
|
||||
|
@ -667,4 +674,63 @@ public abstract class Table extends JPanel implements Serializable {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void finalize(Settings settings) {
|
||||
// apply settings to cells
|
||||
for (int i = 0; i < getDataSize(); i++) {
|
||||
this.setMaxColor(settings.getMaxColor());
|
||||
this.setMinColor(settings.getMinColor());
|
||||
data[i].setHighlightColor(settings.getHighlightColor());
|
||||
data[i].setIncreaseBorder(settings.getIncreaseBorder());
|
||||
data[i].setDecreaseBorder(settings.getDecreaseBorder());
|
||||
data[i].setFont(settings.getTableFont());
|
||||
data[i].repaint();
|
||||
}
|
||||
cellHeight = (int)settings.getCellSize().getHeight();
|
||||
cellWidth = (int)settings.getCellSize().getWidth();
|
||||
colorize();
|
||||
validateScaling();
|
||||
}
|
||||
|
||||
public void resize() {
|
||||
frame.setSize(getFrameSize());
|
||||
}
|
||||
|
||||
public Color getMaxColor() {
|
||||
return maxColor;
|
||||
}
|
||||
|
||||
public void setMaxColor(Color maxColor) {
|
||||
this.maxColor = maxColor;
|
||||
}
|
||||
|
||||
public Color getMinColor() {
|
||||
return minColor;
|
||||
}
|
||||
|
||||
public void setMinColor(Color minColor) {
|
||||
this.minColor = minColor;
|
||||
}
|
||||
|
||||
public abstract void setAxisColor(Color color);
|
||||
|
||||
public void validateScaling() {
|
||||
JEP parser = new JEP();
|
||||
parser.initSymTab(); // clear the contents of the symbol table
|
||||
parser.addVariable("x", 5);
|
||||
parser.parseExpression(scale.getExpression());
|
||||
double toReal = parser.getValue();
|
||||
|
||||
parser.addVariable("x", toReal);
|
||||
parser.parseExpression(scale.getByteExpression());
|
||||
|
||||
if (parser.getValue() != 5 && container.getContainer().getSettings().isCalcConflictWarning()) {
|
||||
new JOptionPane().showMessageDialog(container.getContainer(),
|
||||
"The real value and byte value conversion expressions for\n" +
|
||||
"table " + name +
|
||||
" are invalid.\n\n" +
|
||||
"To real value: " + scale.getExpression() + "\n" +
|
||||
"To byte: " + scale.getByteExpression(), "Byte Conversion Error", JOptionPane.ERROR_MESSAGE);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,5 +1,7 @@
|
|||
package Enginuity.Maps;
|
||||
package enginuity.maps;
|
||||
|
||||
import enginuity.maps.Table;
|
||||
import enginuity.maps.Table3D;
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Color;
|
||||
import java.io.Serializable;
|
||||
|
@ -7,7 +9,8 @@ import javax.swing.JLabel;
|
|||
|
||||
public class Table1D extends Table implements Serializable {
|
||||
|
||||
private boolean isAxis = false;
|
||||
private boolean isAxis = false;
|
||||
private Color axisColor = new Color(255, 255, 255);
|
||||
|
||||
public Table1D() {
|
||||
super();
|
||||
|
@ -23,7 +26,6 @@ public class Table1D extends Table implements Serializable {
|
|||
centerPanel.add(this.getDataCell(i));
|
||||
}
|
||||
this.add(new JLabel(name + " (" + scale.getUnit() + ")", JLabel.CENTER), BorderLayout.NORTH);
|
||||
this.colorize();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
|
@ -56,7 +58,7 @@ public class Table1D extends Table implements Serializable {
|
|||
super.colorize();
|
||||
} else {
|
||||
for (int i = 0; i < this.getDataSize(); i++) {
|
||||
data[i].setColor(Color.WHITE);
|
||||
data[i].setColor(getAxisColor());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -72,7 +74,11 @@ public class Table1D extends Table implements Serializable {
|
|||
}
|
||||
public void cursorDown() {
|
||||
if (type == Table.TABLE_Y_AXIS) {
|
||||
if (highlightY < getDataSize() - 1 && data[highlightY].isSelected()) selectCellAt(highlightY + 1);
|
||||
if (axisParent.getType() == Table.TABLE_3D) {
|
||||
if (highlightY < getDataSize() - 1 && data[highlightY].isSelected()) selectCellAt(highlightY + 1);
|
||||
} else if (axisParent.getType() == Table.TABLE_2D) {
|
||||
if (data[highlightY].isSelected()) axisParent.selectCellAt(highlightY);
|
||||
}
|
||||
} else if (type == Table.TABLE_X_AXIS && data[highlightY].isSelected()) {
|
||||
((Table3D)axisParent).selectCellAt(highlightY, this);
|
||||
} else if (type == Table.TABLE_1D) {
|
||||
|
@ -83,6 +89,9 @@ public class Table1D extends Table implements Serializable {
|
|||
public void cursorLeft() {
|
||||
if (type == Table.TABLE_Y_AXIS) {
|
||||
// X axis is on left.. nothing happens
|
||||
if (axisParent.getType() == Table.TABLE_2D) {
|
||||
if (data[highlightY].isSelected()) selectCellAt(highlightY - 1);
|
||||
}
|
||||
} else if (type == Table.TABLE_X_AXIS && data[highlightY].isSelected()) {
|
||||
if (highlightY > 0) selectCellAt(highlightY - 1);
|
||||
} else if (type == Table.TABLE_1D && data[highlightY].isSelected()) {
|
||||
|
@ -92,7 +101,8 @@ public class Table1D extends Table implements Serializable {
|
|||
|
||||
public void cursorRight() {
|
||||
if (type == Table.TABLE_Y_AXIS && data[highlightY].isSelected()) {
|
||||
((Table3D)axisParent).selectCellAt(highlightY, this);
|
||||
if (axisParent.getType() == Table.TABLE_3D) ((Table3D)axisParent).selectCellAt(highlightY, this);
|
||||
else if (axisParent.getType() == Table.TABLE_2D) selectCellAt(highlightY + 1);
|
||||
} else if (type == Table.TABLE_X_AXIS && data[highlightY].isSelected()) {
|
||||
if (highlightY < getDataSize() - 1) selectCellAt(highlightY + 1);
|
||||
} else if (type == Table.TABLE_1D && data[highlightY].isSelected()) {
|
||||
|
@ -117,4 +127,12 @@ public class Table1D extends Table implements Serializable {
|
|||
public String getCellAsString(int index) {
|
||||
return data[index].getText();
|
||||
}
|
||||
|
||||
public Color getAxisColor() {
|
||||
return axisColor;
|
||||
}
|
||||
|
||||
public void setAxisColor(Color axisColor) {
|
||||
this.axisColor = axisColor;
|
||||
}
|
||||
}
|
|
@ -1,7 +1,11 @@
|
|||
package Enginuity.Maps;
|
||||
package enginuity.maps;
|
||||
|
||||
import Enginuity.SwingComponents.TableFrame;
|
||||
import enginuity.maps.Table;
|
||||
import enginuity.maps.Table1D;
|
||||
import enginuity.Settings;
|
||||
import enginuity.swing.TableFrame;
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Color;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.Toolkit;
|
||||
import java.awt.datatransfer.DataFlavor;
|
||||
|
@ -53,12 +57,18 @@ public class Table2D extends Table implements Serializable {
|
|||
return new Dimension(width, height);
|
||||
}
|
||||
|
||||
public void finalize(Settings settings) {
|
||||
this.setAxisColor(settings.getAxisColor());
|
||||
axis.finalize(settings);
|
||||
super.finalize(settings);
|
||||
}
|
||||
|
||||
public void populateTable(byte[] input) throws ArrayIndexOutOfBoundsException {
|
||||
centerLayout.setRows(2);
|
||||
centerLayout.setColumns(this.getDataSize());
|
||||
|
||||
try {
|
||||
axis.setContainer(container);
|
||||
axis.setRom(container);
|
||||
axis.populateTable(input);
|
||||
super.populateTable(input);
|
||||
} catch (ArrayIndexOutOfBoundsException ex) {
|
||||
|
@ -74,7 +84,7 @@ public class Table2D extends Table implements Serializable {
|
|||
}
|
||||
this.add(new JLabel(axis.getName() + " (" + axis.getScale().getUnit() + ")", JLabel.CENTER), BorderLayout.NORTH);
|
||||
this.add(new JLabel(name + " (" + scale.getUnit() + ")", JLabel.CENTER), BorderLayout.SOUTH);
|
||||
this.colorize();
|
||||
//this.colorize();
|
||||
}
|
||||
|
||||
public void increment(int increment) {
|
||||
|
@ -125,16 +135,20 @@ public class Table2D extends Table implements Serializable {
|
|||
}
|
||||
|
||||
public void cursorUp() {
|
||||
if (!axis.isStatic()) axis.selectCellAt(highlightY);
|
||||
if (!axis.isStatic() && data[highlightY].isSelected()) axis.selectCellAt(highlightY);
|
||||
}
|
||||
public void cursorDown() {
|
||||
axis.cursorDown();
|
||||
}
|
||||
public void cursorDown() { }
|
||||
|
||||
public void cursorLeft() {
|
||||
if (highlightY > 0) selectCellAt(highlightY - 1);
|
||||
if (highlightY > 0 && data[highlightY].isSelected()) selectCellAt(highlightY - 1);
|
||||
else axis.cursorLeft();
|
||||
}
|
||||
|
||||
public void cursorRight() {
|
||||
if (highlightY < data.length - 1) selectCellAt(highlightY + 1);
|
||||
if (highlightY < data.length - 1 && data[highlightY].isSelected()) selectCellAt(highlightY + 1);
|
||||
else axis.cursorRight();
|
||||
}
|
||||
|
||||
public void startHighlight(int x, int y) {
|
||||
|
@ -190,4 +204,13 @@ public class Table2D extends Table implements Serializable {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setAxisColor(Color axisColor) {
|
||||
axis.setAxisColor(axisColor);
|
||||
}
|
||||
|
||||
public void validateScaling() {
|
||||
super.validateScaling();
|
||||
axis.validateScaling();
|
||||
}
|
||||
}
|
|
@ -1,8 +1,12 @@
|
|||
package Enginuity.Maps;
|
||||
package enginuity.maps;
|
||||
|
||||
import Enginuity.XML.RomAttributeParser;
|
||||
import Enginuity.SwingComponents.TableFrame;
|
||||
import Enginuity.SwingComponents.VTextIcon;
|
||||
import enginuity.maps.DataCell;
|
||||
import enginuity.maps.Table;
|
||||
import enginuity.maps.Table1D;
|
||||
import enginuity.Settings;
|
||||
import enginuity.xml.RomAttributeParser;
|
||||
import enginuity.swing.TableFrame;
|
||||
import enginuity.swing.VTextIcon;
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Color;
|
||||
import java.awt.Dimension;
|
||||
|
@ -99,9 +103,9 @@ public class Table3D extends Table implements Serializable {
|
|||
|
||||
// populate axiis
|
||||
try {
|
||||
xAxis.setContainer(container);
|
||||
xAxis.setRom(container);
|
||||
xAxis.populateTable(input);
|
||||
yAxis.setContainer(container);
|
||||
yAxis.setRom(container);
|
||||
yAxis.populateTable(input);
|
||||
} catch (ArrayIndexOutOfBoundsException ex) {
|
||||
throw new ArrayIndexOutOfBoundsException();
|
||||
|
@ -135,7 +139,7 @@ public class Table3D extends Table implements Serializable {
|
|||
offset++;
|
||||
}
|
||||
}
|
||||
this.colorize();
|
||||
//this.colorize();
|
||||
|
||||
GridLayout topLayout = new GridLayout(2,1);
|
||||
JPanel topPanel = new JPanel(topLayout);
|
||||
|
@ -166,9 +170,11 @@ public class Table3D extends Table implements Serializable {
|
|||
for (int x = 0; x < data.length; x++) {
|
||||
for (int y = 0; y < data[0].length; y++) {
|
||||
double scale = (double)(data[x][y].getBinValue() - low) / (high - low);
|
||||
int g = (int)(255 - (255 - 140) * scale);
|
||||
if (g > 255) g = 255;
|
||||
data[x][y].setColor(new Color(255, g, 125));
|
||||
|
||||
int r = (int)((maxColor.getRed() - minColor.getRed()) * scale) + minColor.getRed();
|
||||
int g = (int)((maxColor.getGreen() - minColor.getGreen()) * scale) + minColor.getGreen();
|
||||
int b = (int)((maxColor.getBlue() - minColor.getBlue()) * scale) + minColor.getBlue();
|
||||
data[x][y].setColor(new Color(r, g, b));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -527,7 +533,40 @@ public class Table3D extends Table implements Serializable {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public void finalize(Settings settings) {
|
||||
// apply settings to cells
|
||||
for (int y = 0; y < getSizeY(); y++) {
|
||||
for (int x = 0; x < getSizeX(); x++) {
|
||||
|
||||
this.setMaxColor(settings.getMaxColor());
|
||||
this.setMinColor(settings.getMinColor());
|
||||
data[x][y].setHighlightColor(settings.getHighlightColor());
|
||||
data[x][y].setIncreaseBorder(settings.getIncreaseBorder());
|
||||
data[x][y].setDecreaseBorder(settings.getDecreaseBorder());
|
||||
data[x][y].setFont(settings.getTableFont());
|
||||
data[x][y].repaint();
|
||||
}
|
||||
}
|
||||
this.setAxisColor(settings.getAxisColor());
|
||||
xAxis.finalize(settings);
|
||||
yAxis.finalize(settings);
|
||||
cellHeight = (int)settings.getCellSize().getHeight();
|
||||
cellWidth = (int)settings.getCellSize().getWidth();
|
||||
resize();
|
||||
colorize();
|
||||
}
|
||||
|
||||
public void setAxisColor(Color axisColor) {
|
||||
xAxis.setAxisColor(axisColor);
|
||||
yAxis.setAxisColor(axisColor);
|
||||
}
|
||||
|
||||
public void validateScaling() {
|
||||
super.validateScaling();
|
||||
xAxis.validateScaling();
|
||||
yAxis.validateScaling();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,53 @@
|
|||
package enginuity.net;
|
||||
import java.io.IOException;
|
||||
|
||||
public class BrowserControl {
|
||||
|
||||
public static void displayURL(String url) {
|
||||
boolean windows = isWindowsPlatform();
|
||||
String cmd = null;
|
||||
try {
|
||||
if (windows) {
|
||||
// cmd = 'rundll32 url.dll,FileProtocolHandler http://...'
|
||||
cmd = WIN_PATH + " " + WIN_FLAG + " " + url;
|
||||
Process p = Runtime.getRuntime().exec(cmd);
|
||||
}
|
||||
else {
|
||||
cmd = UNIX_PATH + " " + UNIX_FLAG + "(" + url + ")";
|
||||
Process p = Runtime.getRuntime().exec(cmd);
|
||||
try {
|
||||
int exitCode = p.waitFor();
|
||||
if (exitCode != 0)
|
||||
{
|
||||
cmd = UNIX_PATH + " " + url;
|
||||
p = Runtime.getRuntime().exec(cmd);
|
||||
}
|
||||
}
|
||||
catch(InterruptedException x) {
|
||||
System.err.println("Error bringing up browser, cmd='" +
|
||||
cmd + "'");
|
||||
System.err.println("Caught: " + x);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(IOException x) {
|
||||
// couldn't exec browser
|
||||
System.err.println("Could not invoke browser, command=" + cmd);
|
||||
System.err.println("Caught: " + x);
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isWindowsPlatform() {
|
||||
String os = System.getProperty("os.name");
|
||||
if ( os != null && os.startsWith(WIN_ID))
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
private static final String WIN_ID = "Windows";
|
||||
private static final String WIN_PATH = "rundll32";
|
||||
private static final String WIN_FLAG = "url.dll,FileProtocolHandler";
|
||||
private static final String UNIX_PATH = "netscape";
|
||||
private static final String UNIX_FLAG = "-remote openURL";
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
package enginuity.net;
|
||||
|
||||
import enginuity.net.BrowserControl;
|
||||
import java.awt.Font;
|
||||
import java.awt.FontMetrics;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.awt.event.MouseListener;
|
||||
import javax.swing.JLabel;
|
||||
|
||||
public class URL extends JLabel implements MouseListener {
|
||||
|
||||
String url = "";
|
||||
|
||||
public URL(String url) {
|
||||
super(url);
|
||||
this.url = url;
|
||||
this.setFont(new Font("Arial", Font.PLAIN, 12));
|
||||
this.addMouseListener(this);
|
||||
}
|
||||
|
||||
public void paint (Graphics g) {
|
||||
super.paint(g);
|
||||
Font f = getFont();
|
||||
FontMetrics fm = getFontMetrics(f);
|
||||
int x1 = 0;
|
||||
int y1 = fm.getHeight();
|
||||
int x2 = fm.stringWidth(getText());
|
||||
if (getText().length() > 0)
|
||||
g.drawLine(x1, y1, x2, y1);
|
||||
}
|
||||
|
||||
public void mouseClicked(MouseEvent e) {
|
||||
BrowserControl.displayURL(url);
|
||||
}
|
||||
|
||||
public void mousePressed(MouseEvent e) { }
|
||||
public void mouseReleased(MouseEvent e) { }
|
||||
public void mouseEntered(MouseEvent e) { }
|
||||
public void mouseExited(MouseEvent e) { }
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
package enginuity.swing;
|
||||
|
||||
import enginuity.maps.Rom;
|
||||
import javax.swing.tree.DefaultMutableTreeNode;
|
||||
|
||||
public class CategoryTreeNode extends DefaultMutableTreeNode {
|
||||
|
||||
private Rom rom;
|
||||
|
||||
public CategoryTreeNode(String name, Rom rom) {
|
||||
super(name);
|
||||
this.setRom(rom);
|
||||
}
|
||||
|
||||
public Rom getRom() {
|
||||
return rom;
|
||||
}
|
||||
|
||||
public void setRom(Rom rom) {
|
||||
this.rom = rom;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
package enginuity.swing;
|
||||
|
||||
import enginuity.net.URL;
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.GridLayout;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.JTextArea;
|
||||
|
||||
public class DebugPanel extends JPanel {
|
||||
|
||||
public DebugPanel(Exception ex, String url) {
|
||||
setLayout(new BorderLayout());
|
||||
|
||||
JPanel top = new JPanel(new GridLayout(7, 1));
|
||||
top.add(new JLabel("Enginuity has encountered an exception. Please review the details below."));
|
||||
top.add(new JLabel("If you are unable to fix this problem please visit the following website"));
|
||||
top.add(new JLabel("and provide these details and the steps that lead to this error."));
|
||||
top.add(new JLabel());
|
||||
top.add(new URL(url));
|
||||
top.add(new JLabel());
|
||||
top.add(new JLabel("Details:"));
|
||||
add(top, BorderLayout.NORTH);
|
||||
|
||||
JTextArea output = new JTextArea(ex.getMessage());
|
||||
add(output, BorderLayout.CENTER);
|
||||
output.setAutoscrolls(true);
|
||||
output.setRows(10);
|
||||
output.setColumns(40);
|
||||
}
|
||||
}
|
|
@ -1,18 +1,18 @@
|
|||
package Enginuity.SwingComponents;
|
||||
package enginuity.swing;
|
||||
|
||||
import Enginuity.*;
|
||||
import Enginuity.DefinitionBuilder.DefinitionBuilder;
|
||||
import Enginuity.XML.RomNotFoundException;
|
||||
import Enginuity.Maps.Rom;
|
||||
import Enginuity.XML.DOMRomUnmarshaller;
|
||||
import enginuity.swing.DebugPanel;
|
||||
import enginuity.swing.ECUImageFilter;
|
||||
import enginuity.swing.RomPropertyPanel;
|
||||
import enginuity.definitionbuilder.DefinitionBuilder;
|
||||
import enginuity.xml.RomNotFoundException;
|
||||
import enginuity.maps.Rom;
|
||||
import enginuity.xml.DOMRomUnmarshaller;
|
||||
import com.sun.org.apache.xerces.internal.parsers.DOMParser;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import javax.management.modelmbean.XMLParseException;
|
||||
import javax.swing.JFileChooser;
|
||||
import javax.swing.JMenu;
|
||||
|
@ -20,9 +20,9 @@ import javax.swing.JMenuBar;
|
|||
import javax.swing.JMenuItem;
|
||||
import javax.swing.JOptionPane;
|
||||
import javax.swing.JSeparator;
|
||||
import enginuity.ECUEditor;
|
||||
import org.w3c.dom.Document;
|
||||
import org.xml.sax.InputSource;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
public class ECUEditorMenuBar extends JMenuBar implements ActionListener {
|
||||
|
||||
|
@ -35,6 +35,7 @@ public class ECUEditorMenuBar extends JMenuBar implements ActionListener {
|
|||
private JMenuItem exit = new JMenuItem("Exit");
|
||||
private JMenu editMenu = new JMenu("Edit");
|
||||
private JMenuItem tableDef = new JMenuItem("Table Definition Generator");
|
||||
private JMenuItem settings = new JMenuItem("Settings");
|
||||
private JMenu viewMenu = new JMenu("View");
|
||||
private JMenuItem romProperties = new JMenuItem("ECU Image Properties");
|
||||
private ECUEditor parent;
|
||||
|
@ -71,8 +72,13 @@ public class ECUEditorMenuBar extends JMenuBar implements ActionListener {
|
|||
add(editMenu);
|
||||
editMenu.setMnemonic('E');
|
||||
tableDef.setMnemonic('T');
|
||||
settings.setMnemonic('S');
|
||||
editMenu.add(tableDef);
|
||||
editMenu.addActionListener(this);
|
||||
editMenu.add(new JSeparator());
|
||||
editMenu.add(settings);
|
||||
tableDef.addActionListener(this);
|
||||
settings.addActionListener(this);
|
||||
|
||||
|
||||
add(viewMenu);
|
||||
viewMenu.setMnemonic('V');
|
||||
|
@ -111,13 +117,15 @@ public class ECUEditorMenuBar extends JMenuBar implements ActionListener {
|
|||
try {
|
||||
this.openImageDialog();
|
||||
} catch (Exception ex) {
|
||||
new JOptionPane().showMessageDialog(parent, ex.getStackTrace(), "Exception", JOptionPane.ERROR_MESSAGE);
|
||||
new JOptionPane().showMessageDialog(parent, new DebugPanel(ex,
|
||||
parent.getSettings().getSupportURL()), "Exception", JOptionPane.ERROR_MESSAGE);
|
||||
}
|
||||
} else if (e.getSource() == saveImage) {
|
||||
try {
|
||||
this.saveImage(parent.getLastSelectedRom());
|
||||
} catch (Exception ex) {
|
||||
new JOptionPane().showMessageDialog(parent, ex.getStackTrace(), "Exception", JOptionPane.ERROR_MESSAGE);
|
||||
new JOptionPane().showMessageDialog(parent, new DebugPanel(ex,
|
||||
parent.getSettings().getSupportURL()), "Exception", JOptionPane.ERROR_MESSAGE);
|
||||
}
|
||||
} else if (e.getSource() == closeImage) {
|
||||
this.closeImage();
|
||||
|
@ -131,15 +139,17 @@ public class ECUEditorMenuBar extends JMenuBar implements ActionListener {
|
|||
} else if (e.getSource() == refreshImage) {
|
||||
try {
|
||||
refreshImage();
|
||||
} catch (Exception ex) {
|
||||
new JOptionPane().showMessageDialog(parent, ex.getStackTrace(), "Exception", JOptionPane.ERROR_MESSAGE);
|
||||
throw new Exception();
|
||||
} catch (Exception ex) {
|
||||
new JOptionPane().showMessageDialog(parent, new DebugPanel(ex,
|
||||
parent.getSettings().getSupportURL()), "Exception", JOptionPane.ERROR_MESSAGE);
|
||||
}
|
||||
} else if (e.getSource() == tableDef) {
|
||||
try {
|
||||
new DefinitionBuilder(parent.getLastSelectedRom(), parent.getSettings().getLastImageDir());
|
||||
} catch (NullPointerException ex) {
|
||||
//new DefinitionBuilder();
|
||||
}
|
||||
new DefinitionBuilder(parent.getLastSelectedRom(), parent.getSettings().getLastImageDir());
|
||||
} else if (e.getSource() == settings) {
|
||||
SettingsForm form = new SettingsForm(parent);
|
||||
form.setLocationRelativeTo(parent);
|
||||
form.setVisible(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -174,9 +184,10 @@ public class ECUEditorMenuBar extends JMenuBar implements ActionListener {
|
|||
FileOutputStream fos = new FileOutputStream(fc.getSelectedFile());
|
||||
fos.write(output);
|
||||
fos.close();
|
||||
fos = null;
|
||||
|
||||
parent.closeImage();
|
||||
openImage(fc.getSelectedFile());
|
||||
parent.getLastSelectedRom().setFullFileName(fc.getSelectedFile().getAbsoluteFile());
|
||||
parent.setLastSelectedRom(parent.getLastSelectedRom());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -197,7 +208,7 @@ public class ECUEditorMenuBar extends JMenuBar implements ActionListener {
|
|||
InputSource src = new InputSource(new FileInputStream(parent.getSettings().getEcuDefinitionFile()));
|
||||
DOMRomUnmarshaller domUms = new DOMRomUnmarshaller();
|
||||
DOMParser parser = new DOMParser();
|
||||
parser.parse(src);
|
||||
parser.parse(src);
|
||||
Document doc = parser.getDocument();
|
||||
FileInputStream fis = new FileInputStream(inputFile);
|
||||
byte[] input = new byte[fis.available()];
|
||||
|
@ -207,7 +218,7 @@ public class ECUEditorMenuBar extends JMenuBar implements ActionListener {
|
|||
Rom rom = domUms.unmarshallXMLDefinition(doc.getDocumentElement(), input);
|
||||
rom.populateTables(input);
|
||||
rom.setFileName(inputFile.getName());
|
||||
|
||||
|
||||
if (rom.getRomID().isObsolete()) {
|
||||
// insert JOptionPane with link to ECU revision wiki here
|
||||
}
|
||||
|
@ -218,7 +229,7 @@ public class ECUEditorMenuBar extends JMenuBar implements ActionListener {
|
|||
} catch (RomNotFoundException ex) {
|
||||
new JOptionPane().showMessageDialog(parent, "ECU Definition Not Found", "Error Loading " + inputFile.getName(), JOptionPane.ERROR_MESSAGE);
|
||||
} catch (StackOverflowError ex) {
|
||||
new JOptionPane().showMessageDialog(parent, "Malformed \"base\" attribute in XML definitions.", "Error Loading ROM", JOptionPane.ERROR_MESSAGE);
|
||||
new JOptionPane().showMessageDialog(parent, "Looped \"base\" attribute in XML definitions.", "Error Loading ROM", JOptionPane.ERROR_MESSAGE);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,6 +1,8 @@
|
|||
package Enginuity.SwingComponents;
|
||||
package enginuity.swing;
|
||||
|
||||
import Enginuity.ECUEditor;
|
||||
import enginuity.swing.DebugPanel;
|
||||
import enginuity.swing.ECUEditorMenuBar;
|
||||
import enginuity.ECUEditor;
|
||||
import java.awt.Color;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.event.ActionEvent;
|
||||
|
@ -73,13 +75,15 @@ public class ECUEditorToolBar extends JToolBar implements ActionListener {
|
|||
try {
|
||||
((ECUEditorMenuBar)parent.getJMenuBar()).openImageDialog();
|
||||
} catch (Exception ex) {
|
||||
new JOptionPane().showMessageDialog(parent, ex.getStackTrace(), "Exception", JOptionPane.ERROR_MESSAGE);
|
||||
new JOptionPane().showMessageDialog(parent, new DebugPanel(ex,
|
||||
parent.getSettings().getSupportURL()), "Exception", JOptionPane.ERROR_MESSAGE);
|
||||
}
|
||||
} else if (e.getSource() == saveImage) {
|
||||
try {
|
||||
((ECUEditorMenuBar)parent.getJMenuBar()).saveImage(parent.getLastSelectedRom());
|
||||
} catch (Exception ex) {
|
||||
new JOptionPane().showMessageDialog(parent, ex.getStackTrace(), "Exception", JOptionPane.ERROR_MESSAGE);
|
||||
new JOptionPane().showMessageDialog(parent, new DebugPanel(ex,
|
||||
parent.getSettings().getSupportURL()), "Exception", JOptionPane.ERROR_MESSAGE);
|
||||
}
|
||||
} else if (e.getSource() == closeImage) {
|
||||
((ECUEditorMenuBar)parent.getJMenuBar()).closeImage();
|
||||
|
@ -87,7 +91,8 @@ public class ECUEditorToolBar extends JToolBar implements ActionListener {
|
|||
try {
|
||||
((ECUEditorMenuBar)parent.getJMenuBar()).refreshImage();
|
||||
} catch (Exception ex) {
|
||||
new JOptionPane().showMessageDialog(parent, ex.getStackTrace(), "Exception", JOptionPane.ERROR_MESSAGE);
|
||||
new JOptionPane().showMessageDialog(parent, new DebugPanel(ex,
|
||||
parent.getSettings().getSupportURL()), "Exception", JOptionPane.ERROR_MESSAGE);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package Enginuity.SwingComponents;
|
||||
package enginuity.swing;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Hashtable;
|
|
@ -1,4 +1,4 @@
|
|||
package Enginuity.SwingComponents;
|
||||
package enginuity.swing;
|
||||
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.MouseEvent;
|
|
@ -1,5 +1,6 @@
|
|||
package Enginuity.SwingComponents;
|
||||
package enginuity.swing;
|
||||
|
||||
import enginuity.swing.MDIDesktopPane;
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.awt.event.*;
|
|
@ -1,6 +1,6 @@
|
|||
package Enginuity.SwingComponents;
|
||||
package enginuity.swing;
|
||||
|
||||
import Enginuity.Maps.Rom;
|
||||
import enginuity.maps.Rom;
|
||||
|
||||
public class RomPropertyPanel extends javax.swing.JPanel {
|
||||
|
|
@ -1,16 +1,12 @@
|
|||
package Enginuity.SwingComponents;
|
||||
package enginuity.swing;
|
||||
|
||||
import Enginuity.*;
|
||||
import enginuity.ECUEditor;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.awt.event.MouseListener;
|
||||
import java.beans.PropertyVetoException;
|
||||
import javax.swing.JTree;
|
||||
import javax.swing.event.TreeSelectionEvent;
|
||||
import javax.swing.event.TreeSelectionListener;
|
||||
import javax.swing.tree.DefaultMutableTreeNode;
|
||||
import javax.swing.tree.TreePath;
|
||||
|
||||
public class RomTree extends JTree implements MouseListener, TreeSelectionListener {
|
||||
public class RomTree extends JTree implements MouseListener {
|
||||
|
||||
private ECUEditor container;
|
||||
|
||||
|
@ -18,7 +14,6 @@ public class RomTree extends JTree implements MouseListener, TreeSelectionListen
|
|||
super(input);
|
||||
this.setRootVisible(false);
|
||||
this.addMouseListener(this);
|
||||
this.addTreeSelectionListener(this);
|
||||
}
|
||||
|
||||
public ECUEditor getContainer() {
|
||||
|
@ -32,33 +27,29 @@ public class RomTree extends JTree implements MouseListener, TreeSelectionListen
|
|||
public void mouseClicked(MouseEvent e) {
|
||||
if (e.getClickCount() == 2) {
|
||||
try {
|
||||
RomTreeNode node = (RomTreeNode)this.getLastSelectedPathComponent();
|
||||
//node.getTable().getFrame().setVisible(true);
|
||||
//node.getTable().getFrame().setSelected(true);
|
||||
TableTreeNode node = (TableTreeNode)this.getLastSelectedPathComponent();
|
||||
container.displayTable(node.getFrame());
|
||||
//} catch (PropertyVetoException ex) {
|
||||
} catch (ClassCastException ex) {
|
||||
} catch (NullPointerException ex) { }
|
||||
} if (e.getClickCount() == 1) {
|
||||
|
||||
|
||||
if (getLastSelectedPathComponent() instanceof TableTreeNode) {
|
||||
TableTreeNode node = (TableTreeNode)this.getLastSelectedPathComponent();
|
||||
container.setLastSelectedRom(node.getTable().getRom());
|
||||
} else if (getLastSelectedPathComponent() instanceof CategoryTreeNode) {
|
||||
CategoryTreeNode node = (CategoryTreeNode)this.getLastSelectedPathComponent();
|
||||
container.setLastSelectedRom(node.getRom());
|
||||
} else if (getLastSelectedPathComponent() instanceof RomTreeNode) {
|
||||
RomTreeNode node = (RomTreeNode)this.getLastSelectedPathComponent();
|
||||
container.setLastSelectedRom(node.getRom());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void mousePressed(MouseEvent e) { }
|
||||
public void mouseReleased(MouseEvent e) { }
|
||||
public void mouseEntered(MouseEvent e) { }
|
||||
public void mouseExited(MouseEvent e) { }
|
||||
|
||||
public void valueChanged(TreeSelectionEvent e) {
|
||||
try {
|
||||
RomTreeNode node = (RomTreeNode)this.getLastSelectedPathComponent();
|
||||
if (node.getRom() != null) {
|
||||
container.setLastSelectedRom(node.getRom());
|
||||
} else if (node.getTable() != null) {
|
||||
container.setLastSelectedRom(node.getTable().getContainer());
|
||||
}
|
||||
} catch (NullPointerException ex) {
|
||||
// node wasn't table or rom (do nothing)
|
||||
} catch (ClassCastException ex) {
|
||||
// node wasn't table or rom (do nothing)
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,59 @@
|
|||
package enginuity.swing;
|
||||
|
||||
import enginuity.maps.Rom;
|
||||
import enginuity.maps.Table;
|
||||
import javax.swing.tree.DefaultMutableTreeNode;
|
||||
|
||||
public class RomTreeNode extends DefaultMutableTreeNode {
|
||||
|
||||
private Rom rom = new Rom();
|
||||
|
||||
public RomTreeNode(Rom rom) {
|
||||
super(rom.getFileName());
|
||||
this.setRom(rom);
|
||||
}
|
||||
|
||||
public void updateFileName() {
|
||||
this.setUserObject(rom.getFileName());
|
||||
}
|
||||
|
||||
public void add(Table table) {
|
||||
boolean categoryExists = false;
|
||||
for (int i = 0; i < this.getChildCount(); i++) {
|
||||
if (this.getChildAt(i).toString().equals(table.getCategory())) {
|
||||
|
||||
TableFrame frame = new TableFrame(table);
|
||||
table.setFrame(frame);
|
||||
TableTreeNode tableNode = new TableTreeNode(table);
|
||||
|
||||
this.getChildAt(i).add(tableNode);
|
||||
categoryExists = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!categoryExists) {
|
||||
this.add(new CategoryTreeNode(table.getCategory(), table.getRom()));
|
||||
|
||||
TableFrame frame = new TableFrame(table);
|
||||
table.setFrame(frame);
|
||||
TableTreeNode tableNode = new TableTreeNode(table);
|
||||
this.getLastChild().add(tableNode);
|
||||
}
|
||||
}
|
||||
|
||||
public DefaultMutableTreeNode getChildAt(int i) {
|
||||
return (DefaultMutableTreeNode)super.getChildAt(i);
|
||||
}
|
||||
|
||||
public DefaultMutableTreeNode getLastChild() {
|
||||
return (DefaultMutableTreeNode)super.getLastChild();
|
||||
}
|
||||
|
||||
public Rom getRom() {
|
||||
return rom;
|
||||
}
|
||||
|
||||
public void setRom(Rom rom) {
|
||||
this.rom = rom;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,455 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<Form version="1.3" type="org.netbeans.modules.form.forminfo.JFrameFormInfo">
|
||||
<Properties>
|
||||
<Property name="defaultCloseOperation" type="int" value="2"/>
|
||||
<Property name="title" type="java.lang.String" value="Enginuity Settings"/>
|
||||
<Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor">
|
||||
<Color id="Default Cursor"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<SyntheticProperties>
|
||||
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
|
||||
</SyntheticProperties>
|
||||
<AuxValues>
|
||||
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
|
||||
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
|
||||
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
|
||||
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
|
||||
</AuxValues>
|
||||
|
||||
<Layout>
|
||||
<DimensionLayout dim="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<EmptySpace min="-2" pref="10" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="lblEcuDef" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Component id="ecuDefinitionFile" min="-2" pref="257" max="-2" attributes="2"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="btnEcuDefinitionBrowse" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</Group>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="calcConflictWarning" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="obsoleteWarning" min="-2" max="-2" attributes="1"/>
|
||||
<Component id="singleTableView" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="debug" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="103" alignment="0" groupAlignment="1" attributes="0">
|
||||
<Component id="lblAxis" alignment="1" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="lblHighlight" alignment="1" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="lblMin" alignment="1" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Component id="lblMax" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="maxColor" alignment="1" min="-2" pref="50" max="-2" attributes="0"/>
|
||||
<Component id="minColor" alignment="1" min="-2" pref="50" max="-2" attributes="0"/>
|
||||
<Component id="highlightColor" alignment="1" min="-2" pref="50" max="-2" attributes="0"/>
|
||||
<Component id="axisColor" alignment="1" min="-2" pref="50" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace min="-2" pref="57" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="lblDecrease" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace min="3" pref="3" max="3" attributes="0"/>
|
||||
<Component id="lblIncrease" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="increaseColor" alignment="0" min="-2" pref="50" max="-2" attributes="0"/>
|
||||
<Component id="decreaseColor" alignment="0" min="-2" pref="50" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<Group type="102" alignment="0" attributes="1">
|
||||
<EmptySpace min="47" pref="47" max="47" attributes="0"/>
|
||||
<Component id="lblBorders" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</Group>
|
||||
<Group type="102" alignment="0" attributes="1">
|
||||
<EmptySpace min="-2" pref="47" max="-2" attributes="0"/>
|
||||
<Component id="lblBackgrounds" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace pref="222" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</Group>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace min="-2" pref="20" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="1" attributes="0">
|
||||
<Component id="lblCellWidth" alignment="1" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="lblCellHeight" alignment="1" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="1" attributes="0">
|
||||
<Group type="103" alignment="1" groupAlignment="0" attributes="0">
|
||||
<Component id="lblCellSize" min="-2" max="-2" attributes="0"/>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace min="10" pref="10" max="10" attributes="0"/>
|
||||
<Component id="cellWidth" min="-2" pref="50" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<Component id="cellHeight" min="-2" pref="50" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<EmptySpace min="-2" pref="133" max="-2" attributes="0"/>
|
||||
<Component id="lblFont" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="-2" pref="23" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<EmptySpace min="-2" pref="87" max="-2" attributes="0"/>
|
||||
<Component id="btnChooseFont" pref="115" max="32767" attributes="0"/>
|
||||
<EmptySpace min="-2" pref="18" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</Group>
|
||||
</Group>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<EmptySpace pref="157" max="32767" attributes="0"/>
|
||||
<Component id="btnApply" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="btnOk" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="btnCancel" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
<DimensionLayout dim="1">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="lblEcuDef" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="btnEcuDefinitionBrowse" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="ecuDefinitionFile" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace min="-2" pref="27" max="-2" attributes="0"/>
|
||||
<Component id="obsoleteWarning" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="calcConflictWarning" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="singleTableView" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="debug" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="-2" pref="31" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Component id="lblBorders" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="increaseColor" alignment="3" min="-2" pref="15" max="-2" attributes="0"/>
|
||||
<Component id="lblIncrease" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="lblDecrease" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="decreaseColor" alignment="3" min="-2" pref="15" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Component id="lblBackgrounds" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="lblMax" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="maxColor" alignment="3" min="-2" pref="15" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="lblMin" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="minColor" alignment="3" min="-2" pref="15" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="lblHighlight" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="highlightColor" alignment="3" min="-2" pref="15" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="lblAxis" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="axisColor" alignment="3" min="-2" pref="15" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</Group>
|
||||
<EmptySpace min="-2" pref="29" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="lblCellSize" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="lblFont" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace min="-2" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="lblCellWidth" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="cellWidth" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="btnChooseFont" alignment="3" pref="29" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="lblCellHeight" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="cellHeight" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace pref="8" max="32767" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="btnCancel" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="btnOk" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="btnApply" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
</Layout>
|
||||
<SubComponents>
|
||||
<Component class="javax.swing.JLabel" name="lblEcuDef">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="ECU Definition File:"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JTextField" name="ecuDefinitionFile">
|
||||
</Component>
|
||||
<Component class="javax.swing.JButton" name="btnEcuDefinitionBrowse">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Browse"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="lblMax">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Maximum Value:"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="lblMin">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Minimum Value:"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="lblHighlight">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Highlighted Cell:"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="lblAxis">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Axis Cell:"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="maxColor">
|
||||
<Properties>
|
||||
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
|
||||
<Color blue="0" green="0" red="ff" type="rgb"/>
|
||||
</Property>
|
||||
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
|
||||
<Border info="org.netbeans.modules.form.compat2.border.LineBorderInfo">
|
||||
<LineBorder/>
|
||||
</Border>
|
||||
</Property>
|
||||
<Property name="opaque" type="boolean" value="true"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="minColor">
|
||||
<Properties>
|
||||
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
|
||||
<Color blue="0" green="0" red="ff" type="rgb"/>
|
||||
</Property>
|
||||
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
|
||||
<Border info="org.netbeans.modules.form.compat2.border.LineBorderInfo">
|
||||
<LineBorder/>
|
||||
</Border>
|
||||
</Property>
|
||||
<Property name="opaque" type="boolean" value="true"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="highlightColor">
|
||||
<Properties>
|
||||
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
|
||||
<Color blue="0" green="0" red="ff" type="rgb"/>
|
||||
</Property>
|
||||
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
|
||||
<Border info="org.netbeans.modules.form.compat2.border.LineBorderInfo">
|
||||
<LineBorder/>
|
||||
</Border>
|
||||
</Property>
|
||||
<Property name="opaque" type="boolean" value="true"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="axisColor">
|
||||
<Properties>
|
||||
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
|
||||
<Color blue="0" green="0" red="ff" type="rgb"/>
|
||||
</Property>
|
||||
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
|
||||
<Border info="org.netbeans.modules.form.compat2.border.LineBorderInfo">
|
||||
<LineBorder/>
|
||||
</Border>
|
||||
</Property>
|
||||
<Property name="opaque" type="boolean" value="true"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="lblIncrease">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Increased Value:"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="lblDecrease">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Decreased Value:"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="lblBackgrounds">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Backgrounds"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="increaseColor">
|
||||
<Properties>
|
||||
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
|
||||
<Color blue="0" green="0" red="ff" type="rgb"/>
|
||||
</Property>
|
||||
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
|
||||
<Border info="org.netbeans.modules.form.compat2.border.LineBorderInfo">
|
||||
<LineBorder/>
|
||||
</Border>
|
||||
</Property>
|
||||
<Property name="opaque" type="boolean" value="true"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JCheckBox" name="obsoleteWarning">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Warn me when opening out of date ECU image revision"/>
|
||||
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
|
||||
<Border info="org.netbeans.modules.form.compat2.border.EmptyBorderInfo">
|
||||
<EmptyBorder bottom="0" left="0" right="0" top="0"/>
|
||||
</Border>
|
||||
</Property>
|
||||
<Property name="margin" type="java.awt.Insets" editor="org.netbeans.beaninfo.editors.InsetsEditor">
|
||||
<Insets value="[0, 0, 0, 0]"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JCheckBox" name="calcConflictWarning">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Warn me when real and byte value calculations conflict"/>
|
||||
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
|
||||
<Border info="org.netbeans.modules.form.compat2.border.EmptyBorderInfo">
|
||||
<EmptyBorder bottom="0" left="0" right="0" top="0"/>
|
||||
</Border>
|
||||
</Property>
|
||||
<Property name="margin" type="java.awt.Insets" editor="org.netbeans.beaninfo.editors.InsetsEditor">
|
||||
<Insets value="[0, 0, 0, 0]"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JCheckBox" name="debug">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Debug mode"/>
|
||||
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
|
||||
<Border info="org.netbeans.modules.form.compat2.border.EmptyBorderInfo">
|
||||
<EmptyBorder bottom="0" left="0" right="0" top="0"/>
|
||||
</Border>
|
||||
</Property>
|
||||
<Property name="enabled" type="boolean" value="false"/>
|
||||
<Property name="margin" type="java.awt.Insets" editor="org.netbeans.beaninfo.editors.InsetsEditor">
|
||||
<Insets value="[0, 0, 0, 0]"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JButton" name="btnCancel">
|
||||
<Properties>
|
||||
<Property name="mnemonic" type="int" value="67"/>
|
||||
<Property name="text" type="java.lang.String" value="Cancel"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JButton" name="btnOk">
|
||||
<Properties>
|
||||
<Property name="mnemonic" type="int" value="79"/>
|
||||
<Property name="text" type="java.lang.String" value="OK"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JButton" name="btnApply">
|
||||
<Properties>
|
||||
<Property name="mnemonic" type="int" value="65"/>
|
||||
<Property name="text" type="java.lang.String" value="Apply"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="decreaseColor">
|
||||
<Properties>
|
||||
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
|
||||
<Color blue="0" green="0" red="ff" type="rgb"/>
|
||||
</Property>
|
||||
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
|
||||
<Border info="org.netbeans.modules.form.compat2.border.LineBorderInfo">
|
||||
<LineBorder/>
|
||||
</Border>
|
||||
</Property>
|
||||
<Property name="opaque" type="boolean" value="true"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="lblBorders">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Borders"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="lblCellSize">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Cell Size"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="lblCellHeight">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Height:"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="lblCellWidth">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Width:"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JTextField" name="cellWidth">
|
||||
</Component>
|
||||
<Component class="javax.swing.JTextField" name="cellHeight">
|
||||
</Component>
|
||||
<Component class="javax.swing.JCheckBox" name="singleTableView">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Open tables in place of existing tables"/>
|
||||
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
|
||||
<Border info="org.netbeans.modules.form.compat2.border.EmptyBorderInfo">
|
||||
<EmptyBorder bottom="0" left="0" right="0" top="0"/>
|
||||
</Border>
|
||||
</Property>
|
||||
<Property name="enabled" type="boolean" value="false"/>
|
||||
<Property name="margin" type="java.awt.Insets" editor="org.netbeans.beaninfo.editors.InsetsEditor">
|
||||
<Insets value="[0, 0, 0, 0]"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="lblFont">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Font"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JButton" name="btnChooseFont">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Choose"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Form>
|
|
@ -0,0 +1,488 @@
|
|||
package enginuity.swing;
|
||||
|
||||
import ZoeloeSoft.projects.JFontChooser.JFontChooser;
|
||||
import enginuity.ECUEditor;
|
||||
import enginuity.Settings;
|
||||
import java.awt.Color;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.awt.event.MouseListener;
|
||||
import java.io.File;
|
||||
import javax.swing.JColorChooser;
|
||||
import javax.swing.JFileChooser;
|
||||
import javax.swing.JFrame;
|
||||
|
||||
public class SettingsForm extends JFrame implements MouseListener {
|
||||
|
||||
Settings settings;
|
||||
ECUEditor parent;
|
||||
|
||||
public SettingsForm(ECUEditor parent) {
|
||||
this.parent = parent;
|
||||
settings = parent.getSettings();
|
||||
initComponents();
|
||||
|
||||
// set field values
|
||||
ecuDefinitionFile.setText(this.settings.getEcuDefinitionFile().getAbsolutePath());
|
||||
|
||||
obsoleteWarning.setSelected(settings.isObsoleteWarning());
|
||||
calcConflictWarning.setSelected(settings.isCalcConflictWarning());
|
||||
singleTableView.setSelected(settings.isSingleTableView());
|
||||
debug.setSelected(settings.isDebug());
|
||||
|
||||
maxColor.setBackground(settings.getMaxColor());
|
||||
minColor.setBackground(settings.getMinColor());
|
||||
highlightColor.setBackground(settings.getHighlightColor());
|
||||
axisColor.setBackground(settings.getAxisColor());
|
||||
increaseColor.setBackground(settings.getIncreaseBorder());
|
||||
decreaseColor.setBackground(settings.getDecreaseBorder());
|
||||
maxColor.addMouseListener(this);
|
||||
minColor.addMouseListener(this);
|
||||
highlightColor.addMouseListener(this);
|
||||
axisColor.addMouseListener(this);
|
||||
increaseColor.addMouseListener(this);
|
||||
decreaseColor.addMouseListener(this);
|
||||
|
||||
cellWidth.setText(((int)settings.getCellSize().getWidth())+"");
|
||||
cellHeight.setText(((int)settings.getCellSize().getHeight())+"");
|
||||
|
||||
btnChooseFont.setFont(settings.getTableFont());
|
||||
btnChooseFont.setText(settings.getTableFont().getFontName());
|
||||
|
||||
btnOk.addMouseListener(this);
|
||||
btnApply.addMouseListener(this);
|
||||
btnCancel.addMouseListener(this);
|
||||
btnEcuDefinitionBrowse.addMouseListener(this);
|
||||
btnChooseFont.addMouseListener(this);
|
||||
}
|
||||
|
||||
// <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
|
||||
private void initComponents() {
|
||||
lblEcuDef = new javax.swing.JLabel();
|
||||
ecuDefinitionFile = new javax.swing.JTextField();
|
||||
btnEcuDefinitionBrowse = new javax.swing.JButton();
|
||||
lblMax = new javax.swing.JLabel();
|
||||
lblMin = new javax.swing.JLabel();
|
||||
lblHighlight = new javax.swing.JLabel();
|
||||
lblAxis = new javax.swing.JLabel();
|
||||
maxColor = new javax.swing.JLabel();
|
||||
minColor = new javax.swing.JLabel();
|
||||
highlightColor = new javax.swing.JLabel();
|
||||
axisColor = new javax.swing.JLabel();
|
||||
lblIncrease = new javax.swing.JLabel();
|
||||
lblDecrease = new javax.swing.JLabel();
|
||||
lblBackgrounds = new javax.swing.JLabel();
|
||||
increaseColor = new javax.swing.JLabel();
|
||||
obsoleteWarning = new javax.swing.JCheckBox();
|
||||
calcConflictWarning = new javax.swing.JCheckBox();
|
||||
debug = new javax.swing.JCheckBox();
|
||||
btnCancel = new javax.swing.JButton();
|
||||
btnOk = new javax.swing.JButton();
|
||||
btnApply = new javax.swing.JButton();
|
||||
decreaseColor = new javax.swing.JLabel();
|
||||
lblBorders = new javax.swing.JLabel();
|
||||
lblCellSize = new javax.swing.JLabel();
|
||||
lblCellHeight = new javax.swing.JLabel();
|
||||
lblCellWidth = new javax.swing.JLabel();
|
||||
cellWidth = new javax.swing.JTextField();
|
||||
cellHeight = new javax.swing.JTextField();
|
||||
singleTableView = new javax.swing.JCheckBox();
|
||||
lblFont = new javax.swing.JLabel();
|
||||
btnChooseFont = new javax.swing.JButton();
|
||||
|
||||
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
|
||||
setTitle("Enginuity Settings");
|
||||
setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
|
||||
lblEcuDef.setText("ECU Definition File:");
|
||||
|
||||
btnEcuDefinitionBrowse.setText("Browse");
|
||||
|
||||
lblMax.setText("Maximum Value:");
|
||||
|
||||
lblMin.setText("Minimum Value:");
|
||||
|
||||
lblHighlight.setText("Highlighted Cell:");
|
||||
|
||||
lblAxis.setText("Axis Cell:");
|
||||
|
||||
maxColor.setBackground(new java.awt.Color(255, 0, 0));
|
||||
maxColor.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
|
||||
maxColor.setOpaque(true);
|
||||
|
||||
minColor.setBackground(new java.awt.Color(255, 0, 0));
|
||||
minColor.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
|
||||
minColor.setOpaque(true);
|
||||
|
||||
highlightColor.setBackground(new java.awt.Color(255, 0, 0));
|
||||
highlightColor.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
|
||||
highlightColor.setOpaque(true);
|
||||
|
||||
axisColor.setBackground(new java.awt.Color(255, 0, 0));
|
||||
axisColor.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
|
||||
axisColor.setOpaque(true);
|
||||
|
||||
lblIncrease.setText("Increased Value:");
|
||||
|
||||
lblDecrease.setText("Decreased Value:");
|
||||
|
||||
lblBackgrounds.setText("Backgrounds");
|
||||
|
||||
increaseColor.setBackground(new java.awt.Color(255, 0, 0));
|
||||
increaseColor.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
|
||||
increaseColor.setOpaque(true);
|
||||
|
||||
obsoleteWarning.setText("Warn me when opening out of date ECU image revision");
|
||||
obsoleteWarning.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
|
||||
obsoleteWarning.setMargin(new java.awt.Insets(0, 0, 0, 0));
|
||||
|
||||
calcConflictWarning.setText("Warn me when real and byte value calculations conflict");
|
||||
calcConflictWarning.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
|
||||
calcConflictWarning.setMargin(new java.awt.Insets(0, 0, 0, 0));
|
||||
|
||||
debug.setText("Debug mode");
|
||||
debug.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
|
||||
debug.setEnabled(false);
|
||||
debug.setMargin(new java.awt.Insets(0, 0, 0, 0));
|
||||
|
||||
btnCancel.setMnemonic('C');
|
||||
btnCancel.setText("Cancel");
|
||||
|
||||
btnOk.setMnemonic('O');
|
||||
btnOk.setText("OK");
|
||||
|
||||
btnApply.setMnemonic('A');
|
||||
btnApply.setText("Apply");
|
||||
|
||||
decreaseColor.setBackground(new java.awt.Color(255, 0, 0));
|
||||
decreaseColor.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
|
||||
decreaseColor.setOpaque(true);
|
||||
|
||||
lblBorders.setText("Borders");
|
||||
|
||||
lblCellSize.setText("Cell Size");
|
||||
|
||||
lblCellHeight.setText("Height:");
|
||||
|
||||
lblCellWidth.setText("Width:");
|
||||
|
||||
singleTableView.setText("Open tables in place of existing tables");
|
||||
singleTableView.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
|
||||
singleTableView.setEnabled(false);
|
||||
singleTableView.setMargin(new java.awt.Insets(0, 0, 0, 0));
|
||||
|
||||
lblFont.setText("Font");
|
||||
|
||||
btnChooseFont.setText("Choose");
|
||||
|
||||
org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
|
||||
getContentPane().setLayout(layout);
|
||||
layout.setHorizontalGroup(
|
||||
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
|
||||
.add(layout.createSequentialGroup()
|
||||
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
|
||||
.add(layout.createSequentialGroup()
|
||||
.add(10, 10, 10)
|
||||
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
|
||||
.add(lblEcuDef)
|
||||
.add(layout.createSequentialGroup()
|
||||
.add(ecuDefinitionFile, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 257, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
|
||||
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
|
||||
.add(btnEcuDefinitionBrowse))))
|
||||
.add(layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
|
||||
.add(calcConflictWarning)
|
||||
.add(obsoleteWarning)
|
||||
.add(singleTableView)
|
||||
.add(debug)))
|
||||
.add(layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
|
||||
.add(layout.createSequentialGroup()
|
||||
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
|
||||
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
|
||||
.add(lblAxis)
|
||||
.add(lblHighlight)
|
||||
.add(lblMin))
|
||||
.add(lblMax))
|
||||
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
|
||||
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
|
||||
.add(org.jdesktop.layout.GroupLayout.TRAILING, maxColor, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 50, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
|
||||
.add(org.jdesktop.layout.GroupLayout.TRAILING, minColor, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 50, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
|
||||
.add(org.jdesktop.layout.GroupLayout.TRAILING, highlightColor, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 50, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
|
||||
.add(org.jdesktop.layout.GroupLayout.TRAILING, axisColor, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 50, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
|
||||
.add(57, 57, 57)
|
||||
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
|
||||
.add(layout.createSequentialGroup()
|
||||
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
|
||||
.add(lblDecrease)
|
||||
.add(layout.createSequentialGroup()
|
||||
.add(3, 3, 3)
|
||||
.add(lblIncrease)))
|
||||
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
|
||||
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
|
||||
.add(increaseColor, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 50, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
|
||||
.add(decreaseColor, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 50, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
|
||||
.add(layout.createSequentialGroup()
|
||||
.add(47, 47, 47)
|
||||
.add(lblBorders))))
|
||||
.add(layout.createSequentialGroup()
|
||||
.add(47, 47, 47)
|
||||
.add(lblBackgrounds)
|
||||
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 222, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))))
|
||||
.add(layout.createSequentialGroup()
|
||||
.add(20, 20, 20)
|
||||
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
|
||||
.add(lblCellWidth)
|
||||
.add(lblCellHeight))
|
||||
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
|
||||
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
|
||||
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
|
||||
.add(lblCellSize)
|
||||
.add(layout.createSequentialGroup()
|
||||
.add(10, 10, 10)
|
||||
.add(cellWidth, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 50, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
|
||||
.add(cellHeight, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 50, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
|
||||
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
|
||||
.add(layout.createSequentialGroup()
|
||||
.add(133, 133, 133)
|
||||
.add(lblFont)
|
||||
.add(23, 23, 23))
|
||||
.add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
|
||||
.add(87, 87, 87)
|
||||
.add(btnChooseFont, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 115, Short.MAX_VALUE)
|
||||
.add(18, 18, 18)))))
|
||||
.addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
.add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
|
||||
.addContainerGap(157, Short.MAX_VALUE)
|
||||
.add(btnApply)
|
||||
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
|
||||
.add(btnOk)
|
||||
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
|
||||
.add(btnCancel)
|
||||
.addContainerGap())
|
||||
);
|
||||
layout.setVerticalGroup(
|
||||
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
|
||||
.add(layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.add(lblEcuDef)
|
||||
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
|
||||
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
|
||||
.add(btnEcuDefinitionBrowse)
|
||||
.add(ecuDefinitionFile, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
|
||||
.add(27, 27, 27)
|
||||
.add(obsoleteWarning)
|
||||
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
|
||||
.add(calcConflictWarning)
|
||||
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
|
||||
.add(singleTableView)
|
||||
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
|
||||
.add(debug)
|
||||
.add(31, 31, 31)
|
||||
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
|
||||
.add(layout.createSequentialGroup()
|
||||
.add(lblBorders)
|
||||
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
|
||||
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
|
||||
.add(increaseColor, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 15, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
|
||||
.add(lblIncrease))
|
||||
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
|
||||
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
|
||||
.add(lblDecrease)
|
||||
.add(decreaseColor, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 15, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
|
||||
.add(layout.createSequentialGroup()
|
||||
.add(lblBackgrounds)
|
||||
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
|
||||
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
|
||||
.add(lblMax)
|
||||
.add(maxColor, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 15, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
|
||||
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
|
||||
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
|
||||
.add(lblMin)
|
||||
.add(minColor, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 15, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
|
||||
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
|
||||
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
|
||||
.add(lblHighlight)
|
||||
.add(highlightColor, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 15, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
|
||||
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
|
||||
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
|
||||
.add(lblAxis)
|
||||
.add(axisColor, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 15, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))))
|
||||
.add(29, 29, 29)
|
||||
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
|
||||
.add(lblCellSize)
|
||||
.add(lblFont))
|
||||
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
|
||||
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
|
||||
.add(lblCellWidth)
|
||||
.add(cellWidth, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
|
||||
.add(btnChooseFont, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 29, Short.MAX_VALUE))
|
||||
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
|
||||
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
|
||||
.add(lblCellHeight)
|
||||
.add(cellHeight, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
|
||||
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 8, Short.MAX_VALUE)
|
||||
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
|
||||
.add(btnCancel)
|
||||
.add(btnOk)
|
||||
.add(btnApply))
|
||||
.addContainerGap())
|
||||
);
|
||||
pack();
|
||||
}// </editor-fold>//GEN-END:initComponents
|
||||
|
||||
public void mouseClicked(MouseEvent e) {
|
||||
if (e.getSource() == maxColor) {
|
||||
JColorChooser chooser = new JColorChooser();
|
||||
Color color = chooser.showDialog(this.getContentPane(), "Background Color", settings.getMaxColor());
|
||||
|
||||
if (color != null) {
|
||||
maxColor.setBackground(color);
|
||||
}
|
||||
|
||||
} else if (e.getSource() == minColor) {
|
||||
JColorChooser chooser = new JColorChooser();
|
||||
Color color = chooser.showDialog(this.getContentPane(), "Background Color", settings.getMinColor());
|
||||
|
||||
if (color != null) {
|
||||
minColor.setBackground(color);
|
||||
}
|
||||
|
||||
} else if (e.getSource() == highlightColor) {
|
||||
JColorChooser chooser = new JColorChooser();
|
||||
Color color = chooser.showDialog(this.getContentPane(), "Background Color", settings.getHighlightColor());
|
||||
|
||||
if (color != null) {
|
||||
highlightColor.setBackground(color);
|
||||
}
|
||||
|
||||
} else if (e.getSource() == axisColor) {
|
||||
JColorChooser chooser = new JColorChooser();
|
||||
Color color = chooser.showDialog(this.getContentPane(), "Background Color", settings.getAxisColor());
|
||||
|
||||
if (color != null) {
|
||||
axisColor.setBackground(color);
|
||||
}
|
||||
|
||||
} else if (e.getSource() == increaseColor) {
|
||||
JColorChooser chooser = new JColorChooser();
|
||||
Color color = chooser.showDialog(this.getContentPane(), "Background Color", settings.getIncreaseBorder());
|
||||
|
||||
if (color != null) {
|
||||
increaseColor.setBackground(color);
|
||||
}
|
||||
|
||||
} else if (e.getSource() == decreaseColor) {
|
||||
JColorChooser chooser = new JColorChooser();
|
||||
Color color = chooser.showDialog(this.getContentPane(), "Background Color", settings.getDecreaseBorder());
|
||||
|
||||
if (color != null) {
|
||||
decreaseColor.setBackground(color);
|
||||
}
|
||||
|
||||
} else if (e.getSource() == btnApply) {
|
||||
applySettings();
|
||||
|
||||
} else if (e.getSource() == btnOk) {
|
||||
applySettings();
|
||||
this.dispose();
|
||||
|
||||
} else if (e.getSource() == btnCancel) {
|
||||
this.dispose();
|
||||
|
||||
} else if (e.getSource() == btnEcuDefinitionBrowse) {
|
||||
JFileChooser fc = new JFileChooser(new File(ecuDefinitionFile.getText()));
|
||||
fc.setFileFilter(new XMLFilter());
|
||||
|
||||
if (fc.showOpenDialog(this) == fc.APPROVE_OPTION) {
|
||||
ecuDefinitionFile.setText(fc.getSelectedFile().getAbsolutePath());
|
||||
}
|
||||
|
||||
} else if (e.getSource() == btnChooseFont) {
|
||||
JFontChooser fc = new JFontChooser(this);
|
||||
fc.setLocationRelativeTo(this);
|
||||
if (fc.showDialog(settings.getTableFont()) == fc.OK_OPTION) {
|
||||
btnChooseFont.setFont(fc.getFont());
|
||||
btnChooseFont.setText(fc.getFont().getFontName());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public void applySettings() {
|
||||
try {
|
||||
Integer.parseInt(cellHeight.getText());
|
||||
} catch (NumberFormatException ex) {
|
||||
//number formatted imporperly, reset
|
||||
cellHeight.setText((int)(settings.getCellSize().getHeight())+"");
|
||||
}
|
||||
try {
|
||||
Integer.parseInt(cellWidth.getText());
|
||||
} catch (NumberFormatException ex) {
|
||||
//number formatted imporperly, reset
|
||||
cellWidth.setText((int)(settings.getCellSize().getWidth())+"");
|
||||
}
|
||||
|
||||
settings.addEcuDefinitionFile(new File(ecuDefinitionFile.getText()));
|
||||
|
||||
settings.setObsoleteWarning(obsoleteWarning.isSelected());
|
||||
settings.setCalcConflictWarning(calcConflictWarning.isSelected());
|
||||
settings.setSingleTableView(singleTableView.isSelected());
|
||||
settings.setDebug(debug.isSelected());
|
||||
|
||||
settings.setMaxColor(maxColor.getBackground());
|
||||
settings.setMinColor(minColor.getBackground());
|
||||
settings.setHighlightColor(highlightColor.getBackground());
|
||||
settings.setAxisColor(axisColor.getBackground());
|
||||
settings.setIncreaseBorder(increaseColor.getBackground());
|
||||
settings.setDecreaseBorder(decreaseColor.getBackground());
|
||||
|
||||
settings.setCellSize(new Dimension(Integer.parseInt(cellWidth.getText()),
|
||||
Integer.parseInt(cellHeight.getText())));
|
||||
|
||||
settings.setTableFont(btnChooseFont.getFont());
|
||||
|
||||
parent.setSettings(settings);
|
||||
}
|
||||
|
||||
public void mousePressed(MouseEvent e) { }
|
||||
public void mouseReleased(MouseEvent e) { }
|
||||
public void mouseEntered(MouseEvent e) { }
|
||||
public void mouseExited(MouseEvent e) { }
|
||||
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private javax.swing.JLabel axisColor;
|
||||
private javax.swing.JButton btnApply;
|
||||
private javax.swing.JButton btnCancel;
|
||||
private javax.swing.JButton btnChooseFont;
|
||||
private javax.swing.JButton btnEcuDefinitionBrowse;
|
||||
private javax.swing.JButton btnOk;
|
||||
private javax.swing.JCheckBox calcConflictWarning;
|
||||
private javax.swing.JTextField cellHeight;
|
||||
private javax.swing.JTextField cellWidth;
|
||||
private javax.swing.JCheckBox debug;
|
||||
private javax.swing.JLabel decreaseColor;
|
||||
private javax.swing.JTextField ecuDefinitionFile;
|
||||
private javax.swing.JLabel highlightColor;
|
||||
private javax.swing.JLabel increaseColor;
|
||||
private javax.swing.JLabel lblAxis;
|
||||
private javax.swing.JLabel lblBackgrounds;
|
||||
private javax.swing.JLabel lblBorders;
|
||||
private javax.swing.JLabel lblCellHeight;
|
||||
private javax.swing.JLabel lblCellSize;
|
||||
private javax.swing.JLabel lblCellWidth;
|
||||
private javax.swing.JLabel lblDecrease;
|
||||
private javax.swing.JLabel lblEcuDef;
|
||||
private javax.swing.JLabel lblFont;
|
||||
private javax.swing.JLabel lblHighlight;
|
||||
private javax.swing.JLabel lblIncrease;
|
||||
private javax.swing.JLabel lblMax;
|
||||
private javax.swing.JLabel lblMin;
|
||||
private javax.swing.JLabel maxColor;
|
||||
private javax.swing.JLabel minColor;
|
||||
private javax.swing.JCheckBox obsoleteWarning;
|
||||
private javax.swing.JCheckBox singleTableView;
|
||||
// End of variables declaration//GEN-END:variables
|
||||
|
||||
}
|
|
@ -1,6 +1,8 @@
|
|||
package Enginuity.SwingComponents;
|
||||
package enginuity.swing;
|
||||
|
||||
import Enginuity.Maps.Table;
|
||||
import enginuity.swing.TableMenuBar;
|
||||
import enginuity.swing.TableToolBar;
|
||||
import enginuity.maps.Table;
|
||||
import java.awt.BorderLayout;
|
||||
import javax.swing.BorderFactory;
|
||||
import javax.swing.JInternalFrame;
|
||||
|
@ -13,7 +15,7 @@ public class TableFrame extends JInternalFrame implements InternalFrameListener
|
|||
private TableToolBar toolBar;
|
||||
|
||||
public TableFrame(Table table) {
|
||||
super(table.getContainer().getFileName() + " - " + table.getName(), true, true);
|
||||
super(table.getRom().getFileName() + " - " + table.getName(), true, true);
|
||||
this.setTable(table);
|
||||
this.add(table);
|
||||
this.setFrameIcon(null);
|
||||
|
@ -24,8 +26,7 @@ public class TableFrame extends JInternalFrame implements InternalFrameListener
|
|||
this.setJMenuBar(new TableMenuBar(table));
|
||||
this.setDefaultCloseOperation(this.HIDE_ON_CLOSE);
|
||||
table.setFrame(this);
|
||||
this.addInternalFrameListener(this);
|
||||
|
||||
this.addInternalFrameListener(this);
|
||||
}
|
||||
|
||||
public TableToolBar getToolBar() {
|
||||
|
@ -33,13 +34,13 @@ public class TableFrame extends JInternalFrame implements InternalFrameListener
|
|||
}
|
||||
|
||||
public void internalFrameActivated(InternalFrameEvent e) {
|
||||
getTable().getContainer().getContainer().setLastSelectedRom(getTable().getContainer());
|
||||
getTable().getRom().getContainer().setLastSelectedRom(getTable().getRom());
|
||||
}
|
||||
|
||||
|
||||
public void internalFrameOpened(InternalFrameEvent e) { }
|
||||
public void internalFrameClosing(InternalFrameEvent e) {
|
||||
getTable().getContainer().getContainer().removeDisplayTable(this);
|
||||
getTable().getRom().getContainer().removeDisplayTable(this);
|
||||
}
|
||||
public void internalFrameClosed(InternalFrameEvent e) { }
|
||||
public void internalFrameIconified(InternalFrameEvent e) { }
|
|
@ -1,7 +1,7 @@
|
|||
package Enginuity.SwingComponents;
|
||||
package enginuity.swing;
|
||||
|
||||
import Enginuity.Maps.Table;
|
||||
import Enginuity.Maps.Table3D;
|
||||
import enginuity.maps.Table;
|
||||
import enginuity.maps.Table3D;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import javax.swing.JMenu;
|
|
@ -1,6 +1,6 @@
|
|||
package Enginuity.SwingComponents;
|
||||
package enginuity.swing;
|
||||
|
||||
import Enginuity.Maps.Table;
|
||||
import enginuity.maps.Table;
|
||||
|
||||
public class TablePropertyPanel extends javax.swing.JPanel {
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
package Enginuity.SwingComponents;
|
||||
package enginuity.swing;
|
||||
|
||||
import Enginuity.Maps.Table;
|
||||
import enginuity.swing.TableFrame;
|
||||
import enginuity.maps.Table;
|
||||
import java.awt.Color;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.event.ActionEvent;
|
|
@ -1,10 +1,10 @@
|
|||
package Enginuity.SwingComponents;
|
||||
package enginuity.swing;
|
||||
|
||||
import Enginuity.Maps.Rom;
|
||||
import Enginuity.Maps.Table;
|
||||
import enginuity.maps.Rom;
|
||||
import enginuity.maps.Table;
|
||||
import javax.swing.tree.DefaultMutableTreeNode;
|
||||
|
||||
public class RomTreeNode extends DefaultMutableTreeNode {
|
||||
public class TableTreeNode extends DefaultMutableTreeNode {
|
||||
|
||||
private String type;
|
||||
private Rom rom;
|
||||
|
@ -12,14 +12,10 @@ public class RomTreeNode extends DefaultMutableTreeNode {
|
|||
private String toolTip;
|
||||
private TableFrame frame;
|
||||
|
||||
public RomTreeNode(Rom rom) {
|
||||
super(rom.getFileName());
|
||||
this.rom = rom;
|
||||
}
|
||||
|
||||
public RomTreeNode(Table table) {
|
||||
public TableTreeNode(Table table) {
|
||||
super(table.getName() + " (" + table.getType() + "D)");
|
||||
this.table = table;
|
||||
this.frame = table.getFrame();
|
||||
}
|
||||
|
||||
public String getType() {
|
|
@ -1,4 +1,4 @@
|
|||
package Enginuity.SwingComponents;
|
||||
package enginuity.swing;
|
||||
|
||||
import java.awt.*;
|
||||
import javax.swing.*;
|
|
@ -0,0 +1,90 @@
|
|||
package enginuity.swing;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Hashtable;
|
||||
import java.util.Enumeration;
|
||||
import javax.swing.*;
|
||||
import javax.swing.filechooser.*;
|
||||
|
||||
public class XMLFilter extends FileFilter {
|
||||
|
||||
private static String TYPE_UNKNOWN = "Type Unknown";
|
||||
private static String HIDDEN_FILE = "Hidden File";
|
||||
|
||||
private Hashtable filters = null;
|
||||
private String description = null;
|
||||
private String fullDescription = null;
|
||||
private boolean useExtensionsInDescription = true;
|
||||
|
||||
public XMLFilter() {
|
||||
this.filters = new Hashtable();
|
||||
this.addExtension("xml");
|
||||
this.setDescription("ECU Definition Files");
|
||||
}
|
||||
|
||||
public boolean accept(File f) {
|
||||
if(f != null) {
|
||||
if(f.isDirectory()) {
|
||||
return true;
|
||||
}
|
||||
String extension = getExtension(f);
|
||||
if(extension != null && filters.get(getExtension(f)) != null) {
|
||||
return true;
|
||||
};
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public String getExtension(File f) {
|
||||
if(f != null) {
|
||||
String filename = f.getName();
|
||||
int i = filename.lastIndexOf('.');
|
||||
if(i>0 && i<filename.length()-1) {
|
||||
return filename.substring(i+1).toLowerCase();
|
||||
};
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public void addExtension(String extension) {
|
||||
if(filters == null) {
|
||||
filters = new Hashtable(5);
|
||||
}
|
||||
filters.put(extension.toLowerCase(), this);
|
||||
fullDescription = null;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
if(fullDescription == null) {
|
||||
if(description == null || isExtensionListInDescription()) {
|
||||
fullDescription = description==null ? "(" : description + " (";
|
||||
// build the description from the extension list
|
||||
Enumeration extensions = filters.keys();
|
||||
if(extensions != null) {
|
||||
fullDescription += "." + (String) extensions.nextElement();
|
||||
while (extensions.hasMoreElements()) {
|
||||
fullDescription += ", ." + (String) extensions.nextElement();
|
||||
}
|
||||
}
|
||||
fullDescription += ")";
|
||||
} else {
|
||||
fullDescription = description;
|
||||
}
|
||||
}
|
||||
return fullDescription;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
fullDescription = null;
|
||||
}
|
||||
|
||||
public void setExtensionListInDescription(boolean b) {
|
||||
useExtensionsInDescription = b;
|
||||
fullDescription = null;
|
||||
}
|
||||
|
||||
public boolean isExtensionListInDescription() {
|
||||
return useExtensionsInDescription;
|
||||
}
|
||||
}
|
|
@ -1,8 +1,8 @@
|
|||
//DOM XML parser for ROMs
|
||||
|
||||
package Enginuity.XML;
|
||||
package enginuity.xml;
|
||||
|
||||
import Enginuity.Maps.*;
|
||||
import enginuity.maps.*;
|
||||
import javax.management.modelmbean.XMLParseException;
|
||||
import org.w3c.dom.Node;
|
||||
import org.w3c.dom.NodeList;
|
||||
|
@ -67,7 +67,7 @@ public class DOMRomUnmarshaller {
|
|||
|
||||
try {
|
||||
table = unmarshallTable(n, table, rom);
|
||||
table.setContainer(rom);
|
||||
table.setRom(rom);
|
||||
rom.addTable(table);
|
||||
} catch (TableIsOmittedException ex) { // table is not supported in inherited def (skip)
|
||||
rom.removeTable(table.getName());
|
||||
|
@ -97,6 +97,7 @@ public class DOMRomUnmarshaller {
|
|||
RomID romID = unmarshallRomID(n2, new RomID());
|
||||
if (romID.getXmlid().equalsIgnoreCase(xmlID)) {
|
||||
Rom returnrom = unmarshallRom(n, rom);
|
||||
returnrom.getRomID().setObsolete(false);
|
||||
return returnrom;
|
||||
}
|
||||
}
|
||||
|
@ -109,12 +110,12 @@ public class DOMRomUnmarshaller {
|
|||
public RomID unmarshallRomID (Node romIDNode, RomID romID) {
|
||||
Node n;
|
||||
NodeList nodes = romIDNode.getChildNodes();
|
||||
|
||||
|
||||
for (int i=0; i < nodes.getLength(); i++){
|
||||
n = nodes.item(i);
|
||||
|
||||
if (n.getNodeType() == Node.ELEMENT_NODE) {
|
||||
|
||||
|
||||
if (n.getNodeName().equalsIgnoreCase("xmlid")){
|
||||
romID.setXmlid(unmarshallText(n));
|
||||
} else if (n.getNodeName().equalsIgnoreCase("internalidaddress")) {
|
||||
|
@ -192,7 +193,7 @@ public class DOMRomUnmarshaller {
|
|||
throw new XMLParseException();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
table.setName(unmarshallAttribute(tableNode, "name", table.getName()));
|
||||
table.setType(RomAttributeParser.parseTableType(unmarshallAttribute(tableNode, "type", table.getType())));
|
||||
if (unmarshallAttribute(tableNode, "beforeram", "false").equalsIgnoreCase("true")) table.setBeforeRam(true);
|
||||
|
@ -210,7 +211,7 @@ public class DOMRomUnmarshaller {
|
|||
table.setStorageType(RomAttributeParser.parseStorageType(unmarshallAttribute(tableNode, "storagetype", table.getStorageType())));
|
||||
table.setEndian(RomAttributeParser.parseEndian(unmarshallAttribute(tableNode, "endian", table.getEndian())));
|
||||
table.setStorageAddress(RomAttributeParser.parseHexString(unmarshallAttribute(tableNode, "storageaddress", table.getStorageAddress())));
|
||||
table.setDescription(unmarshallAttribute(tableNode, "description", table.getDescription()));
|
||||
//table.setDescription(unmarshallAttribute(tableNode, "description", table.getDescription()));
|
||||
table.setDataSize(Integer.parseInt(unmarshallAttribute(tableNode, "sizey", unmarshallAttribute(tableNode, "sizex", table.getDataSize()))));
|
||||
table.setFlip(Boolean.parseBoolean(unmarshallAttribute(tableNode, "flipy", unmarshallAttribute(tableNode, "flipx", table.getFlip()+""))));
|
||||
|
||||
|
@ -258,7 +259,7 @@ public class DOMRomUnmarshaller {
|
|||
tempTable.setData(((Table3D)table).getYAxis().getData());
|
||||
tempTable.setAxisParent(table);
|
||||
((Table3D)table).setYAxis(tempTable);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (n.getNodeName().equalsIgnoreCase("scaling")) {
|
||||
table.setScale(unmarshallScale(n, table.getScale()));
|
||||
|
@ -268,6 +269,8 @@ public class DOMRomUnmarshaller {
|
|||
dataCell.setDisplayValue(unmarshallText(n));
|
||||
dataCell.setTable(table);
|
||||
((Table1D)table).addStaticDataCell(dataCell);
|
||||
} else if (n.getNodeName().equalsIgnoreCase("description")) {
|
||||
table.setDescription(unmarshallText(n));
|
||||
} else { /*unexpected element in Table (skip) */ }
|
||||
} else { /* unexpected node-type in Table (skip) */ }
|
||||
}
|
|
@ -0,0 +1,176 @@
|
|||
package enginuity.xml;
|
||||
|
||||
import com.sun.org.apache.xml.internal.serialize.OutputFormat;
|
||||
import com.sun.org.apache.xml.internal.serialize.XMLSerializer;
|
||||
import enginuity.Settings;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import javax.imageio.metadata.IIOMetadataNode;
|
||||
|
||||
public class DOMSettingsBuilder {
|
||||
|
||||
public void buildSettings (Settings settings, File output) throws IOException {
|
||||
|
||||
IIOMetadataNode settingsNode = new IIOMetadataNode("settings");
|
||||
|
||||
// create settings
|
||||
settingsNode.appendChild(buildWindow(settings));
|
||||
settingsNode.appendChild(buildURLs(settings));
|
||||
settingsNode.appendChild(buildFiles(settings));
|
||||
settingsNode.appendChild(buildOptions(settings));
|
||||
settingsNode.appendChild(buildTableDisplay(settings));
|
||||
|
||||
OutputFormat of = new OutputFormat("XML","ISO-8859-1",true);
|
||||
of.setIndent(1);
|
||||
of.setIndenting(true);
|
||||
|
||||
FileOutputStream fos = new FileOutputStream(output);
|
||||
XMLSerializer serializer = new XMLSerializer(fos,of);
|
||||
serializer.serialize(settingsNode);
|
||||
fos.flush();
|
||||
fos.close();
|
||||
}
|
||||
|
||||
public IIOMetadataNode buildWindow(Settings settings) {
|
||||
IIOMetadataNode windowSettings = new IIOMetadataNode("window");
|
||||
|
||||
// window size
|
||||
IIOMetadataNode size = new IIOMetadataNode("size");
|
||||
size.setAttribute("x", ((int)settings.getWindowSize().getHeight())+"");
|
||||
size.setAttribute("y", ((int)settings.getWindowSize().getWidth())+"");
|
||||
windowSettings.appendChild(size);
|
||||
|
||||
// window location
|
||||
IIOMetadataNode location = new IIOMetadataNode("location");
|
||||
location.setAttribute("x", ((int)settings.getWindowLocation().getX())+"");
|
||||
location.setAttribute("y", ((int)settings.getWindowLocation().getY())+"");
|
||||
windowSettings.appendChild(location);
|
||||
|
||||
// splitpane location
|
||||
IIOMetadataNode splitpane = new IIOMetadataNode("splitpane");
|
||||
splitpane.setAttribute("location", settings.getSplitPaneLocation()+"");
|
||||
windowSettings.appendChild(splitpane);
|
||||
|
||||
return windowSettings;
|
||||
}
|
||||
|
||||
public IIOMetadataNode buildURLs(Settings settings) {
|
||||
IIOMetadataNode urls = new IIOMetadataNode("urls");
|
||||
|
||||
// rom revision url
|
||||
IIOMetadataNode romRevision = new IIOMetadataNode("romrevision");
|
||||
romRevision.setAttribute("url", settings.getRomRevisionURL());
|
||||
urls.appendChild(romRevision);
|
||||
|
||||
// support url
|
||||
IIOMetadataNode support = new IIOMetadataNode("support");
|
||||
support.setAttribute("url", settings.getSupportURL());
|
||||
urls.appendChild(support);
|
||||
|
||||
return urls;
|
||||
}
|
||||
|
||||
public IIOMetadataNode buildFiles(Settings settings) {
|
||||
IIOMetadataNode files = new IIOMetadataNode("files");
|
||||
|
||||
// image directory
|
||||
IIOMetadataNode imageDir = new IIOMetadataNode("image_dir");
|
||||
imageDir.setAttribute("path", settings.getLastImageDir().getAbsolutePath());
|
||||
files.appendChild(imageDir);
|
||||
|
||||
// ecu definition files
|
||||
// need to code this again after allowing more
|
||||
IIOMetadataNode ecuDef = new IIOMetadataNode("ecudefinitionfile");
|
||||
ecuDef.setAttribute("name", settings.getEcuDefinitionFile().getAbsolutePath());
|
||||
files.appendChild(ecuDef);
|
||||
|
||||
return files;
|
||||
}
|
||||
|
||||
public IIOMetadataNode buildOptions(Settings settings) {
|
||||
IIOMetadataNode options = new IIOMetadataNode("options");
|
||||
|
||||
// obsolete warning
|
||||
IIOMetadataNode obsoleteWarning = new IIOMetadataNode("obsoletewarning");
|
||||
obsoleteWarning.setAttribute("value", settings.isObsoleteWarning()+"");
|
||||
options.appendChild(obsoleteWarning);
|
||||
|
||||
// calcultion conflicting warning
|
||||
IIOMetadataNode calcConflictWarning = new IIOMetadataNode("calcconflictwarning");
|
||||
calcConflictWarning.setAttribute("value", settings.isCalcConflictWarning()+"");
|
||||
options.appendChild(calcConflictWarning);
|
||||
|
||||
// debug mode
|
||||
IIOMetadataNode debug = new IIOMetadataNode("debug");
|
||||
debug.setAttribute("value", settings.isDebug()+"");
|
||||
options.appendChild(debug);
|
||||
|
||||
return options;
|
||||
}
|
||||
|
||||
public IIOMetadataNode buildTableDisplay(Settings settings) {
|
||||
IIOMetadataNode tableDisplay = new IIOMetadataNode("tabledisplay");
|
||||
|
||||
// font
|
||||
IIOMetadataNode font = new IIOMetadataNode("font");
|
||||
font.setAttribute("face", settings.getTableFont().getName());
|
||||
font.setAttribute("size", settings.getTableFont().getSize()+"");
|
||||
font.setAttribute("decoration", settings.getTableFont().getStyle()+"");
|
||||
tableDisplay.appendChild(font);
|
||||
|
||||
// table cell size
|
||||
IIOMetadataNode cellSize = new IIOMetadataNode("cellsize");
|
||||
cellSize.setAttribute("height", ((int)settings.getCellSize().getHeight())+"");
|
||||
cellSize.setAttribute("width", ((int)settings.getCellSize().getWidth())+"");
|
||||
tableDisplay.appendChild(cellSize);
|
||||
|
||||
// colors
|
||||
IIOMetadataNode colors = new IIOMetadataNode("colors");
|
||||
// max
|
||||
IIOMetadataNode max = new IIOMetadataNode("max");
|
||||
max.setAttribute("r", settings.getMaxColor().getRed()+"");
|
||||
max.setAttribute("g", settings.getMaxColor().getGreen()+"");
|
||||
max.setAttribute("b", settings.getMaxColor().getBlue()+"");
|
||||
colors.appendChild(max);
|
||||
// min
|
||||
IIOMetadataNode min = new IIOMetadataNode("min");
|
||||
min.setAttribute("r", settings.getMinColor().getRed()+"");
|
||||
min.setAttribute("g", settings.getMinColor().getGreen()+"");
|
||||
min.setAttribute("b", settings.getMinColor().getBlue()+"");
|
||||
colors.appendChild(min);
|
||||
// highlight
|
||||
IIOMetadataNode highlight = new IIOMetadataNode("highlight");
|
||||
highlight.setAttribute("r", settings.getHighlightColor().getRed()+"");
|
||||
highlight.setAttribute("g", settings.getHighlightColor().getGreen()+"");
|
||||
highlight.setAttribute("b", settings.getHighlightColor().getBlue()+"");
|
||||
colors.appendChild(highlight);
|
||||
// increased cell border
|
||||
IIOMetadataNode increaseBorder = new IIOMetadataNode("increaseborder");
|
||||
increaseBorder.setAttribute("r", settings.getIncreaseBorder().getRed()+"");
|
||||
increaseBorder.setAttribute("g", settings.getIncreaseBorder().getGreen()+"");
|
||||
increaseBorder.setAttribute("b", settings.getIncreaseBorder().getBlue()+"");
|
||||
colors.appendChild(increaseBorder);
|
||||
// decreased cell border
|
||||
IIOMetadataNode decreaseBorder = new IIOMetadataNode("decreaseborder");
|
||||
decreaseBorder.setAttribute("r", settings.getDecreaseBorder().getRed()+"");
|
||||
decreaseBorder.setAttribute("g", settings.getDecreaseBorder().getGreen()+"");
|
||||
decreaseBorder.setAttribute("b", settings.getDecreaseBorder().getBlue()+"");
|
||||
colors.appendChild(decreaseBorder);
|
||||
// axis cells
|
||||
IIOMetadataNode axis = new IIOMetadataNode("decreaseborder");
|
||||
axis.setAttribute("r", settings.getAxisColor().getRed()+"");
|
||||
axis.setAttribute("g", settings.getAxisColor().getGreen()+"");
|
||||
axis.setAttribute("b", settings.getAxisColor().getBlue()+"");
|
||||
colors.appendChild(axis);
|
||||
|
||||
tableDisplay.appendChild(colors);
|
||||
|
||||
// single table view
|
||||
IIOMetadataNode singleTable = new IIOMetadataNode("singletableview");
|
||||
singleTable.setAttribute("value", settings.isSingleTableView()+"");
|
||||
tableDisplay.appendChild(singleTable);
|
||||
|
||||
return tableDisplay;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,211 @@
|
|||
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;
|
||||
|
||||
public class DOMSettingsUnmarshaller {
|
||||
|
||||
public Settings unmarshallSettings (Node rootNode) {
|
||||
Settings settings = new Settings();
|
||||
Node n;
|
||||
NodeList nodes = rootNode.getChildNodes();
|
||||
|
||||
for (int i = 0; i < nodes.getLength(); i++) {
|
||||
n = nodes.item(i);
|
||||
|
||||
if (n.getNodeType() == Node.ELEMENT_NODE && n.getNodeName().equalsIgnoreCase("window")) {
|
||||
settings = unmarshallWindow(n, settings);
|
||||
} else if (n.getNodeType() == Node.ELEMENT_NODE && n.getNodeName().equalsIgnoreCase("urls")) {
|
||||
settings = unmarshallURLs(n, settings);
|
||||
} else if (n.getNodeType() == Node.ELEMENT_NODE && n.getNodeName().equalsIgnoreCase("options")) {
|
||||
settings = unmarshallOptions(n, settings);
|
||||
} else if (n.getNodeType() == Node.ELEMENT_NODE && n.getNodeName().equalsIgnoreCase("tabledisplay")) {
|
||||
settings = unmarshallTableDisplay(n, settings);
|
||||
}
|
||||
}
|
||||
return settings;
|
||||
}
|
||||
|
||||
|
||||
public Settings unmarshallWindow (Node windowNode, Settings settings) {
|
||||
Node n;
|
||||
NodeList nodes = windowNode.getChildNodes();
|
||||
|
||||
for (int i = 0; i < nodes.getLength(); i++) {
|
||||
n = nodes.item(i);
|
||||
|
||||
if (n.getNodeType() == Node.ELEMENT_NODE && n.getNodeName().equalsIgnoreCase("size")) {
|
||||
settings.setWindowSize(new Dimension(unmarshallAttribute(n, "y", 600),
|
||||
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)));
|
||||
|
||||
} else if (n.getNodeType() == Node.ELEMENT_NODE && n.getNodeName().equalsIgnoreCase("splitpane")) {
|
||||
settings.setSplitPaneLocation(unmarshallAttribute(n, "location", 150));
|
||||
|
||||
}
|
||||
}
|
||||
return settings;
|
||||
}
|
||||
|
||||
public Settings unmarshallURLs (Node urlNode, Settings settings) {
|
||||
Node n;
|
||||
NodeList nodes = urlNode.getChildNodes();
|
||||
|
||||
for (int i = 0; i < nodes.getLength(); i++) {
|
||||
n = nodes.item(i);
|
||||
|
||||
if (n.getNodeType() == Node.ELEMENT_NODE && n.getNodeName().equalsIgnoreCase("romrevision")) {
|
||||
settings.setRomRevisionURL(unmarshallAttribute(n, "url",
|
||||
"http://www.scoobypedia.co.uk/index.php/Knowledge/ECUVersionCompatibilityList"));
|
||||
} else if (n.getNodeType() == Node.ELEMENT_NODE && n.getNodeName().equalsIgnoreCase("support")) {
|
||||
settings.setSupportURL(unmarshallAttribute(n, "url", "http://www.enginuity.org"));
|
||||
}
|
||||
}
|
||||
return settings;
|
||||
}
|
||||
|
||||
public Settings unmarshallFiles (Node urlNode, Settings settings) {
|
||||
Node n;
|
||||
NodeList nodes = urlNode.getChildNodes();
|
||||
|
||||
for (int i = 0; i < nodes.getLength(); i++) {
|
||||
n = nodes.item(i);
|
||||
|
||||
if (n.getNodeType() == Node.ELEMENT_NODE && n.getNodeName().equalsIgnoreCase("ecudefinitionfile")) {
|
||||
settings.addEcuDefinitionFile(new File(unmarshallText(n)));
|
||||
} else if (n.getNodeType() == Node.ELEMENT_NODE && n.getNodeName().equalsIgnoreCase("image_dir")) {
|
||||
settings.setLastImageDir(new File(unmarshallText(n)));
|
||||
}
|
||||
}
|
||||
return settings;
|
||||
}
|
||||
|
||||
public Settings unmarshallOptions (Node optionNode, Settings settings) {
|
||||
Node n;
|
||||
NodeList nodes = optionNode.getChildNodes();
|
||||
|
||||
for (int i = 0; i < nodes.getLength(); i++) {
|
||||
n = nodes.item(i);
|
||||
|
||||
if (n.getNodeType() == Node.ELEMENT_NODE && n.getNodeName().equalsIgnoreCase("obsoletewarning")) {
|
||||
settings.setObsoleteWarning(Boolean.parseBoolean(unmarshallAttribute(n, "value", "true")));
|
||||
|
||||
} else if (n.getNodeType() == Node.ELEMENT_NODE && n.getNodeName().equalsIgnoreCase("debug")) {
|
||||
settings.setDebug(Boolean.parseBoolean(unmarshallAttribute(n, "value", "true")));
|
||||
|
||||
} else if (n.getNodeType() == Node.ELEMENT_NODE && n.getNodeName().equalsIgnoreCase("calcconflictwarning")) {
|
||||
settings.setCalcConflictWarning(Boolean.parseBoolean(unmarshallAttribute(n, "value", "true")));
|
||||
}
|
||||
}
|
||||
return settings;
|
||||
}
|
||||
|
||||
public Settings unmarshallTableDisplay (Node tableDisplayNode, Settings settings) {
|
||||
Node n;
|
||||
NodeList nodes = tableDisplayNode.getChildNodes();
|
||||
|
||||
for (int i = 0; i < nodes.getLength(); i++) {
|
||||
n = nodes.item(i);
|
||||
|
||||
if (n.getNodeType() == Node.ELEMENT_NODE && n.getNodeName().equalsIgnoreCase("font")) {
|
||||
settings.setTableFont(new Font(unmarshallAttribute(n, "face", "Arial"),
|
||||
unmarshallAttribute(n, "decoration", Font.BOLD),
|
||||
unmarshallAttribute(n, "size", 12)));
|
||||
|
||||
} else if (n.getNodeType() == Node.ELEMENT_NODE && n.getNodeName().equalsIgnoreCase("cellsize")) {
|
||||
settings.setCellSize(new Dimension(unmarshallAttribute(n, "x", 42),
|
||||
unmarshallAttribute(n, "y", 18)));
|
||||
|
||||
} else if (n.getNodeType() == Node.ELEMENT_NODE && n.getNodeName().equalsIgnoreCase("color")) {
|
||||
settings = unmarshallColors(n, settings);
|
||||
|
||||
} else if (n.getNodeType() == Node.ELEMENT_NODE && n.getNodeName().equalsIgnoreCase("singletableview")) {
|
||||
settings.setDebug(unmarshallAttribute(n, "value", true));
|
||||
|
||||
}
|
||||
}
|
||||
return settings;
|
||||
}
|
||||
|
||||
public Settings unmarshallColors(Node colorNode, Settings settings) {
|
||||
Node n;
|
||||
NodeList nodes = colorNode.getChildNodes();
|
||||
|
||||
for (int i = 0; i < nodes.getLength(); i++) {
|
||||
n = nodes.item(i);
|
||||
|
||||
if (n.getNodeType() == Node.ELEMENT_NODE && n.getNodeName().equalsIgnoreCase("max")) {
|
||||
settings.setMaxColor(unmarshallColor(n));
|
||||
} else if (n.getNodeType() == Node.ELEMENT_NODE && n.getNodeName().equalsIgnoreCase("min")) {
|
||||
settings.setMinColor(unmarshallColor(n));
|
||||
} else if (n.getNodeType() == Node.ELEMENT_NODE && n.getNodeName().equalsIgnoreCase("highlight")) {
|
||||
settings.setHighlightColor(unmarshallColor(n));
|
||||
} else if (n.getNodeType() == Node.ELEMENT_NODE && n.getNodeName().equalsIgnoreCase("increaseborder")) {
|
||||
settings.setIncreaseBorder(unmarshallColor(n));
|
||||
} else if (n.getNodeType() == Node.ELEMENT_NODE && n.getNodeName().equalsIgnoreCase("decreaseborder")) {
|
||||
settings.setDecreaseBorder(unmarshallColor(n));
|
||||
} else if (n.getNodeType() == Node.ELEMENT_NODE && n.getNodeName().equalsIgnoreCase("axiscolor")) {
|
||||
settings.setAxisColor(unmarshallColor(n));
|
||||
}
|
||||
}
|
||||
return settings;
|
||||
}
|
||||
|
||||
public Color unmarshallColor(Node colorNode) {
|
||||
return new Color(unmarshallAttribute(colorNode, "r", 155),
|
||||
unmarshallAttribute(colorNode, "g", 155),
|
||||
unmarshallAttribute(colorNode, "b", 155));
|
||||
}
|
||||
|
||||
private String unmarshallText(Node textNode) {
|
||||
StringBuffer buf = new StringBuffer();
|
||||
|
||||
Node n;
|
||||
NodeList nodes = textNode.getChildNodes();
|
||||
|
||||
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)
|
||||
}
|
||||
}
|
||||
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 Double unmarshallAttribute(Node node, String name, double defaultValue) {
|
||||
return Double.parseDouble(unmarshallAttribute(node, name, defaultValue+""));
|
||||
}
|
||||
|
||||
private int unmarshallAttribute(Node node, String name, int defaultValue) {
|
||||
return Integer.parseInt(unmarshallAttribute(node, name, defaultValue+""));
|
||||
}
|
||||
|
||||
private boolean unmarshallAttribute(Node node, String name, boolean defaultValue) {
|
||||
return Boolean.parseBoolean(unmarshallAttribute(node, name, defaultValue+""));
|
||||
}
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package Enginuity.XML;
|
||||
package enginuity.xml;
|
||||
|
||||
import java.io.*;
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
// Parses attributes from ROM XML
|
||||
|
||||
package Enginuity.XML;
|
||||
package enginuity.xml;
|
||||
|
||||
import Enginuity.Maps.Table;
|
||||
import Enginuity.Maps.Scale;
|
||||
import enginuity.maps.Table;
|
||||
import enginuity.maps.Scale;
|
||||
|
||||
public abstract class RomAttributeParser {
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package Enginuity.XML;
|
||||
package enginuity.xml;
|
||||
|
||||
public class RomNotFoundException extends Exception {
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package Enginuity.XML;
|
||||
package enginuity.xml;
|
||||
|
||||
public class TableIsOmittedException extends Exception {
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
package enginuity.xml;
|
||||
|
||||
public class TableNotFoundException extends Exception { }
|
Loading…
Reference in New Issue