Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private fun draw(g2d: Graphics2D) {
- g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON)
- g2d.setStroke(stroke)
- g2d.setFont(fonts)
- var y = 16
- for (i in 0..memory.size() - 1) {
- g2d.setColor(normalColor)
- g2d.drawRoundRect(16, y, 64, 32, 8, 8)
- val name = memory[i].name
- g2d.drawString(name, 96, y + 20)
- val value = memory[i].value
- if (value is PointerValue) {
- g2d.setColor(pointerColor)
- val address = value.referenced.address
- val top = if (address < i) address else i
- val bottom = address + i - top
- val extent = (bottom - top) * 48
- g2d.drawArc(80 - extent / 2, top * 48 + 32, extent, extent, 270, 180)
- g2d.drawLine(48, y + 16, 80, y + 16)
- val ay = 48 * address + 32
- g2d.drawLine(80, ay, 88, ay - 8)
- g2d.drawLine(80, ay, 88, ay + 8)
- } else {
- g2d.drawString(value.show(), 32, y + 20)
- }
- y += 32 + 16
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement