package jcgp.backend.resources.parameters; import javafx.beans.property.SimpleIntegerProperty; public abstract class IntegerParameter extends Parameter { private SimpleIntegerProperty value; public IntegerParameter(int value, String name, boolean monitor, boolean critical) { super(name, monitor, critical); this.value = new SimpleIntegerProperty(value); } public IntegerParameter(int value, String name) { super(name, false, false); this.value = new SimpleIntegerProperty(value); } public int get() { return value.get(); } public void set(int newValue) { if (!value.isBound()) { validate(newValue); value.set(newValue); } } @Override public SimpleIntegerProperty valueProperty() { return value; } public abstract void validate(int newValue); }