3,6 → 3,7 |
|
*/ |
|
|
/* |
* ListeObservationsVue.java (Composite de Panel) |
* |
28,6 → 29,7 |
* Suppression d'une liste d'element |
*/ |
|
|
/* Actions declenchees : |
* |
* onInventoryItemSelected(numero d'ordre de la ligne selectionne) : selection d'une ligne |
36,8 → 38,9 |
* |
*/ |
|
|
package org.tela_botanica.client.observation; |
|
|
import org.tela_botanica.client.modeles.Observation; |
|
import com.google.gwt.user.client.ui.Button; |
50,13 → 53,17 |
import com.google.gwt.user.client.ui.Label; |
import com.google.gwt.user.client.ui.Widget; |
|
public class ListeObservationsVue extends Composite { |
|
public class ListeObservationsVue extends Composite |
{ |
|
// Debut Barre de navigation |
|
private class NavBar extends Composite implements ClickListener { |
|
|
public final DockPanel bar = new DockPanel(); |
|
|
public final Button gotoFirst = new Button("<<", this); |
public final Button gotoNext = new Button(">", this); |
63,29 → 70,31 |
public final Button gotoPrev = new Button("<", this); |
public final Button gotoEnd = new Button(">>", this); |
public final Label status = new Label(); |
|
|
public NavBar() { |
|
|
initWidget(bar); |
|
|
status.setWordWrap(false); |
|
HorizontalPanel buttons = new HorizontalPanel(); |
|
|
buttons.add(status); |
buttons.setCellHorizontalAlignment(status, |
HasHorizontalAlignment.ALIGN_RIGHT); |
buttons.setCellVerticalAlignment(status, |
HasVerticalAlignment.ALIGN_MIDDLE); |
buttons.setCellHorizontalAlignment(status, HasHorizontalAlignment.ALIGN_RIGHT); |
buttons.setCellVerticalAlignment(status, HasVerticalAlignment.ALIGN_MIDDLE); |
|
|
buttons.add(gotoFirst); |
buttons.add(gotoPrev); |
buttons.add(gotoNext); |
buttons.add(gotoEnd); |
|
|
bar.add(buttons, DockPanel.EAST); |
|
|
} |
|
|
public void onClick(Widget sender) { |
if (sender == gotoNext) { |
117,10 → 126,10 |
// Fin Barre de navigation |
|
// Conteneur (header et table sont dans panel) |
// private ContentPanel panel =null; |
// private Table table = null; |
|
// Services |
// private ContentPanel panel =null; |
// private Table table = null; |
|
// Services |
private String serviceBaseUrl = null; |
private String user; |
private ObservationMediateur observationMediateur = null; |
129,10 → 138,10 |
private int startIndex = 0; |
private int count = 0; |
private static final int VISIBLE_TAXON_COUNT = 15; |
private NavBar navBar = null; |
private NavBar navBar=null; |
|
// Filtre par defaut : |
|
|
private String identifiantLocalite = "all"; |
private String localite = "all"; |
private String annee = "all"; |
140,150 → 149,183 |
private String jour = "all"; |
private String rechercheLibre = "all"; |
private String lieudit = "all"; |
private String ordre = null; |
private String ordre= null; |
|
|
|
|
public ListeObservationsVue(ObservationMediateur observationMediateur) { |
|
|
|
// Traitement contexte utilisateur et service |
|
this.observationMediateur = observationMediateur; |
this.observationMediateur=observationMediateur; |
|
// panel= new ContentPanel(Style.HEADER); |
// panel.setLayout(new FillLayout()); |
|
// panel= new ContentPanel(Style.HEADER); |
// panel.setLayout(new FillLayout()); |
|
|
// Barre navigation integree au header |
|
navBar = new NavBar(); |
// panel.getHeader().addWidget(navBar); |
|
// Barre navigation integree au header |
|
// Contenu : |
|
|
// Colonnes : |
|
// TableColumn[] columns = new TableColumn[6]; |
|
// TODO : renderer date, alignement etc |
/* |
columns[0] = new TableColumn("etat","Aransmis", 50); |
|
navBar = new NavBar(); |
// panel.getHeader().addWidget(navBar); |
columns[1] = new TableColumn("nom","Nom saisi", 250); |
|
columns[2] = new TableColumn("nomr","Nom retenu", 250); |
|
// Contenu : |
columns[3] = new TableColumn("lieu","Lieu", 350); |
|
// Colonnes : |
columns[4] = new TableColumn("date","Date", 75); |
|
// TableColumn[] columns = new TableColumn[6]; |
columns[5] = new TableColumn("ordre","Ordre", 50); |
|
|
TableColumnModel cm = new TableColumnModel(columns); |
|
// Table : |
|
table = new Table(Style.MULTI | Style.HORIZONTAL, cm); |
table.setBorders(false); |
|
|
panel.add(table); |
|
|
|
// TODO : renderer date, alignement etc |
/* |
* columns[0] = new TableColumn("etat","Aransmis", 50); |
* |
* columns[1] = new TableColumn("nom","Nom saisi", 250); |
* |
* columns[2] = new TableColumn("nomr","Nom retenu", 250); |
* |
* columns[3] = new TableColumn("lieu","Lieu", 350); |
* |
* columns[4] = new TableColumn("date","Date", 75); |
* |
* columns[5] = new TableColumn("ordre","Ordre", 50); |
* |
* |
* TableColumnModel cm = new TableColumnModel(columns); |
* // Table : |
* |
* table = new Table(Style.MULTI | Style.HORIZONTAL, cm); |
* table.setBorders(false); |
* |
* |
* panel.add(table); |
* |
* |
* // Selection d'une ligne table.addListener(Events.RowClick, new |
* Listener() { |
* |
* public void handleEvent(BaseEvent be) { TableItem item=(TableItem) |
* be.item; if (item!=null) { if (ordre==null) { // Affichage de la |
* ligne selectionne ordre= (String) item.getValue(5); // |
* observationMediateur.onInventoryItemSelected(ordre); } else { // Si |
* une ligne etait deja selectionne if (ordre.compareTo((String) |
* item.getValue(5))==0) { // C'est la meme, on la deselectionne |
* ordre=null; table.deselect(be.rowIndex); // |
* observationMediateur.onInventoryItemUnselected(); } else { ordre= |
* (String) item.getValue(5); // C'est une autre, on la selectionne // |
* observationMediateur.onInventoryItemSelected(ordre); } |
* } } } }); |
*/ |
// Selection d'une ligne |
table.addListener(Events.RowClick, new Listener() { |
|
// initWidget(panel); |
public void handleEvent(BaseEvent be) { |
TableItem item=(TableItem) be.item; |
if (item!=null) { |
if (ordre==null) { // Affichage de la ligne selectionne |
ordre= (String) item.getValue(5); |
// observationMediateur.onInventoryItemSelected(ordre); |
} |
else { |
// Si une ligne etait deja selectionne |
if (ordre.compareTo((String) item.getValue(5))==0) { // C'est la meme, on la deselectionne |
ordre=null; |
table.deselect(be.rowIndex); |
// observationMediateur.onInventoryItemUnselected(); |
} |
else { |
ordre= (String) item.getValue(5); // C'est une autre, on la selectionne |
// observationMediateur.onInventoryItemSelected(ordre); |
} |
|
} |
} |
} |
}); |
*/ |
|
// initWidget(panel); |
|
|
} |
|
|
|
/** |
* Suppression d'un ensemble d'element de la liste d'inventaire, on garde |
* ici car s'applique a plusieurs elements |
* Suppression d'un ensemble d'element de la liste d'inventaire, on garde ici car s'applique a plusieurs elements |
* |
*/ |
|
public void deleteElement() { |
/* |
* setStatusDisabled(); TableItem[] selection=table.getSelection(); |
* |
* StringBuffer ids=new StringBuffer(); for (int i = 0; i < |
* selection.length; i++) { ids.append((String)(((TableItem) |
* selection[i]).getValue(5))); if (i<(selection.length-1)) |
* ids.append(","); } |
* |
* if (ids.length()>0) { |
* |
* HTTPRequest.asyncPost(serviceBaseUrl + "/Inventory/" + user + "/" + |
* ids.toString(), "action=DELETE", |
* |
* new ResponseTextHandler() { public void onCompletion(String str) { // |
* observationMediateur.onInventoryUpdated(identifiantLocalite,"all","all"); // |
* observationMediateur.getEntryView().clear(); } }); } |
* |
* setStatusEnabled(); |
*/ |
/* |
setStatusDisabled(); |
TableItem[] selection=table.getSelection(); |
|
StringBuffer ids=new StringBuffer(); |
for (int i = 0; i < selection.length; i++) { |
ids.append((String)(((TableItem) selection[i]).getValue(5))); |
if (i<(selection.length-1)) ids.append(","); |
} |
|
if (ids.length()>0) { |
|
HTTPRequest.asyncPost(serviceBaseUrl + "/Inventory/" + user |
+ "/" + ids.toString(), "action=DELETE", |
|
new ResponseTextHandler() { |
public void onCompletion(String str) { |
// observationMediateur.onInventoryUpdated(identifiantLocalite,"all","all"); |
// observationMediateur.getEntryView().clear(); |
} |
}); |
} |
|
setStatusEnabled(); |
*/ |
} |
|
|
|
|
|
/** |
* Transmission de releve a Tela, on garde ici car s'applique a plusieurs |
* elements |
* Transmission de releve a Tela, on garde ici car s'applique a plusieurs elements |
*/ |
|
|
public void transmitElement() { |
|
|
setStatusDisabled(); |
|
/* TableItem[] selection=table.getSelection(); |
|
/* |
* TableItem[] selection=table.getSelection(); |
* |
* StringBuffer ids=new StringBuffer(); for (int i = 0; i < |
* selection.length; i++) { ids.append((String)(((TableItem) |
* selection[i]).getValue(5))); if (i<(selection.length-1)) |
* ids.append(","); } |
* |
* if (ids.length()>0) { |
* |
* HTTPRequest.asyncPost(serviceBaseUrl + "/InventoryTransmit/" + user + |
* "/" + ids.toString(), "transmission=1", |
* |
* new ResponseTextHandler() { public void onCompletion(String str) { |
* getListeObservation(); // Pour affichage logo } }); } |
* |
* setStatusEnabled(); |
* |
*/ |
StringBuffer ids=new StringBuffer(); |
for (int i = 0; i < selection.length; i++) { |
ids.append((String)(((TableItem) selection[i]).getValue(5))); |
if (i<(selection.length-1)) ids.append(","); |
} |
|
if (ids.length()>0) { |
|
HTTPRequest.asyncPost(serviceBaseUrl + "/InventoryTransmit/" + user |
+ "/" + ids.toString(), "transmission=1", |
|
new ResponseTextHandler() { |
public void onCompletion(String str) { |
getListeObservation(); // Pour affichage logo |
} |
}); |
} |
|
setStatusEnabled(); |
|
*/ |
} |
|
|
|
/** |
* Recherche nombre d'enregistrement pour l'utilisateur et la localite en |
* cours |
* Recherche nombre d'enregistrement pour l'utilisateur et la localite en cours |
* |
*/ |
|
|
public void initialiser() { |
|
|
setStatusDisabled(); |
|
// observationMediateur.addListener(ObservationMediateur.NOMBRE_OBSERVATION,this); |
observationMediateur.getNombreObservation(identifiantLocalite, |
localite, annee, mois, jour, lieudit, rechercheLibre); // Retour |
// dans |
// handlevent() |
// NOMBRE_OBSERVATION |
// observationMediateur.addListener(ObservationMediateur.NOMBRE_OBSERVATION,this); |
observationMediateur.getNombreObservation(identifiantLocalite,localite,annee, mois, jour ,lieudit,rechercheLibre); // Retour dans handlevent() NOMBRE_OBSERVATION |
|
|
} |
|
|
/** |
* Mise a jour de l'affichage, a partir des donnaes d'inventaire deja |
* saisies. La valeur de this.startIndex permet de determiner quelles |
293,189 → 335,264 |
|
public void getListeObservation() { |
|
// observationMediateur.addListener(ObservationMediateur.LISTE_OBSERVATION,this); |
observationMediateur.getListeObservation(identifiantLocalite, localite, |
annee, mois, jour, lieudit, rechercheLibre, startIndex, |
VISIBLE_TAXON_COUNT); // Retour dans handlevent() |
// LISTE_OBSERVATION |
|
// observationMediateur.addListener(ObservationMediateur.LISTE_OBSERVATION,this); |
observationMediateur.getListeObservation(identifiantLocalite,localite,annee, mois, jour ,lieudit,rechercheLibre, startIndex, VISIBLE_TAXON_COUNT); // Retour dans handlevent() LISTE_OBSERVATION |
|
} |
|
|
public void afficherListeObservation() { |
|
Observation[] listeObservation = observationMediateur.getObservation() |
.getListeObservation(); |
Observation[] listeObservation =observationMediateur.getObservation().getListeObservation(); |
|
for (int i=0;i<listeObservation.length;i++) { |
|
Object[] values = new Object[6]; |
values[0]="0"; |
values[2]="2"; |
values[3]="3"; |
values[4]="4"; |
values[5]="5"; |
values[1]=listeObservation[i].getNomSaisi(); |
|
// table.add(new TableItem(values)); |
|
} |
|
// Ligne d'information |
|
for (int i = 0; i < listeObservation.length; i++) { |
// Toutes date par defaut |
/* |
|
Object[] values = new Object[6]; |
values[0] = "0"; |
values[2] = "2"; |
values[3] = "3"; |
values[4] = "4"; |
values[5] = "5"; |
values[1] = listeObservation[i].getNomSaisi(); |
HTTPRequest.asyncGet(serviceBaseUrl + "/InventoryItemList/" + user + "/" + identifiantLocalite + "/" + URL.encodeComponent(localite) +"/" + annee + "/" + mois + "/" + jour + "/" + URL.encodeComponent(rechercheLibre) + "/" + URL.encodeComponent(lieudit) + "/" |
+ startIndex + "/" + VISIBLE_TAXON_COUNT, |
|
// table.add(new TableItem(values)); |
new ResponseTextHandler() { |
|
} |
public void onCompletion(String str) { |
|
// Ligne d'information |
JSONValue jsonValue = JSONParser.parse(str); |
JSONArray jsonArray; |
JSONArray jsonArrayNested; |
|
int i=0; |
|
// Toutes date par defaut |
if ((jsonArray = jsonValue.isArray()) != null) { |
|
StringBuffer lieu=null; |
|
int arraySize = jsonArray.size(); |
|
for (i = 0; i < arraySize; ++i) { |
if ((jsonArrayNested = jsonArray.get(i).isArray()) != null) { |
|
|
Object[] values = new Object[6]; |
|
|
// Statut Observation transmise ? |
|
String atransmit=((JSONString) jsonArrayNested .get(13)).stringValue(); |
|
if (atransmit.compareTo("1")==0) { |
values[0] = new Image("tela.gif"); |
} |
else { |
values[0] = new HTML(" "); |
} |
|
|
// Nom saisi |
|
values[1] = new HTML("<b>"+Util.toCelString(((JSONString) jsonArrayNested .get(0)).toString())+"</b>"); |
|
|
|
// Nom retenu |
String aname=Util.toCelString(((JSONString) jsonArrayNested .get(2)).toString()); |
|
if (aname.compareTo("null")==0) { |
values[2] = new HTML(" "); |
} |
else { |
values[2] = new HTML(aname); |
} |
/* |
|
/* |
// Num nomenclatural |
String ann=((JSONString) jsonArrayNested .get(3)).stringValue(); |
|
if (ann.compareTo("0")!=0) { |
observationText.append(""+ann+"-"); |
} |
else { |
observationText.append("0-"); |
} |
|
|
// Num Taxonomique |
|
String ant=((JSONString) jsonArrayNested .get(4)).stringValue(); |
|
if (ant.compareTo("0")!=0) { |
observationText.append(ant+", "); |
} |
else { |
observationText.append("0, "); |
} |
|
// Famille |
|
|
String afamily=Util.toCelString(((JSONString) jsonArrayNested .get(5)).toString()); |
|
if (afamily.compareTo("null")==0) { |
// |
} |
else { |
observationText.append(afamily+", "); |
} |
*/ |
/* |
* |
* HTTPRequest.asyncGet(serviceBaseUrl + "/InventoryItemList/" + user + |
* "/" + identifiantLocalite + "/" + URL.encodeComponent(localite) +"/" + |
* annee + "/" + mois + "/" + jour + "/" + |
* URL.encodeComponent(rechercheLibre) + "/" + |
* URL.encodeComponent(lieudit) + "/" + startIndex + "/" + |
* VISIBLE_TAXON_COUNT, |
* |
* new ResponseTextHandler() { |
* |
* public void onCompletion(String str) { |
* |
* JSONValue jsonValue = JSONParser.parse(str); JSONArray jsonArray; |
* JSONArray jsonArrayNested; |
* |
* int i=0; |
* |
* if ((jsonArray = jsonValue.isArray()) != null) { |
* |
* StringBuffer lieu=null; |
* |
* int arraySize = jsonArray.size(); |
* |
* for (i = 0; i < arraySize; ++i) { if ((jsonArrayNested = |
* jsonArray.get(i).isArray()) != null) { |
* |
* |
* Object[] values = new Object[6]; |
* |
* // Statut Observation transmise ? |
* |
* String atransmit=((JSONString) jsonArrayNested |
* .get(13)).stringValue(); |
* |
* if (atransmit.compareTo("1")==0) { values[0] = new Image("tela.gif"); } |
* else { values[0] = new HTML(" "); } |
* |
* // Nom saisi |
* |
* values[1] = new HTML("<b>"+Util.toCelString(((JSONString) |
* jsonArrayNested .get(0)).toString())+"</b>"); |
* |
* |
* // Nom retenu String aname=Util.toCelString(((JSONString) |
* jsonArrayNested .get(2)).toString()); |
* |
* if (aname.compareTo("null")==0) { values[2] = new HTML(" "); } |
* else { values[2] = new HTML(aname); } /* |
* /* // Num nomenclatural String ann=((JSONString) jsonArrayNested |
* .get(3)).stringValue(); |
* |
* if (ann.compareTo("0")!=0) { observationText.append(""+ann+"-"); } |
* else { observationText.append("0-"); } |
* |
* // Num Taxonomique |
* |
* String ant=((JSONString) jsonArrayNested .get(4)).stringValue(); |
* |
* if (ant.compareTo("0")!=0) { observationText.append(ant+", "); } else { |
* observationText.append("0, "); } |
* // Famille |
* |
* |
* String afamily=Util.toCelString(((JSONString) jsonArrayNested |
* .get(5)).toString()); |
* |
* if (afamily.compareTo("null")==0) { // } else { |
* observationText.append(afamily+", "); } |
*/ |
/* |
* // Localisation - Lieu |
* |
* lieu=new StringBuffer(); |
* |
* String aloc=Util.toCelString(((JSONString) jsonArrayNested |
* .get(6)).toString()); |
* |
* if (aloc.compareTo("000null")==0) { if (lieu.length()==0) { |
* lieu.append("Commune absente"); } else { lieu.append("commune |
* absente"); } } else { if (lieu.length()==0) { lieu.append("Commune de |
* "+aloc); } else { lieu.append("commune de "+aloc); } |
* } |
* |
* |
* String alieudit=Util.toCelString(((JSONString) jsonArrayNested |
* .get(9)).toString()); |
* // Localisation - Lieu dit |
* |
* if (alieudit.compareTo("000null")!=0) { lieu.append(", "+alieudit); } |
* |
* // Station - |
* |
* String astation=Util.toCelString(((JSONString) jsonArrayNested |
* .get(10)).toString()); |
* |
* |
* if (astation.compareTo("000null")!=0) { lieu.append(", "+astation); } |
* |
* // Milieu |
* |
* String amilieu=Util.toCelString(((JSONString) jsonArrayNested |
* .get(11)).toString()); |
* |
* |
* if (amilieu.compareTo("000null")!=0) { lieu.append(", "+amilieu); } |
* |
* String acomment=Util.toCelString(((JSONString) jsonArrayNested |
* .get(12)).toString()); // Commentaire |
* |
* if (acomment.compareTo("null")!=0) { lieu.append(", "+acomment); } |
* |
* |
* if (lieu.toString().compareTo("")==0) { values[3] = new |
* HTML(" "); } else { values[3] = new HTML(lieu.toString()); } |
* |
* |
* String adate=((JSONString) jsonArrayNested .get(8)).stringValue(); |
* // Date if (adate.compareTo("0000-00-00 00:00:00")!=0) { |
* values[4]=new HTML("<b>"+adate+"</b>"); } else { values[4] = new |
* HTML(" "); } |
* |
* |
* |
* String aordre=((JSONString) jsonArrayNested.get(7)).stringValue(); |
* // Numero d'ordre (cache) |
* |
* values[5] = aordre; |
* |
* |
* |
* |
* if (i>=table.getItemCount()) { TableItem item = new |
* TableItem(values); table.add(item); } else { TableItem |
* item=table.getItem(i); item.setValue(0,values[0]); |
* item.setValue(1,values[1]); item.setValue(2,values[2]); |
* item.setValue(3,values[3]); item.setValue(4,values[4]); |
* item.setValue(5,values[5]); } |
* // Spagetti if (ordre!=null) { if (aordre.compareTo(ordre)==0) { |
* table.select(i); } else { table.deselect(i); } } |
* } |
* } } |
* // Suppression fin ancien affichage if (i<table.getItemCount()) { |
* for (int j = table.getItemCount() -1 ; j >= i; j--) { TableItem |
* item=table.getItem(j); table.remove(item); } } |
* |
* setStatusEnabled(); |
* |
* } }); |
*/ |
|
// Localisation - Lieu |
|
lieu=new StringBuffer(); |
|
String aloc=Util.toCelString(((JSONString) jsonArrayNested .get(6)).toString()); |
|
if (aloc.compareTo("000null")==0) { |
if (lieu.length()==0) { |
lieu.append("Commune absente"); |
} |
else { |
lieu.append("commune absente"); |
} |
} |
else { |
if (lieu.length()==0) { |
lieu.append("Commune de "+aloc); |
} |
else { |
lieu.append("commune de "+aloc); |
} |
|
} |
|
|
String alieudit=Util.toCelString(((JSONString) jsonArrayNested .get(9)).toString()); |
|
// Localisation - Lieu dit |
|
if (alieudit.compareTo("000null")!=0) { |
lieu.append(", "+alieudit); |
} |
|
|
// Station - |
|
String astation=Util.toCelString(((JSONString) jsonArrayNested .get(10)).toString()); |
|
|
if (astation.compareTo("000null")!=0) { |
lieu.append(", "+astation); |
} |
|
|
// Milieu |
|
String amilieu=Util.toCelString(((JSONString) jsonArrayNested .get(11)).toString()); |
|
|
if (amilieu.compareTo("000null")!=0) { |
lieu.append(", "+amilieu); |
} |
|
String acomment=Util.toCelString(((JSONString) jsonArrayNested .get(12)).toString()); |
// Commentaire |
|
if (acomment.compareTo("null")!=0) { |
lieu.append(", "+acomment); |
} |
|
|
if (lieu.toString().compareTo("")==0) { |
values[3] = new HTML(" "); |
} |
else { |
values[3] = new HTML(lieu.toString()); |
} |
|
|
String adate=((JSONString) jsonArrayNested .get(8)).stringValue(); |
|
// Date |
if (adate.compareTo("0000-00-00 00:00:00")!=0) { |
values[4]=new HTML("<b>"+adate+"</b>"); |
} |
else { |
values[4] = new HTML(" "); |
} |
|
|
|
String aordre=((JSONString) jsonArrayNested.get(7)).stringValue(); |
|
// Numero d'ordre (cache) |
|
values[5] = aordre; |
|
|
|
|
if (i>=table.getItemCount()) { |
TableItem item = new TableItem(values); |
table.add(item); |
} |
else { |
TableItem item=table.getItem(i); |
item.setValue(0,values[0]); |
item.setValue(1,values[1]); |
item.setValue(2,values[2]); |
item.setValue(3,values[3]); |
item.setValue(4,values[4]); |
item.setValue(5,values[5]); |
} |
|
// Spagetti |
if (ordre!=null) { |
if (aordre.compareTo(ordre)==0) { |
table.select(i); |
} |
else { |
table.deselect(i); |
} |
} |
|
} |
|
} |
} |
|
// Suppression fin ancien affichage |
if (i<table.getItemCount()) { |
for (int j = table.getItemCount() -1 ; j >= i; j--) { |
TableItem item=table.getItem(j); |
table.remove(item); |
} |
} |
|
setStatusEnabled(); |
|
|
} |
}); |
*/ |
|
|
} |
|
|
/** |
* Affichage message d'attente et desactivation navigation |
* |
505,20 → 622,18 |
if (count > 0) { |
|
if (startIndex >= VISIBLE_TAXON_COUNT) { // Au dela de la |
// premiere page |
// premiere page |
navBar.gotoPrev.setEnabled(true); |
navBar.gotoFirst.setEnabled(true); |
if (startIndex < (count - VISIBLE_TAXON_COUNT)) { // Pas la |
// derniere |
// page |
// derniere |
// page |
navBar.gotoNext.setEnabled(true); |
navBar.gotoEnd.setEnabled(true); |
navBar.status.setText((startIndex + 1) + " - " |
+ (startIndex + VISIBLE_TAXON_COUNT) + " sur " |
+ count); |
+ (startIndex + VISIBLE_TAXON_COUNT) + " sur " + count ); |
} else { // Derniere page |
navBar.status.setText((startIndex + 1) + " - " + count |
+ " sur " + count); |
navBar.status.setText((startIndex + 1) + " - " + count + " sur " + count ); |
} |
} else { // Premiere page |
if (count > VISIBLE_TAXON_COUNT) { // Des pages derrieres |
525,11 → 640,9 |
navBar.gotoNext.setEnabled(true); |
navBar.gotoEnd.setEnabled(true); |
navBar.status.setText((startIndex + 1) + " - " |
+ (startIndex + VISIBLE_TAXON_COUNT) + " sur " |
+ count); |
+ (startIndex + VISIBLE_TAXON_COUNT) + " sur " + count); |
} else { |
navBar.status.setText((startIndex + 1) + " - " + count |
+ " sur " + count); |
navBar.status.setText((startIndex + 1) + " - " + count + " sur " + count); |
} |
} |
} |
543,7 → 656,8 |
* Positionnement index de parcours (this.startIndex) pour affichage de la |
* derniere page |
* |
* @param @return void |
* @param |
* @return void |
*/ |
|
private void gotoEnd() { |
560,31 → 674,37 |
* Recherche en cours |
* |
*/ |
|
|
public void setRechercheLibre(String search) { |
this.rechercheLibre = search; |
} |
|
|
|
/* |
* Departement en cours |
* Departement en cours |
* |
*/ |
|
|
public void setIdLocation(String id_location) { |
this.identifiantLocalite = id_location; |
} |
|
|
|
/* |
* Localite en cours |
* Localite en cours |
* |
*/ |
|
|
public void setLocalite(String location) { |
this.localite = location; |
} |
|
|
|
/* |
* Lieudit en cours |
* Lieudit en cours |
* |
*/ |
|
592,15 → 712,19 |
this.lieudit = lieudit; |
} |
|
|
|
/* |
* Date en cours |
* Date en cours |
* |
*/ |
|
|
public void setAnnee(String year) { |
this.annee = year; |
} |
|
|
public void setMois(String month) { |
this.mois = month; |
} |
609,144 → 733,184 |
this.jour = day; |
} |
|
|
/* |
* Utilisateur en cours |
* Utilisateur en cours |
* |
*/ |
|
|
|
public void setUser(String user) { |
this.user = user; |
} |
|
|
public void displayFilter() { |
|
|
|
// Mise a jour boutton export feuille de calcul |
|
// Mise a jour boutton export feuille de calcul |
|
/* |
* observationMediateur.getActionView().getExportButton().setHTML("<a |
* href=\""+observationMediateur.getServiceBaseUrl()+"/InventoryExport/" + |
* user + "/" + URL.encodeComponent(identifiantLocalite) + "/" + |
* URL.encodeComponent(localite) + "/" + URL.encodeComponent(lieudit)+ |
* "/" + annee + "/" + mois + "/" + jour + "\">"+"Export tableur</a>"); |
* |
*/ |
// Mise a jour ligne de selection |
observationMediateur.getActionView().getExportButton().setHTML("<a href=\""+observationMediateur.getServiceBaseUrl()+"/InventoryExport/" |
+ user + "/" |
+ URL.encodeComponent(identifiantLocalite) + "/" |
+ URL.encodeComponent(localite) + "/" |
+ URL.encodeComponent(lieudit)+ "/" |
+ annee + "/" |
+ mois + "/" |
+ jour |
+ "\">"+"Export tableur</a>"); |
|
String dep; |
if (identifiantLocalite.compareTo("all") == 0) { |
dep = "Tous départements"; |
} else { |
if (identifiantLocalite.compareTo("000null") == 0) { |
dep = "Départements non renseignées "; |
} else { |
dep = "Département " + identifiantLocalite; |
} |
*/ |
// Mise a jour ligne de selection |
|
|
|
String dep; |
if (identifiantLocalite.compareTo("all")==0) { |
dep="Tous départements"; |
} |
else { |
if (identifiantLocalite.compareTo("000null")==0) { |
dep="Départements non renseignées "; |
} |
|
String com; |
if (localite.compareTo("all") == 0) { |
com = ", toutes communes"; |
} else { |
if (localite.compareTo("000null") == 0) { |
com = ", communes non renseignées"; |
} else { |
com = ", commune de " + localite; |
} |
else { |
dep="Département "+identifiantLocalite; |
} |
|
String lieu; |
|
if (lieudit.compareTo("all") == 0) { |
lieu = ", tous lieux dits"; |
} else { |
if (lieudit.compareTo("000null") == 0) { |
lieu = ", lieu-dit non renseignées"; |
} else { |
lieu = ", lieu-dit " + lieudit; |
} |
} |
|
|
|
String com; |
if (localite.compareTo("all")==0) { |
com=", toutes communes"; |
} |
else { |
if (localite.compareTo("000null")==0) { |
com=", communes non renseignées"; |
} |
else { |
com=", commune de "+localite; |
} |
} |
|
String dat; |
|
if ((annee.compareTo("all") == 0) && (mois.compareTo("all") == 0) |
&& (jour.compareTo("all") == 0)) { |
dat = ", toutes periodes"; |
|
|
String lieu; |
|
if (lieudit.compareTo("all")==0) { |
lieu=", tous lieux dits"; |
} |
else { |
if (lieudit.compareTo("000null")==0) { |
lieu=", lieu-dit non renseignées"; |
} |
|
else { |
lieu=", lieu-dit "+ lieudit; |
} |
} |
|
String dat; |
|
if ((annee.compareTo("all")==0) && (mois.compareTo("all")==0) && (jour.compareTo("all")==0)) { |
dat=", toutes periodes"; |
} |
|
else { |
|
String yea=""; |
String da=""; |
String mont=""; |
|
if (annee.compareTo("all")==0) { |
yea=", toutes années"; |
} |
else { |
if (annee.compareTo("0")==0) { |
yea=", periode non renseignée"; |
} |
else { |
yea=", "+ annee; |
|
if (mois.compareTo("all")==0) { |
mont=", tous mois"; |
} |
else { |
mont="/"+ mois; |
} |
|
|
if (jour.compareTo("all")==0) { |
da=", tous jours"; |
} |
else { |
da="/"+ jour; |
} |
} |
} |
|
dat=yea + mont + da; |
|
} |
|
String yea = ""; |
String da = ""; |
String mont = ""; |
|
//panel.getHeader().setText(dep + com + lieu + dat); |
|
if (annee.compareTo("all") == 0) { |
yea = ", toutes années"; |
} else { |
if (annee.compareTo("0") == 0) { |
yea = ", periode non renseignée"; |
} else { |
yea = ", " + annee; |
|
if (mois.compareTo("all") == 0) { |
mont = ", tous mois"; |
} else { |
mont = "/" + mois; |
} |
|
} |
|
if (jour.compareTo("all") == 0) { |
da = ", tous jours"; |
} else { |
da = "/" + jour; |
} |
} |
} |
|
dat = yea + mont + da; |
|
/// EVENEMENTS |
|
/** |
* Evenements |
* |
*/ |
/* |
public void handleEvent(BaseEvent be) { |
switch (be.type) { |
case ObservationMediateur.NOMBRE_OBSERVATION: |
gotoEnd(); |
getListeObservation(); |
break; |
case ObservationMediateur.LISTE_OBSERVATION: |
afficherListeObservation(); |
break; |
} |
|
// panel.getHeader().setText(dep + com + lieu + dat); |
|
} |
*/ |
|
// / EVENEMENTS |
|
/** |
* Evenements |
* |
*/ |
/* |
* public void handleEvent(BaseEvent be) { switch (be.type) { case |
* ObservationMediateur.NOMBRE_OBSERVATION: gotoEnd(); |
* getListeObservation(); break; case |
* ObservationMediateur.LISTE_OBSERVATION: afficherListeObservation(); |
* break; } } |
*/ |
|
} |
|
/* |
* +--Fin du code |
* ---------------------------------------------------------------------------------------+ |
* $Log: not supported by cvs2svn $ Revision 1.1 2008-09-19 10:27:18 |
* aperonnet Carnet en ligne, utilisant gwt 1.5 et la nouvelle version de |
* gwt-ext (plus de bugs au demarrage dans firefox, plus rapide et annotations |
* java) |
* |
* Revision 1.3 2008-06-17 14:16:16 aperonnet *** empty log message *** |
* |
* Revision 1.2 2008-06-09 16:29:01 ddelon import branche observation |
* |
* Revision 1.1 2008-06-09 14:19:37 ddelon Initialisation observation |
* |
* Revision 1.3 2008-04-28 13:10:43 ddelon Integration MyGwt |
* |
* Revision 1.2 2008-01-30 08:55:40 ddelon fin mise en place mygwt |
* |
* Revision 1.1 2008-01-02 21:26:04 ddelon mise en place mygwt |
* |
* Revision 1.8 2007-12-22 14:48:53 ddelon Documentation et refactorisation |
* |
* Revision 1.7 2007-09-17 19:25:34 ddelon Documentation |
* |
*/ |
/* +--Fin du code ---------------------------------------------------------------------------------------+ |
* $Log: not supported by cvs2svn $ |
* Revision 1.3 2008-06-17 14:16:16 aperonnet |
* *** empty log message *** |
* |
* Revision 1.2 2008-06-09 16:29:01 ddelon |
* import branche observation |
* |
* Revision 1.1 2008-06-09 14:19:37 ddelon |
* Initialisation observation |
* |
* Revision 1.3 2008-04-28 13:10:43 ddelon |
* Integration MyGwt |
* |
* Revision 1.2 2008-01-30 08:55:40 ddelon |
* fin mise en place mygwt |
* |
* Revision 1.1 2008-01-02 21:26:04 ddelon |
* mise en place mygwt |
* |
* Revision 1.8 2007-12-22 14:48:53 ddelon |
* Documentation et refactorisation |
* |
* Revision 1.7 2007-09-17 19:25:34 ddelon |
* Documentation |
* |
*/ |