package depart.frontal.vues;

import ca.ntro.app.Ntro;
import ca.ntro.app.frontend.ViewFx;
import depart.commun.monde2d.MondeDepart2d;
import depart.frontal.controles.CanvasB;
import depart.frontal.evenements.EvtA;
import javafx.fxml.FXML;
import javafx.scene.control.Button;
import javafx.scene.control.Label;

public class VueB extends ViewFx {

	@FXML
	private Label labelA;

	@FXML
	private Label labelB;

	@FXML
	private Button boutonA;

	@FXML
	private CanvasB canvas;

	@Override
	public void initialize() {
		Ntro.assertNotNull(labelA);
		Ntro.assertNotNull(labelB);
		Ntro.assertNotNull(boutonA);
		Ntro.assertNotNull(canvas);
		
		boutonA.setOnAction(evtFx -> {

			Ntro.newEvent(EvtA.class).trigger();
			
		});
	}

	public void methodeA(MondeDepart2d monde2d) {
		monde2d.drawOn(canvas);
	}

	public void methodeB(double paramA) {
		labelB.setText(String.valueOf(paramA));
	}

	public void methodeC(String paramB) {
		labelA.setText(paramB);
	}

}
