import java.util.*; public class Model{ private int xPos; // This class calculates the graph bars' horizontal positions private float barlength; // This class calculates the length of the bars Model(){ xPos = 1; barlength = 0; } public int getxPos() { return xPos; } public void setxPos(int xPos) { this.xPos = xPos; } public float getBarlength() { return barlength; } public void setBarlength(float barlength) { barlength = mapRange(barlength, 0, 1023, 0, 300); this.barlength = barlength; } public float mapRange( float s,int i, int j, int k, int l){ return (k + ((s - i)*(l - k))/(j - i)); } }