All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.harium.etyl.ui.spinner.IntegerSpinner Maven / Gradle / Ivy

package com.harium.etyl.ui.spinner;

import com.harium.etyl.ui.Spinner;

public class IntegerSpinner extends Spinner {

    public IntegerSpinner(int x, int y, int w, int h) {
        super(x, y, w, h);
        this.value = 0;
        this.step = 1;

        this.minValue = Integer.MIN_VALUE;
        this.maxValue = Integer.MAX_VALUE;
    }

    @Override
    public void add() {
        if (value.intValue() < maxValue) {
            this.value = value.intValue() + step.intValue();
        }
    }

    @Override
    public void subtract() {
        if (value.intValue() > minValue) {
            this.value = value.intValue() - step.intValue();
        }
    }

    public Integer getValue() {
        return this.value.intValue();
    }

}






© 2015 - 2025 Weber Informatics LLC | Privacy Policy