Пример #1
0
  @Override
  public boolean onMouseClick(final MouseEvent mouseEvent) {
    if (!this.isDisabled() && this.isVisible()) {
      if (mouseEvent.getButton() == Buttons.LEFT) {
        if (mouseEvent.isButtonPressed()) {
          if (this.isInside(mouseEvent.getX(), mouseEvent.getY())) {
            this.isDepressed = true;
            return true;
          }
        } else {
          if (this.isInside(mouseEvent.getX(), mouseEvent.getY())) {
            if (this.isDepressed) {
              this.isDepressed = false;
              this.mouseClickAct.act();
              return true;
            }
          } else {
            this.isDepressed = false;
            return false;
          }
        }
      }
    }

    return false;
  }