Commit e0b9999e authored by Edoardo Putti's avatar Edoardo Putti Committed by Mart Lubbers

format nicely the values in tables

parent 59730259
......@@ -273,25 +273,25 @@ public class CodeTableModel extends AbstractTableModel
res = r.hasBreakPoint ? Images.check : Images.white ;
break;
case C_VALUE:
res = memory.getAsHexAt(r.memLoc);
res = String.format("%1$#08X", r.memLoc);
break;
case C_LABEL:
res = r.labelName;
break;
case C_ADDRESS:
res = Utils.asHex(r.memLoc);
res = String.format("%1$#08X", r.memLoc);
break;
case C_INSTR:
res = r.getInstrRepr( r.memLoc ) ;
break;
case C_ARG1:
if (r.getNrInlineOpnds() > 0) {
res = memory.getAsHexAt(r.memLoc + 1) ;
res = String.format("%1$#08X", memory.getAt(r.memLoc + 1));
}
break;
case C_ARG2:
if (r.getNrInlineOpnds() > 1) {
res = memory.getAsHexAt(r.memLoc + 2) ;
res = String.format("%1$#08X", memory.getAt(r.memLoc + 2));
}
break;
default:
......
......@@ -69,11 +69,11 @@ public class HeapTableModel extends AbstractTableModel implements MemoryCellList
switch(column) {
case C_ADDRESS :
res = Utils.asHex(memLoc);
res = String.format("%1$#08X", memLoc);
break;
case C_VALUE :
res = Utils.asHex(memory.getAt(memLoc)) ;
res = String.format("%1$#08X", memory.getAt(memLoc));
break;
case C_ANNOTE :
MemoryAnnotation ann = memory.getAnnotationAt(memLoc);
......
......@@ -95,11 +95,11 @@ public class StackTableModel extends AbstractTableModel
switch( column )
{
case C_ADDRESS :
res = Utils.asHex( memLoc ) ;
res = String.format("%1$#08X", memLoc);
break ;
case C_VALUE :
res = Utils.asHex( memory.getAt( memLoc ) ) ;
res = String.format("%1$#08X", memory.getAt(memLoc));
break ;
case C_REGPTRS :
......
......@@ -71,14 +71,11 @@ public class StatusTableModel extends AbstractTableModel
public Object getValueAt( int row, int column )
{
Object res ;
if ( column == C_SR )
{
if ( column == C_SR ) {
res = machineState.getSRAsString() ;
}
else
{
} else {
int reg = column ;
res = Utils.asHex( registers.getReg( reg ) ) ;
res = String.format("%1$#08X", registers.getReg(reg));
}
return res ;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment