Faster refresh of memory window

This commit is contained in:
Seth Morabito committed 2014-07-06 12:17:39 -07:00
1 parent a7ea60d250
commit 40c5397ed8
2 files changed
+18 -6

No files matched your search

@@ -190,14 +190,14 @@ public class MemoryWindow extends JFrame implements ActionListener {
if (currentPage > 0x00) {
setPageNumber(currentPage - 1);
updateControls();
memoryTable.updateUI();
updateState();
}
} else if (e.getSource() == nextPageButton) {
int currentPage = getPageNumber();
if (currentPage < 0xff) {
setPageNumber(currentPage + 1);
updateControls();
memoryTable.updateUI();
updateState();
}
} else if (e.getSource() == pageNumberTextField) {
String pageNumberInput = pageNumberTextField.getText();
@@ -205,7 +205,7 @@ public class MemoryWindow extends JFrame implements ActionListener {
// Try to parse a hex value out of the pageNumber.
int newPageNumber = Integer.parseInt(pageNumberInput, 16);
setPageNumber(newPageNumber & 0xff);
memoryTable.updateUI();
updateState();
} catch (NumberFormatException ex) {
// An invalid number was entered. Log the error, but otherwise
// take no action.
@@ -216,6 +216,13 @@ public class MemoryWindow extends JFrame implements ActionListener {
}
}
/**
* Refresh the view of memory
*/
public void updateState() {
memoryTable.updateUI();
}
/**
* A JTable that will automatically select all text in a cell
* being edited.