Subversion Repositories eFlore/Applications.del

Rev

Rev 16 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 16 Rev 32
Line 15... Line 15...
15
import com.google.gwt.user.client.ui.HasWidgets;
15
import com.google.gwt.user.client.ui.HasWidgets;
Line 16... Line 16...
16
 
16
 
Line 17... Line 17...
17
public class ObservationPresenteur {
17
public class ObservationPresenteur {
18
 
-
 
19
	private final MockDatasource validationService = MockDatasource.getInstance();
18
 
20
 
-
 
21
	private ObservationVue view = new ObservationVue();
19
	private final MockDatasource validationService = MockDatasource.getInstance();
22
 
-
 
23
	private final Observation observation;
20
	private ObservationVue vue = new ObservationVue();
Line 24... Line 21...
24
 
21
	private final Observation observation;
25
	private boolean detailsOpen = false;
22
	private boolean detailsOpen = false;
26
 
23
 
Line 27... Line 24...
27
	public ObservationPresenteur(Observation observation) {
24
	public ObservationPresenteur(Observation observation) {
28
		this.observation = observation;
25
		this.observation = observation;
29
	}
26
	}
30
 
27
 
31
	public void go(HasWidgets composite) {
28
	public void go(HasWidgets composite) {
Line 32... Line 29...
32
		composite.add(view);
29
		composite.add(vue);
Line 33... Line 30...
33
		view.loadImage(observation);
30
		vue.loadImage(observation);
Line 34... Line 31...
34
		loadValidationData();
31
		// loadValidationData();
35
		handleEvents();
-
 
Line 36... Line 32...
36
 
32
		// handleEvents();
37
	}
33
 
38
 
-
 
39
	private void loadValidationData() {
34
	}
Line 40... Line 35...
40
 
35
 
Line 41... Line 36...
41
		List<ObservationValidation> observationValidationDatas = validationService
36
	private void loadValidationData() {
42
				.getValidationData(observation.getIdImage());
37
 
Line 43... Line 38...
43
 
38
		List<ObservationValidation> observationValidationDatas = validationService.getValidationData(observation.getIdImage());
44
		observation.setImageCelValidationDatas(observationValidationDatas);
39
 
Line 45... Line 40...
45
		new MoyenneVotePresenteur(observationValidationDatas).go(view
40
		observation.setImageCelValidationDatas(observationValidationDatas);
46
				.getRatePanel());
41
		new MoyenneVotePresenteur(observationValidationDatas).go(vue.getRatePanel());
47
		view.showValidationData(observationValidationDatas);
42
		vue.showValidationData(observationValidationDatas);
48
 
43
 
49
	}
-
 
50
 
-
 
51
	private void handleEvents() {
44
	}
52
		view.getMoreDetailsHtml().addClickHandler(new ClickHandler() {
45
 
53
 
46
	private void handleEvents() {
54
			@Override
47
		vue.getMoreDetailsHtml().addClickHandler(new ClickHandler() {
55
			public void onClick(ClickEvent event) {
48
 
Line 56... Line 49...
56
 
49
			@Override
Line 57... Line 50...
57
				if (detailsOpen) {
50
			public void onClick(ClickEvent event) {
58
					view.clearDetails();
51
 
59
				} else {
52
				if (detailsOpen) {
60
					new ObservationDetailPresenteur(observation).go(view
-
 
61
							.getDetailsPanel());
53
					vue.clearDetails();
62
					view.getMoreDetailsHtml().setHTML(
54
				} else {
63
							"<img src='img/icon_minus.png' />");
55
					new ObservationDetailPresenteur(observation).go(vue.getDetailsPanel());
64
				}
56
					vue.getMoreDetailsHtml().setHTML("<img src='img/icon_minus.png' />");