New file |
0,0 → 1,90 |
package org.tela_botanica.client.vues; |
|
import org.tela_botanica.client.interfaces.Rafraichissable; |
import org.tela_botanica.client.observation.ObservationMediateur; |
|
import com.google.gwt.user.client.ui.Image; |
import com.gwtext.client.widgets.Panel; |
|
/** |
* Un panneau affichant la repartition d'une plante |
* |
* @author David Delon |
* |
*/ |
public class InformationRepartitionVue extends Panel implements Rafraichissable { |
|
/** |
* Le médiateur associé |
*/ |
|
private ObservationMediateur observationMediateur = null; |
|
|
/** |
* l'image à afficher |
*/ |
private Image image = new Image(); |
|
|
/** |
* Constructeur sans argument (privé car ne doit pas être utilisé) |
*/ |
|
@SuppressWarnings("unused") |
private InformationRepartitionVue() { |
super(); |
} |
|
/** |
* Constructeur avec argument |
* @param obs le médiateur à associer |
*/ |
|
|
public InformationRepartitionVue(ObservationMediateur obs) { |
|
|
this.observationMediateur = obs; |
|
image.setPixelSize(150, 150); |
add(image); |
|
// on ajoute les listeners |
ajouterListeners(); |
|
} |
|
|
/** |
* Affichage carte de repartition |
* |
*/ |
|
public void rafraichir(Object nouvelleDonnees,boolean repandreRaffraichissement) { |
|
// si on recoit une String contenant une URL |
if (nouvelleDonnees instanceof String) { |
|
String urlImage=(String) nouvelleDonnees; |
|
if (urlImage.length()==0) { |
image.setUrl(""); |
} |
else { |
image.setUrl(urlImage); |
} |
} |
|
} |
|
|
/** |
* Ajoute les listeners pour la gestions d'évènement |
*/ |
public void ajouterListeners() { |
|
} |
|
|
} |