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

refactor code table resource chooser

parent 2ef8a586
...@@ -262,48 +262,42 @@ public class CodeTableModel extends AbstractTableModel ...@@ -262,48 +262,42 @@ public class CodeTableModel extends AbstractTableModel
return res ; return res ;
} }
public Object getValueAt( int row, int column ) public Object getValueAt( int row, int column ) {
{ Object res = "";
Object res ; Row r = rows.elementAt( row ) ;
Row r = rows.elementAt( row ) ; switch (column) {
if ( column == C_PC ) case C_PC:
{ res = (r.memLoc == registers.getPC()) ? Images.redball : Images.white ;
res = (r.memLoc == registers.getPC()) ? Images.redball : Images.white ; break;
} case C_BP:
else if ( column == C_BP ) res = r.hasBreakPoint ? Images.check : Images.white ;
{ break;
res = r.hasBreakPoint ? Images.check : Images.white ; case C_VALUE:
} res = memory.getAsHexAt(r.memLoc);
else break;
{ case C_LABEL:
if ( column == C_VALUE ) res = r.labelName;
{ break;
res = memory.getAsHexAt( r.memLoc ) ; case C_ADDRESS:
} res = Utils.asHex(r.memLoc);
else if ( column == C_LABEL && r.labelName != null ) break;
{ case C_INSTR:
res = r.labelName ; res = r.getInstrRepr( r.memLoc ) ;
} break;
else if ( column == C_ADDRESS ) case C_ARG1:
{ if (r.getNrInlineOpnds() > 0) {
res = Utils.asHex( r.memLoc ) ; res = memory.getAsHexAt(r.memLoc + 1) ;
} }
else if ( column == C_INSTR ) break;
{ case C_ARG2:
res = r.getInstrRepr( r.memLoc ) ; if (r.getNrInlineOpnds() > 1) {
} res = memory.getAsHexAt(r.memLoc + 2) ;
else if ( column == C_ARG1 && r.getNrInlineOpnds() > 0 ) }
{ break;
res = memory.getAsHexAt( r.memLoc+1 ) ; default:
} res = "Error";
else if ( column == C_ARG2 && r.getNrInlineOpnds() > 1 ) }
{ return res;
res = memory.getAsHexAt( r.memLoc+2 ) ;
}
else
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