|
Lines 84-93
Link Here
|
| 84 |
|
84 |
|
| 85 |
protected BigInteger fBaseAddress = null; // remember the base address |
85 |
protected BigInteger fBaseAddress = null; // remember the base address |
| 86 |
|
86 |
|
| 87 |
private int fColumnCount = 0; // auto calculate can be disabled by user, |
87 |
protected int fColumnCount = 0; // auto calculate can be disabled by user, |
| 88 |
// making this user settable |
88 |
// making this user settable |
| 89 |
|
89 |
|
| 90 |
private int fBytesPerRow = 0; // current number of bytes per row are displayed |
90 |
protected int fBytesPerRow = 0; // current number of bytes per row are displayed |
| 91 |
|
91 |
|
| 92 |
private int fCurrentScrollSelection = 0; // current scroll selection; |
92 |
private int fCurrentScrollSelection = 0; // current scroll selection; |
| 93 |
|
93 |
|
|
Lines 208-290
Link Here
|
| 208 |
|
208 |
|
| 209 |
this.fAddressBarControl.setVisible(false); |
209 |
this.fAddressBarControl.setVisible(false); |
| 210 |
|
210 |
|
| 211 |
getHorizontalBar().addSelectionListener(new SelectionListener() |
211 |
getHorizontalBar().addSelectionListener(createHorizontalBarSelectionListener()); |
| 212 |
{ |
|
|
| 213 |
public void widgetSelected(SelectionEvent se) |
| 214 |
{ |
| 215 |
Rendering.this.layout(); |
| 216 |
} |
| 217 |
|
| 218 |
public void widgetDefaultSelected(SelectionEvent se) |
| 219 |
{ |
| 220 |
// do nothing |
| 221 |
} |
| 222 |
}); |
| 223 |
|
212 |
|
| 224 |
getVerticalBar().addSelectionListener( |
213 |
getVerticalBar().addSelectionListener(createVerticalBarSelectinListener()); |
| 225 |
new SelectionListener() |
|
|
| 226 |
{ |
| 227 |
public void widgetSelected(SelectionEvent se) |
| 228 |
{ |
| 229 |
int addressableSize = getAddressableSize(); |
| 230 |
|
| 231 |
switch(se.detail) |
| 232 |
{ |
| 233 |
case SWT.ARROW_DOWN: |
| 234 |
handleDownArrow(); |
| 235 |
break; |
| 236 |
case SWT.PAGE_DOWN: |
| 237 |
handlePageDown(); |
| 238 |
break; |
| 239 |
case SWT.ARROW_UP: |
| 240 |
handleUpArrow(); |
| 241 |
break; |
| 242 |
case SWT.PAGE_UP: |
| 243 |
handlePageUp(); |
| 244 |
break; |
| 245 |
case SWT.SCROLL_LINE: |
| 246 |
// See: BUG 203068 selection event details broken on GTK < 2.6 |
| 247 |
default: |
| 248 |
if(getVerticalBar().getSelection() == getVerticalBar().getMinimum()) |
| 249 |
{ |
| 250 |
// Set view port start address to the start address of the Memory Block |
| 251 |
fViewportAddress = Rendering.this.getMemoryBlockStartAddress(); |
| 252 |
} |
| 253 |
else if(getVerticalBar().getSelection() == getVerticalBar().getMaximum()) |
| 254 |
{ |
| 255 |
// The view port end address should be less or equal to the the end address of the Memory Block |
| 256 |
// Set view port address to be bigger than the end address of the Memory Block for now |
| 257 |
// and let ensureViewportAddressDisplayable() to figure out the correct view port start address |
| 258 |
fViewportAddress = Rendering.this.getMemoryBlockEndAddress(); |
| 259 |
} |
| 260 |
else |
| 261 |
{ |
| 262 |
// Figure out the delta |
| 263 |
int delta = getVerticalBar().getSelection() - fCurrentScrollSelection; |
| 264 |
fViewportAddress = fViewportAddress.add(BigInteger.valueOf( |
| 265 |
getAddressableCellsPerRow() * delta)); |
| 266 |
} |
| 267 |
ensureViewportAddressDisplayable(); |
| 268 |
// Update tooltip |
| 269 |
// FIXME conversion from slider to scrollbar |
| 270 |
// getVerticalBar().setToolTipText(Rendering.this.getAddressString(fViewportAddress)); |
| 271 |
|
| 272 |
// Update the addresses on the Address pane. |
| 273 |
if(fAddressPane.isPaneVisible()) |
| 274 |
{ |
| 275 |
fAddressPane.redraw(); |
| 276 |
} |
| 277 |
redrawPanes(); |
| 278 |
break; |
| 279 |
} |
| 280 |
|
| 281 |
} |
| 282 |
|
| 283 |
public void widgetDefaultSelected(SelectionEvent se) |
| 284 |
{ |
| 285 |
// do nothing |
| 286 |
} |
| 287 |
}); |
| 288 |
|
214 |
|
| 289 |
this.addPaintListener(new PaintListener() |
215 |
this.addPaintListener(new PaintListener() |
| 290 |
{ |
216 |
{ |
|
Lines 421-426
Link Here
|
| 421 |
redrawPanes(); |
347 |
redrawPanes(); |
| 422 |
} |
348 |
} |
| 423 |
|
349 |
|
|
|
350 |
protected SelectionListener createHorizontalBarSelectionListener() |
| 351 |
{ |
| 352 |
return new SelectionListener() |
| 353 |
{ |
| 354 |
public void widgetSelected(SelectionEvent se) |
| 355 |
{ |
| 356 |
Rendering.this.layout(); |
| 357 |
} |
| 358 |
|
| 359 |
public void widgetDefaultSelected(SelectionEvent se) |
| 360 |
{ |
| 361 |
// do nothing |
| 362 |
} |
| 363 |
}; |
| 364 |
} |
| 365 |
|
| 366 |
protected SelectionListener createVerticalBarSelectinListener() |
| 367 |
{ |
| 368 |
return new SelectionListener() |
| 369 |
{ |
| 370 |
public void widgetSelected(SelectionEvent se) |
| 371 |
{ |
| 372 |
int addressableSize = getAddressableSize(); |
| 373 |
|
| 374 |
switch(se.detail) |
| 375 |
{ |
| 376 |
case SWT.ARROW_DOWN: |
| 377 |
handleDownArrow(); |
| 378 |
break; |
| 379 |
case SWT.PAGE_DOWN: |
| 380 |
handlePageDown(); |
| 381 |
break; |
| 382 |
case SWT.ARROW_UP: |
| 383 |
handleUpArrow(); |
| 384 |
break; |
| 385 |
case SWT.PAGE_UP: |
| 386 |
handlePageUp(); |
| 387 |
break; |
| 388 |
case SWT.SCROLL_LINE: |
| 389 |
// See: BUG 203068 selection event details broken on GTK < 2.6 |
| 390 |
default: |
| 391 |
if(getVerticalBar().getSelection() == getVerticalBar().getMinimum()) |
| 392 |
{ |
| 393 |
// Set view port start address to the start address of the Memory Block |
| 394 |
fViewportAddress = Rendering.this.getMemoryBlockStartAddress(); |
| 395 |
} |
| 396 |
else if(getVerticalBar().getSelection() == getVerticalBar().getMaximum()) |
| 397 |
{ |
| 398 |
// The view port end address should be less or equal to the the end address of the Memory Block |
| 399 |
// Set view port address to be bigger than the end address of the Memory Block for now |
| 400 |
// and let ensureViewportAddressDisplayable() to figure out the correct view port start address |
| 401 |
fViewportAddress = Rendering.this.getMemoryBlockEndAddress(); |
| 402 |
} |
| 403 |
else |
| 404 |
{ |
| 405 |
// Figure out the delta |
| 406 |
int delta = getVerticalBar().getSelection() - fCurrentScrollSelection; |
| 407 |
fViewportAddress = fViewportAddress.add(BigInteger.valueOf( |
| 408 |
getAddressableCellsPerRow() * delta)); |
| 409 |
} |
| 410 |
ensureViewportAddressDisplayable(); |
| 411 |
// Update tooltip |
| 412 |
// FIXME conversion from slider to scrollbar |
| 413 |
// getVerticalBar().setToolTipText(Rendering.this.getAddressString(fViewportAddress)); |
| 414 |
|
| 415 |
// Update the addresses on the Address pane. |
| 416 |
if(fAddressPane.isPaneVisible()) |
| 417 |
{ |
| 418 |
fAddressPane.redraw(); |
| 419 |
} |
| 420 |
redrawPanes(); |
| 421 |
break; |
| 422 |
} |
| 423 |
|
| 424 |
} |
| 425 |
|
| 426 |
public void widgetDefaultSelected(SelectionEvent se) |
| 427 |
{ |
| 428 |
// do nothing |
| 429 |
} |
| 430 |
}; |
| 431 |
} |
| 432 |
|
| 424 |
protected AddressPane createAddressPane() |
433 |
protected AddressPane createAddressPane() |
| 425 |
{ |
434 |
{ |
| 426 |
return new AddressPane(this); |
435 |
return new AddressPane(this); |