public void pan(Direction direction) {
double xOffset = PAN_DIRECTION * PAN_INCREMENT * rangeX.getExtent();
double yOffset = PAN_DIRECTION * PAN_INCREMENT * rangeY.getExtent();
switch (direction) {
case LEFT :
rangeX = new Range(rangeX.getMin() + xOffset, rangeX.getMax() + xOffset);
break;
case RIGHT :
rangeX = new Range(rangeX.getMin() - xOffset, rangeX.getMax() - xOffset);
break;
case UP :
rangeY = new Range(rangeY.getMin() + yOffset, rangeY.getMax() + yOffset);
break;
case DOWN :
rangeY = new Range(rangeY.getMin() - yOffset, rangeY.getMax() - yOffset);
break;
}
}