mirror of https://github.com/rusefi/RomRaider.git
Final changes
This commit is contained in:
parent
e0b9545162
commit
7ae56ea61d
|
@ -28,6 +28,7 @@ import org.apache.log4j.Logger;
|
|||
|
||||
import com.romraider.Settings;
|
||||
import com.romraider.Settings.Endian;
|
||||
import com.romraider.editor.ecu.ECUEditorManager;
|
||||
import com.romraider.util.ByteUtil;
|
||||
import com.romraider.util.JEPUtil;
|
||||
import com.romraider.util.NumberUtil;
|
||||
|
@ -292,7 +293,10 @@ public class DataCell {
|
|||
if(!table.isStaticDataTable() && this.isSelected != selected) {
|
||||
this.isSelected = selected;
|
||||
|
||||
if(view!=null) view.drawCell();
|
||||
if(view!=null) {
|
||||
ECUEditorManager.getECUEditor().getTableToolBar().updateTableToolBar(table);
|
||||
view.drawCell();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -311,11 +311,13 @@ public class Rom extends DefaultMutableTreeNode implements Serializable {
|
|||
}
|
||||
|
||||
//Most of this function is useless now, since each Datacell is now responsible for each memory region
|
||||
//It is only used in the Switch Tables, since those don't use DataCells
|
||||
//It is only used to correct the Subaru Checksum. Should be moved somewhere else TODO
|
||||
public byte[] saveFile() {
|
||||
|
||||
final List<TableTreeNode> checksumTables = new ArrayList<TableTreeNode>();
|
||||
for (TableTreeNode tableNode : tableNodes) {
|
||||
|
||||
//Only used in BitwiseSwitch Table...
|
||||
tableNode.getTable().saveFile(binData);
|
||||
if (tableNode.getTable().getName().contains("Checksum Fix")) {
|
||||
checksumTables.add(tableNode);
|
||||
|
|
|
@ -27,9 +27,7 @@ import javax.naming.NameNotFoundException;
|
|||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.romraider.Settings;
|
||||
import com.romraider.editor.ecu.ECUEditorManager;
|
||||
import com.romraider.swing.TableFrame;
|
||||
import com.romraider.swing.TableToolBar;
|
||||
import com.romraider.util.ByteUtil;
|
||||
import com.romraider.util.JEPUtil;
|
||||
import com.romraider.util.NumberUtil;
|
||||
|
@ -610,24 +608,14 @@ public abstract class Table implements Serializable {
|
|||
if(y >= 0 && y < data.length) {
|
||||
clearSelection();
|
||||
data[y].setSelected(true);
|
||||
if(tableView!=null) tableView.highlightY = y;
|
||||
|
||||
TableToolBar bar = ECUEditorManager.getECUEditor().getTableToolBar();
|
||||
|
||||
if(bar!=null)
|
||||
bar.updateTableToolBar(this);
|
||||
if(tableView!=null) tableView.highlightY = y;
|
||||
}
|
||||
}
|
||||
|
||||
public void selectCellAtWithoutClear(int y) {
|
||||
if(y >= 0 && y < data.length) {
|
||||
data[y].setSelected(true);
|
||||
if(tableView!=null)tableView.highlightY = y;
|
||||
|
||||
TableToolBar bar = ECUEditorManager.getECUEditor().getTableToolBar();
|
||||
|
||||
if(bar!=null)
|
||||
bar.updateTableToolBar(this);
|
||||
if(tableView!=null)tableView.highlightY = y;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -94,11 +94,7 @@ public class Table2D extends Table {
|
|||
|
||||
|
||||
@Override
|
||||
public byte[] saveFile(byte[] binData) {
|
||||
/*
|
||||
binData = super.saveFile(binData);
|
||||
binData = axis.saveFile(binData);*/
|
||||
|
||||
public byte[] saveFile(byte[] binData) {
|
||||
return binData;
|
||||
}
|
||||
|
||||
|
|
|
@ -48,9 +48,11 @@ public class TableBitwiseSwitchView extends TableView {
|
|||
|
||||
public TableBitwiseSwitchView(TableBitwiseSwitch table) {
|
||||
super(table);
|
||||
this.table = table;
|
||||
removeAll();
|
||||
setLayout(new BorderLayout());
|
||||
checkboxes = new ArrayList<JCheckBox>();
|
||||
populateTableVisual();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -22,6 +22,7 @@ package com.romraider.maps;
|
|||
public class TableSwitchView extends Table1DView {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
//Same as a Table1DView just hidden data
|
||||
public TableSwitchView(TableSwitch t) {
|
||||
super(t, true);
|
||||
}
|
||||
|
|
|
@ -532,6 +532,15 @@ public class ECUEditorMenuBar extends JMenuBar implements ActionListener {
|
|||
if (fc.showSaveDialog(parent) == JFileChooser.APPROVE_OPTION) {
|
||||
File selectedFile = fc.getSelectedFile();
|
||||
|
||||
//Append suffix if user didn't set anything
|
||||
if(!selectedFile.getName().contains(".")) {
|
||||
Rom lastSelectedRom = ECUEditorManager.getECUEditor().getLastSelectedRom();
|
||||
String lastFile = lastSelectedRom.getFileName().toLowerCase();
|
||||
String format = ".bin";
|
||||
if(lastFile.endsWith(".hex")) format=".hex";
|
||||
selectedFile = new File(selectedFile + format);
|
||||
}
|
||||
|
||||
if (selectedFile.exists()) {
|
||||
int option = showConfirmDialog(parent,
|
||||
MessageFormat.format(
|
||||
|
@ -543,16 +552,7 @@ public class ECUEditorMenuBar extends JMenuBar implements ActionListener {
|
|||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
//Append suffix if user didnt set anything
|
||||
if(!selectedFile.getName().contains(".")) {
|
||||
Rom lastSelectedRom = ECUEditorManager.getECUEditor().getLastSelectedRom();
|
||||
String lastFile = lastSelectedRom.getFileName().toLowerCase();
|
||||
String format = ".bin";
|
||||
if(lastFile.endsWith(".hex")) format=".hex";
|
||||
selectedFile = new File(selectedFile + format);
|
||||
}
|
||||
|
||||
|
||||
return selectedFile;
|
||||
}
|
||||
return null;
|
||||
|
|
Loading…
Reference in New Issue