package mhcgp;

/** 
 *  Package mhcgp <br>
 *  class Face <p>
 *
 *  author mhc<p>
 *  The face contains all of the parts, and is the background to boot.  I want
 *  to contain two eyes, a left and a right, then I need a nose and a mouth.
 *  I'm gonna instantiate everything, then I'm gonna size everything the way
 *  I want and position them too.  I have two methods for sizing and
 *  positioning to keep things simple and small.  This way it is easy to find
 *  the areas where I would need to change everything.  If I was super-cool,
 *  I might create an interface with constants, and then I could go change the
 *  constants when necessary.  Can you think of other ways I might want to do
 *  this?
 */

public class Face extends GP.Graphics.FilledOval {

  private Eye _leftEye, _rightEye; //need two eyes
  private Nose _nose; 
  private Mouth _mouth;

  /**
    * Everything is supposed to show up in the same area, so I want to use
    * the same container for everything.
    */
  public Face(GP.Container container) {
    super(container);
    this.SetColor(new GP.Attributes.Colors.White());
     _leftEye = new Eye(container);
    _rightEye = new Eye(container);
     _nose = new Nose(container);
     _mouth = new Mouth(container);
     this.SizeEverything();
     this.PlaceEverthing();
  }

  /** position all of the objects */
  public void PlaceEverthing() {
    this.SetPosition(new GP.Attributes.Position(150,150));
    _leftEye.SetPosition(100,100);
    _rightEye.SetPosition(200,100);
    _nose.SetPosition(new GP.Attributes.Position(150,150));
    _mouth.SetPosition(new GP.Attributes.Position(150, 200));
  }

  /** set the size of all the objects */
  public void SizeEverything() {
    this.SetSize(new GP.Attributes.Size(200,200));
    _leftEye.SetSize(30,30);
    _rightEye.SetSize(30,30);
    _nose.SetSize(new GP.Attributes.Size(20, 20));
    _mouth.SetSize(new GP.Attributes.Size(100,25));
  }
}
