Package ds.ihm

Source Code of ds.ihm.Ihm

package ds.ihm;

import ds.Controleur;
import ds.ihm.clavier.EcouteurClavier;
import ds.ihm.clavier.InterfaceClavier;
import ds.ihm.gui.Gay;
import ds.ihm.gui.InterfaceGraphique;
import ds.ihm.joystick.GestionnaireJoystick;
import ds.ihm.joystick.ValeursJoystick;

public class Ihm implements InterfaceHommeMachine {

  private Controleur controleur;
  private InterfaceGraphique gay;
  private EcouteurClavier clavier;
  private GestionnaireJoystick joystick;
 
  public Ihm(Controleur controleur){
    this.controleur = controleur;
    this.gay = new Gay(this);
    this.clavier = new EcouteurClavier(this.gay);
    this.joystick = new GestionnaireJoystick();
  }
 
  public InterfaceClavier getClavier() {
    return this.clavier;
  }
 
  public GestionnaireJoystick getGestionnaireJoystick() {
    return this.joystick;
  }
 
  public InterfaceGraphique getInterfaceGraphique() {
    return this.gay;
  }
 
  public void afficherEcranDemarrage() {
    this.initJoystick();
    boolean isJoystickActif = joystick.getConfJoystick().isUtiliserJoystick();
    this.gay.afficherEcranDemarrage(isJoystickActif);
  }
 
  public void detruireEcranDemarrage() {
    this.gay.detruireEcranDemarrage();
  }
 
  public void initIhm() {
    this.gay.init(this.clavier);
    this.joystick.selectJoystick(this.joystick.getConfJoystick().getNumeroJoystick());
  }
 
  public void initJoystick(){
    this.joystick.init();
   
    for (int i=0;i<this.joystick.getJoystickNames().size();i++)  {
      System.out.println(this.joystick.getJoystickNames().get(i));
    }
  }
 
  public Controleur getControleur() {
    return controleur;
  }

  public ValeursJoystick getValeursJoystick() {
    return joystick.getValeurs();
  }
}
TOP

Related Classes of ds.ihm.Ihm

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.