// (c) Tuomas J. Lukka package org.nongnu.libvob.input; import java.util.*; /** A class which receives absolute events from an axis. */ public class BoundedFloatLinearAbsoluteAdapter implements AbsoluteAxisListener { private BoundedFloatModel model; public BoundedFloatLinearAbsoluteAdapter(BoundedFloatModel model) { this.model = model; } public void changedAbsolute(float newValue) { double min = model.getMinimum(); double max = model.getMaximum(); model.setValue(min + (max-min) * newValue); } }