6,6 → 6,7 |
import java.util.Iterator; |
|
import org.tela_botanica.client.CarnetEnLigneMediateur; |
import org.tela_botanica.client.Util; |
import org.tela_botanica.client.interfaces.Rafraichissable; |
import org.tela_botanica.client.modeles.Configuration; |
import org.tela_botanica.client.modeles.EntiteGeographiqueObservation; |
17,6 → 18,9 |
import org.tela_botanica.client.modeles.ReferentielNom; |
import org.tela_botanica.client.observation.ObservationMediateur; |
|
import com.google.gwt.core.client.GWT; |
import com.google.gwt.core.client.JavaScriptObject; |
import com.google.gwt.event.dom.client.KeyPressEvent; |
import com.google.gwt.maps.client.geom.LatLng; |
import com.google.gwt.user.client.Timer; |
import com.google.gwt.user.client.Window; |
37,6 → 41,7 |
import com.gwtext.client.data.StringFieldDef; |
import com.gwtext.client.widgets.BoxComponent; |
import com.gwtext.client.widgets.Button; |
import com.gwtext.client.widgets.Component; |
import com.gwtext.client.widgets.Container; |
import com.gwtext.client.widgets.DatePicker; |
import com.gwtext.client.widgets.Panel; |
54,7 → 59,10 |
import com.gwtext.client.widgets.form.MultiFieldPanel; |
import com.gwtext.client.widgets.form.TextArea; |
import com.gwtext.client.widgets.form.TextField; |
import com.gwtext.client.widgets.form.event.ComboBoxCallback; |
import com.gwtext.client.widgets.form.event.ComboBoxListener; |
import com.gwtext.client.widgets.form.event.ComboBoxListenerAdapter; |
import com.gwtext.client.widgets.form.event.TextFieldListener; |
import com.gwtext.client.widgets.form.event.TextFieldListenerAdapter; |
import com.gwtext.client.widgets.layout.AnchorLayoutData; |
import com.gwtext.client.widgets.layout.ColumnLayout; |
380,16 → 388,12 |
|
public void execute(EventObject e) { |
|
if(coordonneesValides() != null) { |
obtenirInformationCoord(); |
if(commune.getValue() != null && !commune.getValue().equals("") && !getDepartement().equals("")) { |
obtenirInformationCommune(); |
longlatAjoutee = true; |
|
} else { |
if(commune.getValue() != null && !commune.getValue().equals("")) { |
obtenirInformationCommune(); |
longlatAjoutee = true; |
|
} else { |
Window.alert("Veuillez renseigner une commune ou des coordonnées"); |
} |
Window.alert("Veuillez renseigner une commune et un numéro de département sous la forme : Commune (departement)"); |
} |
} |
}); |
552,12 → 556,17 |
commune.setValue(record.getAsString("commune")); |
departement=record.getAsString("departement"); |
selectionCommune=true; |
commune.collapse(); |
} |
|
public void onExpand(ComboBox comboBox) { |
comboBox.focus(); |
} |
}); |
|
|
ListenerConfig listenerConfigCommune=new ListenerConfig(); |
listenerConfigCommune.setDelay(10); |
listenerConfigCommune.setDelay(200); |
listenerConfigCommune.setStopPropagation(false); |
listenerConfigCommune.setStopEvent(false); |
|
600,6 → 609,7 |
default: |
|
departement=""; |
commune.collapse(); |
obtenirListeReferentielCommune(); |
communeModifiee= true; |
|
1035,12 → 1045,11 |
|
final MemoryProxy dataProxy = new MemoryProxy(communeData); |
final ArrayReader reader = new ArrayReader(rd); |
|
Store store=new Store(dataProxy,reader); |
commune.setStore(store); |
store.load(); |
|
Store store=new Store(dataProxy,reader); |
store.load() ; |
|
commune.setStore(store); |
commune.expand(); |
} |
|
// si l'on a reçu une liste du référentiel nom (complétion referentiel nom) |
1752,7 → 1761,7 |
} |
|
private void obtenirInformationCommune() { |
observationMediateur.obtenirInformationCommune(commune.getValue(), obtenirDepartementAPartirChampCommune()); |
observationMediateur.obtenirInformationCommune(getCommune(), obtenirDepartementAPartirChampCommune()); |
} |
|
public double[] coordonneesValides() { |
1786,6 → 1795,10 |
|
String dep = ""; |
|
if(departement == null) { |
departement = ""; |
} |
|
if(departement.equals("000null") || departement.equals("")) { |
|
String[] depCom = commune.getText().split(" "); |
1823,12 → 1836,22 |
} |
|
public String getCommune() { |
return commune.getValue(); |
|
String valeurCommune = ""; |
|
if(commune.getValue() != null) { |
valeurCommune = commune.getValue(); |
} |
return valeurCommune; |
} |
|
public String getDepartement() { |
return obtenirDepartementAPartirChampCommune(); |
} |
|
public String getCommuneSansDepartement() { |
return Util.supprimerNumDepartementChaineLocalite(getCommune()); |
} |
|
public boolean communeInitialisee() { |
return communeModifiee; |