private boolean adjustHue(int x,int y,boolean check){
  double rad=Math.sqrt(x * x + y * y);
  int size=getWheelRadius();
  if (!check || (rad >= size - getWheelWidth() && rad < size)) {
    double angle;
    if (x == 0) {
      if (y > 0) {
        angle=Math.PI / 2.0;
      }
 else {
        angle=Math.PI + Math.PI / 2.0;
      }
    }
 else {
      angle=Math.atan((double)y / (double)x);
      if (x < 0) {
        angle+=Math.PI;
      }
 else       if (angle < 0) {
        angle+=2 * Math.PI;
      }
    }
    setFlag(FLAGS_SETTING_COLOR,true);
    setHue((float)(1.0 - angle / Math.PI / 2),true);
    setFlag(FLAGS_SETTING_COLOR,false);
    setHueAngle(angle);
    setSaturationAndBrightness(getSaturation(),getBrightness());
    return true;
  }
  return false;
}

private boolean adjustHue ( int x , int y , boolean check ) { double rad = Math . sqrt ( x * x + y * y ) ; int size = getWheelRadius ( ) ; if ( ! check || ( rad >= size - getWheelWidth ( ) && rad < size ) ) { double angle ; if ( x == 0 ) { if ( y > 0 ) { angle = Math . PI / 2.0 ; } else { angle = Math . PI + Math . PI / 2.0 ; } } else { angle = Math . atan ( ( double ) y / ( double ) x ) ; if ( x < 0 ) { angle += Math . PI ; } else if ( angle < 0 ) { angle += 2 * Math . PI ; } } setFlag ( FLAGS_SETTING_COLOR , true ) ; setHue ( ( float ) ( 1.0 - angle / Math . PI / 2 ) , true ) ; setFlag ( FLAGS_SETTING_COLOR , false ) ; setHueAngle ( angle ) ; setSaturationAndBrightness ( getSaturation ( ) , getBrightness ( ) ) ; return true ; } return false ; }
adjusts the hue based on the passed in location .
