Help to make a radio button class

I found the code for a button class and I managed to make a sketch that makes a check button, but now I need help to make a sketch of several option or radio buttons using this button class, since the controlP5 library is very annoying to use.

http://micropinguino.blogspot.com/2016/10/botones-en-processing.html

Boton botonUno, botonDos;
SliderH sliderUno,sliderDos;
void setup() {
  size(800, 600);
  botonUno=new Boton(0, 0, 100, 50);
  botonDos=new Boton(100, 0, 100, 50);
  sliderUno=new SliderH(0,200,0,200);
  sliderDos=new SliderH(0,200,200,300);
}
void draw() {
  if (botonUno.getEstado()) {
    background(0);
  } else {
    background(255);
  }
  sliderUno.dibujar();
  sliderDos.dibujar();
  botonUno.dibujar();
  botonDos.dibujar();
  if(mousePressed){
    sliderUno.moverSlider(mouseX,mouseY);
    sliderDos.moverSlider(mouseX,mouseY);
  }
  println("Valor = "+int(sliderUno.calcularValor(0,360)));
  println("Id Boton "+botonUno.getIdOnOff());
}
void mousePressed() {
  botonUno.toggleOver(mouseX, mouseY);
  botonDos.toggleOver(mouseX, mouseY);
}
//Clase para realizar botones on off y con numeracion
class Boton {
  int posX, posY, anchoBoton, altoBoton, idNumero;
  color colorON, colorOff;
  boolean banderaOnOff;
  Boton(int x, int y, int ancho, int alto) {
    posX=x;
    posY=y;
    anchoBoton=ancho;
    altoBoton=alto;
    colorON=color(0, 255, 0);
    colorOff=color(255, 0, 0);
    banderaOnOff=false;
    idNumero=1;
  }
  void dibujar() {
    if (banderaOnOff) {
      fill(colorON);
    } else {
      fill(colorOff);
    }
    rect(posX, posY, anchoBoton, altoBoton);
  }
  void setOn() {
    banderaOnOff=true;
  }
  void setOff() {
    banderaOnOff=false;
  }
  void toggle() {
    banderaOnOff=!banderaOnOff;
  }
  void setDimensiones(int x, int y, int ancho, int alto) {
    posX=x;
    posY=y;
    anchoBoton=ancho;
    altoBoton=alto;
  }
  void toggleOver(int x, int y) {
    if (x>posX && x<(posX+anchoBoton) && y>posY && y<(posY+altoBoton)) {
      banderaOnOff=!banderaOnOff;
    }
  }
  boolean getEstado() {
    return  banderaOnOff;
  }
  void setIdentificacion(int numero) {
    idNumero=numero;
    if (idNumero<=0)//las identificaciones no pueden ser menores o iguales a cero
      idNumero=1;//identificacion por defecto
  }
  int getIdentificacion() {
    return idNumero;
  }
  int getIdOnOff() {//retorna la identificacion se esta on y cero si esta off
    int id;
    if (banderaOnOff) {
      id=idNumero;
    } else {
      id=0;
    }
    return id;
  }
}
//Clase para realizar botones deslizantes
class SliderH {
  int orgX, finX, posX, posVer;
  float minVal, maxVal, resVal;
  color colorSlider;
  SliderH(int x0, int x1, int px, int posv) {
    orgX=x0;
    finX=x1;
    posX=px;
    posVer=posv;
    colorSlider=color(0, 0, 255);
    minVal=x0;
    maxVal=x1;
  }
  void dibujar() {
    line(orgX, posVer, finX, posVer);
    fill(colorSlider);
    rect(posX-5, posVer-10, 10, 20);
  }
  int moverSlider(int x, int y) {
    if (x>=orgX && x<= finX) {
      if (x>(posX-5) && x<(posX+10) && y>(posVer-10) && y<(posVer+20)) {
        posX=x;
      }
    }
    return posX;
  }
  int incSlider(int inc) {
    posX=posX+inc;
    if (posX>finX) {
      posX=finX;
    }
    return posX;
  }
  int decSlider(int dec) {
    posX=posX+dec;
    if (posX<orgX) {
      posX=orgX;
    }
    return posX;
  }
  int getPos() {
    return posX;
  }
  void setPos(int px) {
    posX=px;
    if (posX>finX) {
      posX=finX;
    } else if (posX<orgX) {
      posX=orgX;
    }
  }
  void setValores(float min, float max) {
    minVal=min;
    maxVal=max;
  }
  float calcularValor(float min, float max) {
    minVal=min;
    maxVal=max;
    resVal=map(posX, orgX, finX, minVal, maxVal);
    return resVal;
  }
}

Did you check out lib G4P ?

Thanks for your suggestion, could you help me first in how to modify this example so that the two buttons are of the option button or radio button type?

Adding a simple button to a class?

Button btn1, btn2;
 
void setup() {
  size(640, 480);
 
  btn1 = new Button(370, 140, 10, 10);
  btn2 = new Button(270, 140, 10, 10);
}
 
void draw() {
  background(250);
  btn1.buttonDisplay();
  btn2.buttonDisplay();
}
 
void mouseClicked() {
  if ( btn1.hasClicked())
    println("Button 1 clicked");
  if ( btn2.hasClicked())
    println("Button 2 clicked");
}
 
 
class Button {
 
  final int COLOR_STATE0 = color(255, 0, 0);
  final int COLOR_STATE1 = color(0, 255, 0);
 
  int buttonX, buttonY, buttonWidth, buttonHeight;
  boolean overButton, buttonOn;
 
  Button(int tempbuttonX, int tempbuttonY, int tempbuttonWidth, int           tempbuttonHeight) {
    buttonX = tempbuttonX;
    buttonY = tempbuttonY;
    buttonWidth = tempbuttonWidth;
    buttonHeight = tempbuttonHeight;
  }
 
  void buttonDisplay() {
    if (buttonOn)
      fill(COLOR_STATE0);
    else
      fill(COLOR_STATE1);
    if (isOver(mouseX, mouseY)) {
      stroke(0);
      strokeWeight(2);
    } else {
      noStroke();
    }
    rect(buttonX, buttonY, buttonWidth, buttonHeight);
  }
 
  boolean isOver(int x, int y) {
    return x > buttonX && x < buttonX+buttonWidth && y > buttonY && y < buttonY+buttonHeight;
  }
 
  boolean hasClicked() {
    boolean changeState = isOver(mouseX, mouseY);
    if (changeState) {
      buttonOn = !buttonOn;
    }
    return changeState;
  }
}

Button class a modify or sketch?

class Button {
 
  final int COLOR_STATE0 = color(255, 0, 0);
  final int COLOR_STATE1 = color(0, 255, 0);
 
  int buttonX, buttonY, buttonWidth, buttonHeight;
  boolean overButton, buttonOn;
 
  Button(int tempbuttonX, int tempbuttonY, int tempbuttonWidth, int tempbuttonHeight) {
    buttonX = tempbuttonX;
    buttonY = tempbuttonY;
    buttonWidth = tempbuttonWidth;
    buttonHeight = tempbuttonHeight;
  }
 
  void buttonDisplay() {
    if (buttonOn)
      fill(COLOR_STATE0);
    else
      fill(COLOR_STATE1);
    if (isOver(mouseX, mouseY)) {
      stroke(0);
      strokeWeight(2);
    } else {
      noStroke();
    }
    rect(buttonX, buttonY, buttonWidth, buttonHeight);
  }
 
  boolean isOver(int x, int y) {
    return x > buttonX && x < buttonX+buttonWidth && y > buttonY && y < buttonY+buttonHeight;
  }
 
  boolean hasClicked() {
    boolean changeState = isOver(mouseX, mouseY);
    if (changeState) {
      buttonOn = !buttonOn;
    }
    return changeState;
  }
}