/**
 * CurveUtil.java
 * @author Frank Ruskey, January 1998.
 * @version 1.0
 * @revised Johannes Martin
 * @version 1.1
 */
import java.awt.*;

/**
 * This class provides some utility methods for drawing curves.
 */
public final class CurveUtil {
  /**
   * Pause the program.
   *
   * @param milliSeconds the number of milliSeconds to pause the program
   */
  public static void slowDown ( long milliSeconds ) {
    try {
      Thread.sleep(milliSeconds);
    } catch (InterruptedException exception) {
    }
  }
  
  /**
   * Sets the drawing color depending for the current graphics context 
   * depending on an index.
   *
   * @param index index according to which to select the color
   */
  public static void setLineColor ( int index, Graphics graphics ) {
    switch (index) {
    case 1: 
      graphics.setColor( Color.green );  
      break;
    case 2: 
      graphics.setColor( Color.orange );  
      break;
    case 3: 
      graphics.setColor( Color.red    );  
      break;
    case 4: 
      graphics.setColor( Color.magenta);  
      break;
    case 5: 
      graphics.setColor( Color.cyan   );  
      break;
    case 6: 
      graphics.setColor( Color.blue   );  
      break;
    default: 
      graphics.setColor( Color.black  );  
      break;
    }
  }                                
}
