Subversion Repositories eFlore/Applications.del

Rev

Rev 9 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 9 Rev 14
1
package org.tela_botanica.del.client.vues.searchobservations;
1
package org.tela_botanica.del.client.vues.rechercheobservations;
2
 
2
 
3
import java.util.List;
3
import java.util.List;
4
 
4
 
5
import org.tela_botanica.del.client.modeles.Observation;
5
import org.tela_botanica.del.client.modeles.Observation;
6
import org.tela_botanica.del.client.modeles.ObservationValidationData;
6
import org.tela_botanica.del.client.modeles.ObservationValidation;
7
 
7
 
8
import com.google.gwt.user.client.ui.Composite;
8
import com.google.gwt.user.client.ui.Composite;
9
import com.google.gwt.user.client.ui.HTML;
9
import com.google.gwt.user.client.ui.HTML;
10
import com.google.gwt.user.client.ui.HorizontalPanel;
10
import com.google.gwt.user.client.ui.HorizontalPanel;
11
import com.google.gwt.user.client.ui.Image;
11
import com.google.gwt.user.client.ui.Image;
12
import com.google.gwt.user.client.ui.Panel;
12
import com.google.gwt.user.client.ui.Panel;
13
import com.google.gwt.user.client.ui.VerticalPanel;
13
import com.google.gwt.user.client.ui.VerticalPanel;
14
 
14
 
15
public class ObservationView extends Composite {
15
public class ObservationVue extends Composite {
16
 
16
 
17
	private final Panel flowPanel = new VerticalPanel();
17
	private final Panel flowPanel = new VerticalPanel();
18
 
18
 
19
	private final Panel detailsPanel = new VerticalPanel();
19
	private final Panel detailsPanel = new VerticalPanel();
20
 
20
 
21
	private final HTML moreDetailsHtml = new HTML(
21
	private final HTML moreDetailsHtml = new HTML(
22
			"<img src='img/icon_plus.gif' alig='center'>");
22
			"<img src='img/icon_plus.gif' alig='center'>");
23
 
23
 
24
	private final Image waitImage = new Image("img/wait.gif");
24
	private final Image waitImage = new Image("img/wait.gif");
25
 
25
 
26
	private final HTML proposeValidationDataHtml = new HTML(
26
	private final HTML proposeValidationDataHtml = new HTML(
27
			"<a>Cliquez ici pour proposer votre validation</a>");
27
			"<a>Cliquez ici pour proposer votre validation</a>");
28
 
28
 
29
	private final HTML noValidationDataHtml = new HTML(
29
	private final HTML noValidationDataHtml = new HTML(
30
			"Pas de validation actuellement.");
30
			"Pas de validation actuellement.");
31
 
31
 
32
	private final Panel ratePanel = new HorizontalPanel();
32
	private final Panel ratePanel = new HorizontalPanel();
33
 
33
 
34
	protected ObservationView() {
34
	protected ObservationVue() {
35
		flowPanel.add(waitImage);
35
		flowPanel.add(waitImage);
36
		initWidget(flowPanel);
36
		initWidget(flowPanel);
37
	}
37
	}
38
 
38
 
39
	protected void loadImage(Observation observation) {
39
	protected void loadImage(Observation observation) {
40
 
40
 
41
		flowPanel.clear();
41
		flowPanel.clear();
42
		flowPanel.add(new HTML(observation.getSpecies()));
42
		flowPanel.add(new HTML(observation.getSpecies()));
43
		flowPanel.add(new HTML(observation.getAuteur()));
43
		flowPanel.add(new HTML(observation.getAuteur()));
44
		flowPanel.add(new HTML(
44
		flowPanel.add(new HTML(
45
				"<a href='http://www.tela-botanica.org/eflore/BDNFF/4.02/nn/"
45
				"<a href='http://www.tela-botanica.org/eflore/BDNFF/4.02/nn/"
46
						+ observation.getNumNomenclatural()
46
						+ observation.getNumNomenclatural()
47
						+ "' target='_blank'><img src='" + observation.getUrl()
47
						+ "' target='_blank'><img src='" + observation.getUrl()
48
						+ "' /img></a>"));
48
						+ "' /img></a>"));
49
		flowPanel.add(moreDetailsHtml);
49
		flowPanel.add(moreDetailsHtml);
50
		flowPanel.add(detailsPanel);
50
		flowPanel.add(detailsPanel);
51
		flowPanel.add(ratePanel);
51
		flowPanel.add(ratePanel);
52
	}
52
	}
53
 
53
 
54
	protected void showValidationData(
54
	protected void showValidationData(
55
			List<ObservationValidationData> validationDatas) {
55
			List<ObservationValidation> validationDatas) {
56
 
56
 
57
		if (validationDatas == null || validationDatas.size() == 0) {
57
		if (validationDatas == null || validationDatas.size() == 0) {
58
			flowPanel.add(noValidationDataHtml);
58
			flowPanel.add(noValidationDataHtml);
59
		}
59
		}
60
		flowPanel.add(proposeValidationDataHtml);
60
		flowPanel.add(proposeValidationDataHtml);
61
 
61
 
62
	}
62
	}
63
 
63
 
64
	protected void clearDetails() {
64
	protected void clearDetails() {
65
		detailsPanel.clear();
65
		detailsPanel.clear();
66
		moreDetailsHtml.setHTML("<img src='img/icon_plus.gif' >");
66
		moreDetailsHtml.setHTML("<img src='img/icon_plus.gif' >");
67
	}
67
	}
68
 
68
 
69
	public Panel getFlowPanel() {
69
	public Panel getFlowPanel() {
70
		return flowPanel;
70
		return flowPanel;
71
	}
71
	}
72
 
72
 
73
	public Panel getDetailsPanel() {
73
	public Panel getDetailsPanel() {
74
		return detailsPanel;
74
		return detailsPanel;
75
	}
75
	}
76
 
76
 
77
	public HTML getMoreDetailsHtml() {
77
	public HTML getMoreDetailsHtml() {
78
		return moreDetailsHtml;
78
		return moreDetailsHtml;
79
	}
79
	}
80
 
80
 
81
	public HTML getNoValidationDataHtml() {
81
	public HTML getNoValidationDataHtml() {
82
		return noValidationDataHtml;
82
		return noValidationDataHtml;
83
	}
83
	}
84
 
84
 
85
	public HTML getProposeValidationDataHtml() {
85
	public HTML getProposeValidationDataHtml() {
86
		return proposeValidationDataHtml;
86
		return proposeValidationDataHtml;
87
	}
87
	}
88
 
88
 
89
	public Panel getRatePanel() {
89
	public Panel getRatePanel() {
90
		return ratePanel;
90
		return ratePanel;
91
	}
91
	}
92
 
92
 
93
}
93
}