@Override
    public void update() {

        UIActions.State newState = UIActions.State.Up;

        if (getRectangle().containsPoint(Mouse.getX(), Display.getHeight() - Mouse.getY())) {
            newState = UIActions.State.Hover;
            if (Mouse.isButtonDown(0)) {
                newState = UIActions.State.Down;
            }
        }

        if (state != newState) {
            state = newState;
            setChanged();

            if(state== UIActions.State.Up)
                notifyObservers(getActions().getUp());

            if(state== UIActions.State.Down)
                notifyObservers(getActions().getDown());

            if(state== UIActions.State.Hover)
                notifyObservers(getActions().getHover());
        }
    }