Subversion Repositories eFlore/Applications.cel

Rev

Rev 84 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
54 david 1
package org.tela_botanica.client.vues;
2
 
3
import org.tela_botanica.client.interfaces.Rafraichissable;
4
import org.tela_botanica.client.observation.ObservationMediateur;
5
 
6
import com.google.gwt.user.client.ui.Image;
7
import com.gwtext.client.widgets.Panel;
8
 
9
/**
10
 * Un panneau affichant la repartition d'une plante
11
 *
12
 * @author David Delon
13
 *
14
 */
15
public class InformationRepartitionVue extends Panel implements Rafraichissable {
16
 
17
	/**
18
	 * Le médiateur associé
19
	 */
20
 
21
	private ObservationMediateur observationMediateur = null;
22
 
23
 
24
	/**
25
	 * l'image à afficher
26
	 */
27
	private Image image = new Image();
28
 
29
 
30
	/**
31
	 * Constructeur sans argument (privé car ne doit pas être utilisé)
32
	 */
33
 
34
	@SuppressWarnings("unused")
35
	private InformationRepartitionVue() {
36
		super();
37
	}
38
 
39
	/**
40
	 * Constructeur avec argument
41
	 * @param obs le médiateur à associer
42
	 */
43
 
44
 
45
	public InformationRepartitionVue(ObservationMediateur obs) {
46
 
47
 
48
		this.observationMediateur = obs;
49
 
50
		image.setPixelSize(150, 150);
51
		add(image);
52
 
53
		// on ajoute les listeners
54
		ajouterListeners();
55
 
56
	}
57
 
58
 
59
	/**
60
	 * Affichage carte de repartition
61
	 *
62
	 */
63
 
64
	public void rafraichir(Object nouvelleDonnees,boolean repandreRaffraichissement) {
65
 
66
		// si on recoit une String contenant une URL
67
		if (nouvelleDonnees instanceof String) {
68
 
69
			String urlImage=(String) nouvelleDonnees;
70
 
71
			if (urlImage.length()==0) {
72
				image.setUrl("");
73
			}
74
			else {
75
				image.setUrl(urlImage);
76
			}
77
		}
78
 
79
	}
80
 
81
 
82
	/**
83
	 * Ajoute les listeners pour la gestions d'évènement
84
	 */
85
	public void ajouterListeners() {
86
 
87
	}
88
 
89
 
90
}