import java.awt.* ;

public class Fr2 extends java.applet.Applet {

   static po XY;  // pour enregistrer la base routiere

   static AFr3 c;  // la fenetre "carte"
   static   Button encore/* ,dessin*/ ;
   static   Button W1,W2,W3;
   static   String vitesse;
   static int mA, mR ;
   static Dialog  dl;
   static TextField tf;
   static FraPof w;
   static TextField rapport;
   static Scrollbar scroll ;
//
   public Fr2 () {
     Exec ();
   };
//
   public void Exec () {
      scroll = new Scrollbar (Scrollbar.HORIZONTAL,1,0,1,200);
      scroll.setValue (100);
      add ("South",scroll);
   XY = new po () ;
   XY.charger();
//     System.out.println(dl);
      rapport = new TextField (10);
      rapport.setText ( scroll.getValue()+" %" ) ;
      w = new FraPof ("Carte de France ....") ; // "Carte de France ...       "+mR+"/"+mA);

      c = new AFr3 ();
      w.add ("Center",c);
//
      encore = new Button ("Play again");
      add ("West",encore);
      add ("South",rapport);
//
//      dessin = new Button ("Redraw");
//      W1 = new Button ("Redraw");
//      W2 = new Button ("Redessiner");
      W3 = new Button ("Redraw");
//      add ("East",dessin);
//      w.add ("South",W1);
//      w.add ("South",W2);
      w.add ("South",W3);
      w.show ();
      w.resize (460,440);
      po.fond (c.getGraphics () ) ;
      mA=130;
      mR=90;
      }

      void reDessine () {
      po.fond (c.getGraphics () ) ;
      }

    public boolean handleEvent (Event e) {
//     System.out.println(e);
     if (e.target == scroll) {
      rapport.setText ( scroll.getValue()+" %"  ) ;
        
     }
     if (e.target == encore) {
       XY.charger();
       XY.raz () ; AFr3.raz ();
       XY.redessin (c.getGraphics()) ;;
     };
     return super.handleEvent(e);
    }
}


