public void zoom(int wheel){
  double x=currentValue;
  if ((x < minValue) || (x > maxValue)) {
    x=(maxValue + minValue) / 2;
  }
  double wid=Math.abs(maxValue - minValue);
  double xE=(maxValue - x) / wid;
  double xW=(x - minValue) / wid;
  double w=minValue + wheel * xW;
  double e=maxValue - wheel * xE;
  if (w >= e) {
    return;
  }
  minValue=Math.max(defaultMin,w);
  maxValue=Math.min(defaultMax,e);
  scaleCanvas.repaint();
}

public void zoom ( int wheel ) { double x = currentValue ; if ( ( x < minValue ) || ( x > maxValue ) ) { x = ( maxValue + minValue ) / 2 ; } double wid = Math . abs ( maxValue - minValue ) ; double xE = ( maxValue - x ) / wid ; double xW = ( x - minValue ) / wid ; double w = minValue + wheel * xW ; double e = maxValue - wheel * xE ; if ( w >= e ) { return ; } minValue = Math . max ( defaultMin , w ) ; maxValue = Math . min ( defaultMax , e ) ; scaleCanvas . repaint ( ) ; }
zoom the scale so that the ends are closer or farther apart . this changes the range .
