Added ECU definition update link, reorganized menu bar

git-svn-id: http://svn.3splooges.com/romraider-arch/trunk@321 d2e2e1cd-ba16-0410-be16-b7c4453c7c2d
This commit is contained in:
Jared Gould 2006-11-02 02:40:52 +00:00
parent b232f65861
commit a1fc9a78de
3 changed files with 107 additions and 84 deletions

View File

@ -43,8 +43,8 @@ public class ECUEditor extends JFrame implements WindowListener, PropertyChangeL
private RomTreeRootNode imageRoot = new RomTreeRootNode("Open Images");
private RomTree imageList = new RomTree(imageRoot);
private Settings settings = new Settings();
private String version = "0.3.2 Beta";
private String versionDate = "8/12/2006";
private String version = "0.4.0 Beta";
private String versionDate = "11/03/2006";
private String titleText = "Enginuity v" + version;
public MDIDesktopPane rightPanel = new MDIDesktopPane();
private Rom lastSelectedRom = null;

View File

@ -6,17 +6,18 @@ 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 ecuDefsURL = "http://www.enginuity.org/viewtopic.php?t=360";
private String supportURL = "http://www.enginuity.org";
private String releaseNotes = "release notes.txt";
private String recentVersion = "x";
private Vector<File> ecuDefinitionFiles = new Vector<File>();
private File lastImageDir = new File("images");
private boolean obsoleteWarning = true;
@ -26,7 +27,7 @@ public class Settings implements Serializable {
private boolean saveDebugTables = false;
private boolean displayHighTables = true;
private boolean valueLimitWarning = true;
private Font tableFont = new Font("Arial", Font.BOLD, 12);
private Dimension cellSize = new Dimension(42, 18);
private Color maxColor = new Color(255, 102, 102);
@ -37,42 +38,42 @@ public class Settings implements Serializable {
private Color axisColor = new Color(255, 255, 255);
private Color warningColor = new Color(255, 0, 0);
private int tableClickCount = 1; // number of clicks to open table
private String loggerPort = "COM4";
private String loggerProtocol = "SSM";
private String loggerConfigFilePath = "./logger.xml";
private String loggerProfileFilePath = "./profile.xml";
private File loggerOutputDir = new File(".");
private Dimension loggerWindowSize = new Dimension(1000, 600);
private Point loggerWindowLocation = new Point();
private boolean loggerWindowMaximized = false;
public Settings() {
//center window by default
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 Vector<File> getEcuDefinitionFiles() {
if (ecuDefinitionFiles.isEmpty()) {
// if no files defined, add default
@ -80,139 +81,139 @@ public class Settings implements Serializable {
}
return ecuDefinitionFiles;
}
public void addEcuDefinitionFile(File ecuDefinitionFile) {
ecuDefinitionFiles.add(ecuDefinitionFile);
}
public void setEcuDefinitionFiles(Vector<File> ecuDefinitionFiles) {
this.ecuDefinitionFiles = ecuDefinitionFiles;
}
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 String getSupportURL() {
return 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 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;
}
public int getUserLevel() {
return userLevel;
}
public void setUserLevel(int userLevel) {
if (userLevel > 5) {
this.userLevel = 5;
@ -222,108 +223,116 @@ public class Settings implements Serializable {
this.userLevel = userLevel;
}
}
public int getTableClickCount() {
return tableClickCount;
}
public void setTableClickCount(int tableClickCount) {
this.tableClickCount = tableClickCount;
}
public String getRecentVersion() {
return recentVersion;
}
public void setRecentVersion(String recentVersion) {
this.recentVersion = recentVersion;
}
public String getReleaseNotes() {
return releaseNotes;
}
public boolean isSaveDebugTables() {
return saveDebugTables;
}
public void setSaveDebugTables(boolean saveDebugTables) {
this.saveDebugTables = saveDebugTables;
}
public boolean isDisplayHighTables() {
return displayHighTables;
}
public void setDisplayHighTables(boolean displayHighTables) {
this.displayHighTables = displayHighTables;
}
public boolean isValueLimitWarning() {
return valueLimitWarning;
}
public void setValueLimitWarning(boolean valueLimitWarning) {
this.valueLimitWarning = valueLimitWarning;
}
public Color getWarningColor() {
return warningColor;
}
public void setWarningColor(Color warningColor) {
this.warningColor = warningColor;
}
public String getLoggerPort() {
return loggerPort;
}
public void setLoggerPort(String loggerPort) {
this.loggerPort = loggerPort;
}
public String getLoggerProtocol() {
return loggerProtocol;
}
public String getLoggerConfigFilePath() {
return loggerConfigFilePath;
}
public File getLoggerOutputDir() {
return loggerOutputDir;
}
public Point getLoggerWindowLocation() {
return loggerWindowLocation;
}
public void setLoggerWindowLocation(Point loggerWindowLocation) {
this.loggerWindowLocation = loggerWindowLocation;
}
public boolean isLoggerWindowMaximized() {
return loggerWindowMaximized;
}
public void setLoggerWindowMaximized(boolean loggerWindowMaximized) {
this.loggerWindowMaximized = loggerWindowMaximized;
}
public Dimension getLoggerWindowSize() {
return loggerWindowSize;
}
public void setLoggerWindowSize(Dimension loggerWindowSize) {
this.loggerWindowSize = loggerWindowSize;
}
public String getLoggerProfileFilePath() {
return loggerProfileFilePath;
}
public void setLoggerProfileFilePath(String loggerProfileFilePath) {
this.loggerProfileFilePath = loggerProfileFilePath;
}
public String getEcuDefsURL() {
return ecuDefsURL;
}
public void setEcuDefsURL(String ecuDefsURL) {
this.ecuDefsURL = ecuDefsURL;
}
}

View File

@ -1,5 +1,6 @@
package enginuity.swing;
import com.centerkey.utils.BareBonesBrowserLaunch;
import enginuity.ECUEditor;
import enginuity.definitions.DefinitionEditor;
import enginuity.logger.EcuLogger;
@ -23,10 +24,13 @@ public class ECUEditorMenuBar extends JMenuBar implements ActionListener {
private JMenuItem closeAll = new JMenuItem("Close All Images");
private JMenuItem exit = new JMenuItem("Exit");
private JMenu editMenu = new JMenu("Edit");
private JMenu definitionMenu = new JMenu("ECU Definitions");
private JMenuItem defManager = new JMenuItem("ECU Definition Manager");
private JMenuItem settings = new JMenuItem("Settings");
private JMenuItem editDefinition = new JMenuItem("Edit ECU Definitions");
private JMenuItem updateDefinition = new JMenuItem("Update ECU Definitions");
private JMenu editMenu = new JMenu("Edit");
private JMenuItem settings = new JMenuItem("Enginuity Settings");
private JMenu viewMenu = new JMenu("View");
private JMenuItem romProperties = new JMenuItem("ECU Image Properties");
@ -74,20 +78,26 @@ public class ECUEditorMenuBar extends JMenuBar implements ActionListener {
closeImage.addActionListener(this);
closeAll.addActionListener(this);
exit.addActionListener(this);
// edit menu items
add(editMenu);
editMenu.setMnemonic('E');
editMenu.add(settings);
settings.addActionListener(this);
// ecu def menu items
add(definitionMenu);
definitionMenu.setMnemonic('D');
defManager.setMnemonic('D');
editDefinition.setMnemonic('E');
updateDefinition.setMnemonic('U');
settings.setMnemonic('S');
editMenu.add(defManager);
editMenu.add(editDefinition);
editMenu.add(new JSeparator());
editMenu.add(settings);
definitionMenu.add(defManager);
definitionMenu.add(editDefinition);
definitionMenu.add(updateDefinition);
defManager.addActionListener(this);
editDefinition.addActionListener(this);
settings.addActionListener(this);
updateDefinition.addActionListener(this);
// view menu items
add(viewMenu);
@ -246,6 +256,10 @@ public class ECUEditorMenuBar extends JMenuBar implements ActionListener {
} else if (e.getSource() == openLogger) {
EcuLogger.startLogger(DISPOSE_ON_CLOSE, parent.getSettings());
} else if (e.getSource() == updateDefinition) {
BareBonesBrowserLaunch.openURL(
parent.getSettings().getEcuDefsURL());
}
}