mirror of https://github.com/rusefi/RomRaider.git
improve table type handling
- return correct type - fix error on table properties
This commit is contained in:
parent
4e30af5940
commit
798cb43830
|
@ -33,6 +33,7 @@ import javax.swing.JPanel;
|
||||||
import javax.swing.JTextArea;
|
import javax.swing.JTextArea;
|
||||||
|
|
||||||
import com.romraider.Settings;
|
import com.romraider.Settings;
|
||||||
|
import com.romraider.maps.Table.TableType;
|
||||||
import com.romraider.util.ByteUtil;
|
import com.romraider.util.ByteUtil;
|
||||||
|
|
||||||
import static com.romraider.util.ByteUtil.isBitSet;
|
import static com.romraider.util.ByteUtil.isBitSet;
|
||||||
|
@ -46,7 +47,6 @@ public class TableBitwiseSwitch extends Table {
|
||||||
public TableBitwiseSwitch() {
|
public TableBitwiseSwitch() {
|
||||||
super();
|
super();
|
||||||
storageType = 1;
|
storageType = 1;
|
||||||
type = Settings.TABLE_SWITCH;
|
|
||||||
removeAll();
|
removeAll();
|
||||||
setLayout(new BorderLayout());
|
setLayout(new BorderLayout());
|
||||||
checkboxes = new ArrayList<JCheckBox>();
|
checkboxes = new ArrayList<JCheckBox>();
|
||||||
|
@ -72,8 +72,8 @@ public class TableBitwiseSwitch extends Table {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getType() {
|
public TableType getType() {
|
||||||
return Settings.TABLE_SWITCH;
|
return Table.TableType.SWITCH;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -48,8 +48,10 @@ public class TablePropertyPanel extends javax.swing.JPanel {
|
||||||
if (Table.TableType.SWITCH == table.getType()) {
|
if (Table.TableType.SWITCH == table.getType()) {
|
||||||
dim = 1;
|
dim = 1;
|
||||||
storageSize.setText("switch");
|
storageSize.setText("switch");
|
||||||
scrollPane.setViewportView(populateScalesTable(
|
if(table.getClass() == TableSwitch.class) {
|
||||||
((TableSwitch) table).getSwitchStates()));
|
scrollPane.setViewportView(populateScalesTable(
|
||||||
|
((TableSwitch) table).getSwitchStates()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (Settings.STORAGE_TYPE_FLOAT == table.getStorageType()) {
|
if (Settings.STORAGE_TYPE_FLOAT == table.getStorageType()) {
|
||||||
|
|
Loading…
Reference in New Issue