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

format nicely the values in tables

parent 59730259
Pipeline #35025 passed with stage
in 27 seconds
...@@ -273,25 +273,25 @@ public class CodeTableModel extends AbstractTableModel ...@@ -273,25 +273,25 @@ public class CodeTableModel extends AbstractTableModel
res = r.hasBreakPoint ? Images.check : Images.white ; res = r.hasBreakPoint ? Images.check : Images.white ;
break; break;
case C_VALUE: case C_VALUE:
res = memory.getAsHexAt(r.memLoc); res = String.format("%1$#08X", r.memLoc);
break; break;
case C_LABEL: case C_LABEL:
res = r.labelName; res = r.labelName;
break; break;
case C_ADDRESS: case C_ADDRESS:
res = Utils.asHex(r.memLoc); res = String.format("%1$#08X", r.memLoc);
break; break;
case C_INSTR: case C_INSTR:
res = r.getInstrRepr( r.memLoc ) ; res = r.getInstrRepr( r.memLoc ) ;
break; break;
case C_ARG1: case C_ARG1:
if (r.getNrInlineOpnds() > 0) { if (r.getNrInlineOpnds() > 0) {
res = memory.getAsHexAt(r.memLoc + 1) ; res = String.format("%1$#08X", memory.getAt(r.memLoc + 1));
} }
break; break;
case C_ARG2: case C_ARG2:
if (r.getNrInlineOpnds() > 1) { if (r.getNrInlineOpnds() > 1) {
res = memory.getAsHexAt(r.memLoc + 2) ; res = String.format("%1$#08X", memory.getAt(r.memLoc + 2));
} }
break; break;
default: default:
......
...@@ -69,11 +69,11 @@ public class HeapTableModel extends AbstractTableModel implements MemoryCellList ...@@ -69,11 +69,11 @@ public class HeapTableModel extends AbstractTableModel implements MemoryCellList
switch(column) { switch(column) {
case C_ADDRESS : case C_ADDRESS :
res = Utils.asHex(memLoc); res = String.format("%1$#08X", memLoc);
break; break;
case C_VALUE : case C_VALUE :
res = Utils.asHex(memory.getAt(memLoc)) ; res = String.format("%1$#08X", memory.getAt(memLoc));
break; break;
case C_ANNOTE : case C_ANNOTE :
MemoryAnnotation ann = memory.getAnnotationAt(memLoc); MemoryAnnotation ann = memory.getAnnotationAt(memLoc);
......
...@@ -95,11 +95,11 @@ public class StackTableModel extends AbstractTableModel ...@@ -95,11 +95,11 @@ public class StackTableModel extends AbstractTableModel
switch( column ) switch( column )
{ {
case C_ADDRESS : case C_ADDRESS :
res = Utils.asHex( memLoc ) ; res = String.format("%1$#08X", memLoc);
break ; break ;
case C_VALUE : case C_VALUE :
res = Utils.asHex( memory.getAt( memLoc ) ) ; res = String.format("%1$#08X", memory.getAt(memLoc));
break ; break ;
case C_REGPTRS : case C_REGPTRS :
......
...@@ -71,14 +71,11 @@ public class StatusTableModel extends AbstractTableModel ...@@ -71,14 +71,11 @@ public class StatusTableModel extends AbstractTableModel
public Object getValueAt( int row, int column ) public Object getValueAt( int row, int column )
{ {
Object res ; Object res ;
if ( column == C_SR ) if ( column == C_SR ) {
{
res = machineState.getSRAsString() ; res = machineState.getSRAsString() ;
} } else {
else
{
int reg = column ; int reg = column ;
res = Utils.asHex( registers.getReg( reg ) ) ; res = String.format("%1$#08X", registers.getReg(reg));
} }
return res ; return res ;
} }
......
Supports Markdown
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