/** Sets the value at a specific row and column. */ public void setValueAt(Object value, int row, int col) { String data = ((String) value).trim(); if (!getStrAt(row).equals(data)) { try { short currentValue; if (data.equals("") && hideNullValue) currentValue = nullValue; else currentValue = Format.translateValueToShort(data, memory.dataFormat); notifyListeners((short) row, currentValue); } catch (NumberFormatException nfe) { notifyErrorListeners("Illegal value"); } repaint(); } }
// Returns the string at the given location private String getStrAt(int index) { short currentValue = memory.getValueAsShort((short) (index + startAddress)); if (currentValue == nullValue && hideNullValue) return ""; else return Format.translateValueToString(currentValue, dataFormat); }
/** Returns the value at the given index in its string representation. */ public String getValueAsString(int index) { return Format.translateValueToString( memory.getValueAsShort((short) (index + startAddress)), dataFormat); }