mirror of https://github.com/rusefi/RomRaider.git
- Fixed unhandled exception when user hits ctrl+ENTER with no data or bad data in the multiply text field.
- Changed variable from foo to tableFrame. I find that tableFrame is more descriptive. - Added ability to use space as well as enter to open the selected table. Using space seems to retain the selected table where enter instead shifts focus to the top level ROM node.
This commit is contained in:
parent
e327afd360
commit
baa2aa8867
|
@ -88,8 +88,8 @@ public class MDIDesktopPane extends JDesktopPane {
|
||||||
}
|
}
|
||||||
moveToFront(frame);
|
moveToFront(frame);
|
||||||
frame.setVisible(true);
|
frame.setVisible(true);
|
||||||
TableFrame foo = (TableFrame) frame;
|
TableFrame tableFrame = (TableFrame) frame;
|
||||||
parent.updateTableToolBar(foo.getTable(), true);
|
parent.updateTableToolBar(tableFrame.getTable(), true);
|
||||||
try {
|
try {
|
||||||
frame.setSelected(true);
|
frame.setSelected(true);
|
||||||
} catch (PropertyVetoException e) {
|
} catch (PropertyVetoException e) {
|
||||||
|
|
|
@ -49,10 +49,7 @@ public class RomTree extends JTree implements MouseListener {
|
||||||
setFont(new Font("Tahoma", Font.PLAIN, 11));
|
setFont(new Font("Tahoma", Font.PLAIN, 11));
|
||||||
|
|
||||||
// key binding actions
|
// key binding actions
|
||||||
Action enterAction = new AbstractAction() {
|
Action tableSelectAction = new AbstractAction() {
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
private static final long serialVersionUID = -6008026264821746092L;
|
private static final long serialVersionUID = -6008026264821746092L;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -66,7 +63,9 @@ public class RomTree extends JTree implements MouseListener {
|
||||||
};
|
};
|
||||||
|
|
||||||
this.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "enter");
|
this.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "enter");
|
||||||
this.getActionMap().put("enter", enterAction);
|
this.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_SPACE, 0), "space");
|
||||||
|
this.getActionMap().put("enter", tableSelectAction);
|
||||||
|
this.getActionMap().put("space", tableSelectAction);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ECUEditor getEditor() {
|
public ECUEditor getEditor() {
|
||||||
|
@ -97,13 +96,12 @@ public class RomTree extends JTree implements MouseListener {
|
||||||
editor.displayTable(node.getFrame());
|
editor.displayTable(node.getFrame());
|
||||||
}
|
}
|
||||||
setLastSelectedRom(selectedRow);
|
setLastSelectedRom(selectedRow);
|
||||||
editor.getEditorMenuBar().updateMenu();
|
|
||||||
editor.getToolBar().updateButtons();
|
|
||||||
} catch (NullPointerException ex) {
|
} catch (NullPointerException ex) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setLastSelectedRom(Object selectedNode) {
|
private void setLastSelectedRom(Object selectedNode) {
|
||||||
|
TreePath selectedPath = getSelectionPath();
|
||||||
if (selectedNode instanceof TableTreeNode || selectedNode instanceof CategoryTreeNode || selectedNode instanceof RomTreeNode)
|
if (selectedNode instanceof TableTreeNode || selectedNode instanceof CategoryTreeNode || selectedNode instanceof RomTreeNode)
|
||||||
{
|
{
|
||||||
Object lastSelectedPathComponent = getLastSelectedPathComponent();
|
Object lastSelectedPathComponent = getLastSelectedPathComponent();
|
||||||
|
|
|
@ -183,9 +183,6 @@ public class TableToolBar extends JToolBar implements MouseListener, ItemListene
|
||||||
|
|
||||||
// key binding actions
|
// key binding actions
|
||||||
Action enterAction = new AbstractAction() {
|
Action enterAction = new AbstractAction() {
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
private static final long serialVersionUID = -6008026264821746092L;
|
private static final long serialVersionUID = -6008026264821746092L;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -366,7 +363,11 @@ public class TableToolBar extends JToolBar implements MouseListener, ItemListene
|
||||||
}
|
}
|
||||||
|
|
||||||
public void multiply() {
|
public void multiply() {
|
||||||
|
try{
|
||||||
table.multiply(Double.parseDouble(setValueText.getText()));
|
table.multiply(Double.parseDouble(setValueText.getText()));
|
||||||
|
}catch(NumberFormatException nex) {
|
||||||
|
// Do Nothing. setValueText is null or not a valid double.
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void incrementFine() {
|
public void incrementFine() {
|
||||||
|
|
Loading…
Reference in New Issue