Subversion Repositories eFlore/Applications.cel

Compare Revisions

Ignore whitespace Rev 275 → Rev 276

/trunk/src/org/tela_botanica/client/vues/observation/FormulaireSaisieObservationVue.java
48,9 → 48,11
import com.gwtext.client.widgets.Viewport;
import com.gwtext.client.widgets.event.BoxComponentListenerAdapter;
import com.gwtext.client.widgets.event.ButtonListenerAdapter;
import com.gwtext.client.widgets.event.ContainerListener;
import com.gwtext.client.widgets.event.ContainerListenerAdapter;
import com.gwtext.client.widgets.event.DatePickerListener;
import com.gwtext.client.widgets.event.DatePickerListenerAdapter;
import com.gwtext.client.widgets.event.PanelListener;
import com.gwtext.client.widgets.event.PanelListenerAdapter;
import com.gwtext.client.widgets.form.ComboBox;
import com.gwtext.client.widgets.form.DateField;
263,10 → 265,6
panneauIntermediaire.setBorder(false);
 
if (Ext.isIE6()) {
panneauIntermediaire.setWidth(800);
}
//create first panel and add fields to it
panneauPremierColonne = new Panel();
panneauPremierColonne.setLayout(new FormLayout());
276,7 → 274,7
panneauSecondeColonne = new Panel();
panneauSecondeColonne.setLayout(new FormLayout());
panneauSecondeColonne.setBorder(false);
this.setPaddings(5) ;
// Accesskey pour debugging
295,7 → 293,6
//commune.setTabIndex(1);
//création du lien "Accès carto" dans le formulaire
basculerverscarto = new HTML("");
basculerverscarto = new HTML(" <a id=\"lien_carto\" href=\"#\" tabindex=\"2\">Localiser</a>");
basculerverscarto.addStyleName("lien_actif");
305,9 → 302,11
tip2.applyTo(basculerverscarto.getElement());
//Sur une meme ligne, ajout de plusieurs champs
final MultiFieldPanel htmlCommunePanel = new MultiFieldPanel();
htmlCommunePanel.addToRow(commune,new ColumnLayoutData(0.5));
htmlCommunePanel.addToRow(basculerverscarto,100);
final MultiFieldPanel htmlCommunePanel = new MultiFieldPanel();
htmlCommunePanel.addToRow(commune,new ColumnLayoutData(0.7));
htmlCommunePanel.addToRow(basculerverscarto,new ColumnLayoutData(0.3));
 
htmlCommunePanel.setBorder(false);
htmlCommunePanel.setId("x-commune-panel");
 
318,22 → 317,42
 
panneauPremierColonne.add(station, new AnchorLayoutData("95%"));
latitude = new TextField("X", "x", 100);
latitude = new TextField("X", "x");
latitude.setGrowMax(200);
latitude.setAllowBlank(true);
longitude = new TextField("Y", "y", 100);
longitude = new TextField("Y", "y");
longitude.setGrowMax(200);
longitude.setAllowBlank(true);
lienSelectionCommune = new Label("");
lienSelectionCommune = new Label();
lienSelectionCommune.setId("conteneur_selection_commune");
lienSelectionCommune.setStyleName("conteneur_selection_commune");
lienSelectionCommune.addStyleName("lien_actif");
// Panneau de type plusieurs champs de formulaire sur une meme ligne, où seront renseignés X/Y
coordPanel = new MultiFieldPanel();
//FormLayout coordFormLayout = new FormLayout();
//coordFormLayout.setLabelWidth(5);
//coordPanel.setLayout(coordFormLayout);
coordPanel.setPaddings(0);
coordPanel.setVisible(false);
coordPanel.addToRow(latitude, new ColumnLayoutData(0.3));
coordPanel.addToRow(longitude, new ColumnLayoutData(0.3));
coordPanel.addToRow(lienSelectionCommune, new ColumnLayoutData(0.4));
final double largeur ;
if(Ext.isIE()) {
largeur = 50;
coordPanel.setPaddings(0, 0, 0, 30);
lienSelectionCommune.addClass("lien_decale");
} else {
largeur = 0.34;
}
coordPanel.addToRow(latitude, new ColumnLayoutData(largeur));
coordPanel.addToRow(longitude, new ColumnLayoutData(largeur));
coordPanel.addToRow(lienSelectionCommune, new ColumnLayoutData(150));
coordPanel.setBorder(false);
//création du champs coordonnées
344,9 → 363,9
coordonnees.setReadOnly(true);
coordonnees.setCls("fieldname");
//création du lien "saisie X/Y" dans le formulaire
//création du lien "saisie X/Y" dans le formulaire
accesformulaire = new HTML("<a id=\"lien_coord\" href=\"#\" tabindex=\"6\">Saisie X/Y ("+referentielGeo+")</a>");
accesformulaire.setWidth("100%");
accesformulaire.addStyleName("lien_actif");
//création info bulle sur le lien "saisie X/Y"
363,7 → 382,13
lienCoord.removeAllListeners();
lienCoord.addListener("click", new EventCallback() {
public void execute(EventObject e) {
coordPanel.setVisible(!coordPanel.isVisible());
if(Ext.isIE()) {
ObservationMediateur.fireResize();
latitude.focus();
}
}
}) ;
386,12 → 411,13
 
});
//Sur une meme ligne, ajout de plusieurs champs
final MultiFieldPanel htmlPanel = new MultiFieldPanel();
htmlPanel.addToRow(coordonnees, 100);
htmlPanel.addToRow(accesformulaire, new ColumnLayoutData(0.5));
htmlPanel.setBorder(false);
htmlPanel.setId("x-coord-panel");
//Sur une meme ligne, ajout de plusieurs champs
final MultiFieldPanel htmlPanel = new MultiFieldPanel();
htmlPanel.addToRow(coordonnees, 100);
htmlPanel.addToRow(accesformulaire, new ColumnLayoutData(0.5));
htmlPanel.setBorder(false);
htmlPanel.setId("x-coord-panel");
panneauPremierColonne.add(htmlPanel);
panneauPremierColonne.add(coordPanel);
439,7 → 465,7
//comment.setTabIndex(7);
panneauSecondeColonne.add(comment, new AnchorLayoutData("95%") );
if (Window.getClientWidth()> Window.getClientHeight()) {
if (Window.getClientWidth() > Window.getClientHeight() || Window.getClientWidth() < 800) {
panneauIntermediaire.add(panneauPremierColonne, new ColumnLayoutData(.5));
panneauIntermediaire.add(panneauSecondeColonne, new ColumnLayoutData(.5));
}
469,11 → 495,11
bt.addField(selecteurMode) ;
if (Ext.isIE6()) {
if (Ext.isIE()) {
panneauPremierColonne.setButtonAlign(Position.RIGHT);
panneauPremierColonne.addButton(boutonOK);
panneauSecondeColonne.setButtonAlign(Position.LEFT);
panneauSecondeColonne.addButton(boutonAnnuler);
panneauPremierColonne.addButton(boutonAnnuler);
}
else {
498,12 → 524,17
this.setAutoScroll(true);
panneauFormulaire.addListener(new PanelListenerAdapter() {
public void onResize(BoxComponent component, int adjWidth, int adjHeight, int rawWidth, int rawHeight) {
panneauIntermediaire.setWidth(rawWidth);
panneauIntermediaire.setHeight(rawHeight);
panneauPremierColonne.doLayout();
panneauSecondeColonne.doLayout();
htmlCommunePanel.doLayout();
htmlPanel.doLayout();
}});
// on ajoute les listeners
935,7 → 966,7
commune.focus();
}
});
}
/**
994,7 → 1025,6
communeData[i][0]= ref.getCommune();
communeData[i][1]= ref.getDepartement();
i++ ;
}
1110,6 → 1140,7
}
lienSelectionCommune.setHtml("<a id=\"lien_selection_commune\" tabindex=\"9\">"+nCommune+"</a>");
lienSelectionCommune.setStyleName("img-curseur-depl");
Ext.get("lien_selection_commune").addListener("click",new EventCallback() {
public void execute(EventObject e) {
rafraichirCommune(infosCom);
1138,8 → 1169,6
 
Ext.get(lienSelectionCommune.getElement()).unmask();
rechercheCommuneEnCours = false;
latModifiee = false;
longModifiee = false;
}
private void rafraichirCommune(EntiteGeographiqueObservation infosCom) {