private void drawRegisters(final Graphics g) {

    final int PADDING_TOP = font.getSize() + 5;

    int y = PADDING_TOP;

    final int lineHeight = font.getSize();

    int registerCounter = 0;

    // Draw the name and value of each register
    for (final RegisterInformationInternal register : registerModel.getRegisterInformation()) {

      if (isEnabled()) {
        // Set the text color depending on the register status
        g.setColor(
            register.isModified() || (registerCounter == editedRegister)
                ? modifiedColor
                : textColor);
      } else {
        g.setColor(disabledColor);
      }

      // Draw the register name
      g.drawString(register.getRegisterName(), paddingLeft, y);

      final BigInteger value =
          (registerCounter == editedRegister ? editValue : register.getValue())
              .and(
                  register.getRegisterSize() == 8
                      ? BigInteger.valueOf(9223372036854775807L)
                      : BigInteger.valueOf(4294967295L));

      final String valueString;

      if (register.getRegisterSize() != 0) {
        // Get the register value string
        final String formatMask = "%0" + (2 * register.getRegisterSize()) + "X";
        valueString = String.format(formatMask, value);
      } else {
        valueString = String.valueOf(value.and(BigInteger.ONE));
      }

      // Draw the register value
      g.drawString(valueString, 10 + 5 + (charWidth * longestRegisterName), y);

      ++registerCounter;

      y += lineHeight;
    }
  }
Draws the names and values of the registers.

@param g
java/zylib/src/main/java/com/google/security/zynamics/zylib/gui/JRegisterView/JRegisterView.java