private void constrain() { BigInteger offset = new BigInteger(Integer.toString(addressSize * (numUsableRows))); BigInteger endVal = startVal.add(offset); if (endVal.compareTo(scrollBar.getMaximumHP()) > 0) { startVal = scrollBar.getMaximumHP().subtract(offset); endVal = scrollBar.getMaximumHP(); scrollBar.setValueHP(startVal); model.fireTableDataChanged(); } }
private void updateFromScrollBar() { beginUpdate(); BigInteger oldStartVal = startVal; startVal = scrollBar.getValueHP(); constrain(); model.fireTableDataChanged(); if (oldStartVal != null) { modifySelection(oldStartVal.subtract(startVal).intValue() / addressSize); } endUpdate(); }
private String bigIntToHexString(BigInteger bi) { StringBuffer buf = new StringBuffer(); buf.append("0x"); String val = bi.toString(16); for (int i = 0; i < ((2 * addressSize) - val.length()); i++) { buf.append('0'); } buf.append(val); return buf.toString(); }