/trunk/src/org/tela_botanica/client/CenterPanel.java |
---|
1,5 → 1,20 |
/** |
David Delon david.delon@clapas.net 2007 |
*/ |
/* |
* CenterPanel.java (Container de liste de releve) |
* |
* Cas d'utilisation : |
* |
* 1: Le programme initialise la classe controlant l'affichage de la liste des objets |
* |
*/ |
package org.tela_botanica.client; |
import com.google.gwt.user.client.ui.Composite; |
import com.google.gwt.user.client.ui.VerticalPanel; |
6,10 → 21,6 |
import org.tela_botanica.client.InventoryItemList; |
/** |
* Composite permet de wrapper des Widgett pour creer un nouveau Widget cf methode initWidget() |
*/ |
public class CenterPanel extends Composite { |
17,9 → 28,7 |
public CenterPanel(Mediator mediator) { |
inventoryItemList = new InventoryItemList(mediator); |
inventoryItemList.setStyleName("inventoryItemList"); |
VerticalPanel outer = new VerticalPanel(); |
31,5 → 40,11 |
} |
/* +--Fin du code ---------------------------------------------------------------------------------------+ |
* $Log$ |
* |
*/ |
/trunk/src/org/tela_botanica/client/LocationAssistant.java |
---|
41,7 → 41,7 |
autoCompletebox.setWidth("100%"); |
initWidget(panel); |
autoCompletebox.addAutoCompleteAsyncTextBoxListener(mediator.getInventoryItemList()); |
autoCompletebox.addAutoCompleteAsyncTextBoxListener(mediator); |
} |
/trunk/src/org/tela_botanica/client/Cel.java |
---|
1,3 → 1,21 |
/** |
David Delon david.delon@clapas.net 2007 |
*/ |
/* |
* Cel.java (Point d'entree de l'application carnet en ligne) |
* |
* Cas d'utilisation : |
* Initialisation de l'application |
* |
* 1: Le programme initialise la classe intercesseur (mediator), classe ou sont decrites les actions de l'application. |
* 2: Le programme s'enregistre aupres de la classe intercesseur |
* 3: Le programme recherche les informations de connections (utilisateur ou anonyme) |
* 4: Le programme initialise les differents panneaux composant l'affichage |
* |
*/ |
package org.tela_botanica.client; |
import com.google.gwt.core.client.EntryPoint; |
17,54 → 35,59 |
public class Cel implements EntryPoint, WindowResizeListener { |
private TopPanel topPanel = null; |
private CenterPanel centerPanel = null; |
private LeftPanel leftPanel = null; |
private EntryPanel entryPanel = null; |
private ActionPanel actionPanel = null; |
private SearchPanel searchPanel = null; |
private InfoPopup infoPopup = null; |
private VerticalPanel rightPanel = null; |
private Mediator mediator = null; |
private TopPanel topPanel = null; // Identifiant de connexion et titre |
private CenterPanel centerPanel = null; // Liste de releves |
private LeftPanel leftPanel = null; // Filtres sur liste de releves |
private EntryPanel entryPanel = null; // Saisie d'un releve |
private ActionPanel actionPanel = null; // Action sur les relevés saisis |
private SearchPanel searchPanel = null; // Recherche dans les relevés saisis |
private VerticalPanel rightPanel = null; // Container panneau précedents (sauf left et popup) |
private Mediator mediator = null; // Intermediaire entre les differents classes |
/** |
* This is the entry point method. |
* Point d'entree : recherche du pres-requis : information de connection. |
*/ |
public void onModuleLoad() { |
mediator= new Mediator(); |
mediator.registerCel(this); |
mediator.initUser(); // Appelle initAsync suivant |
mediator.registerCel(this); // Declaration point d'entree aupres de la classe intercesseur |
mediator.initUser(); // Initialisation environnement utilisateur (Cette methode appelle la methode initAsync() suivante) |
} |
/** |
* Fin de l'initialisation |
* |
*/ |
public void initAsync() { |
centerPanel = new CenterPanel(mediator); |
centerPanel = new CenterPanel(mediator); // Liste de releves |
topPanel = new TopPanel(mediator); // Identifiant de connection |
leftPanel = new LeftPanel(mediator); // Filte de liste de releves |
topPanel = new TopPanel(mediator); |
leftPanel = new LeftPanel(mediator); |
entryPanel = new EntryPanel(mediator); // Formulaire de saisie |
entryPanel = new EntryPanel(mediator); |
actionPanel = new ActionPanel(mediator); |
searchPanel = new SearchPanel(mediator); |
rightPanel = new VerticalPanel(); |
infoPopup = new InfoPopup(mediator); |
actionPanel = new ActionPanel(mediator); // Action sur releves saisis |
searchPanel = new SearchPanel(mediator); // Recherche dans releves |
rightPanel = new VerticalPanel(); // Container des panneaux precedents |
// Information haut de page (nom application, connexion ... etc). |
// A regler |
entryPanel.setStyleName("item-Input"); |
// Assemblage des differents panneaux |
rightPanel.add(searchPanel); |
rightPanel.add(entryPanel); |
rightPanel.add(centerPanel); |
73,27 → 96,18 |
rightPanel.setWidth("100%"); |
centerPanel.setWidth("100%"); |
entryPanel.setWidth("100%"); |
topPanel.setWidth("100%"); |
rightPanel.setSpacing(2); |
// Disposition générale : |
// DockPanel permet d'arranger plusieurs panneaux au coins cardinaux, le panneau central remplissant |
// l'espace laissé. |
DockPanel outer = new DockPanel(); |
outer.add(topPanel, DockPanel.NORTH); |
outer.add(rightPanel, DockPanel.CENTER); |
outer.add(leftPanel, DockPanel.WEST); |
// outer.add(bottomPanel, DockPanel.SOUTH); |
// LeftPanel : |
// Pour l'instant : relevés. |
outer.setWidth("100%"); |
outer.setSpacing(2); |
102,6 → 116,8 |
// Window.enableScrolling(false); |
Window.setMargin("0px"); |
// Initialisation des differents contenus ... |
mediator.onInit(); |
RootPanel.get().add(outer); |
135,3 → 151,8 |
} |
/* +--Fin du code ---------------------------------------------------------------------------------------+ |
* $Log$ |
* |
*/ |
/trunk/src/org/tela_botanica/client/Mediator.java |
---|
12,9 → 12,10 |
import com.google.gwt.json.client.JSONValue; |
import com.google.gwt.user.client.HTTPRequest; |
import com.google.gwt.user.client.ResponseTextHandler; |
import com.google.gwt.user.client.Window; |
import com.google.gwt.user.client.ui.TextBox; |
public class Mediator { |
public class Mediator implements AutoCompleteAsyncTextBoxListener { |
private String serviceBaseUrl = getServiceBaseUrlFromDictionnary(); |
44,7 → 45,6 |
Mediator() { |
} |
/** |
53,8 → 53,7 |
*/ |
public void initUser() { |
getUserFromService(); |
getUserFromService(); // Appel distant recherche de l'utilisateur |
} |
74,7 → 73,48 |
} |
/** |
* Action lancee par la completion d'un nom dans l'assistant de saisie |
* Recherche d'information compl�mentaires .... |
* |
* @return void |
*/ |
public void onComplete(ResponseTextHandler sender, String str, String value) { |
if (sender instanceof NameAssistant) { |
onNameCompleted(value); |
} |
} |
/** |
* Action lancee par la selection d'un nom dans l'assistant de saisie. Lance |
* la recherche d'informations compl�mentaires (famille, numero |
* nomenclaturaux etc) et met a jour l'inventaire (addelement()) |
* |
* @return void |
*/ |
public void onValidate(SourcesAutoCompleteAsyncTextBoxEvents sender, |
String str, String value) { |
if (getEntryPanel().getOrdre()==null) { |
onAddInventoryItem(); |
} |
else { |
onModifyInventoryItem(getEntryPanel().getOrdre()); |
getEntryPanel().setOrdre(null); |
} |
} |
/** |
* Action suite ajout, modification, suppression element inventaire |
*/ |
104,6 → 144,19 |
/** |
* Action sur deselection d'une observation : affichage du detail |
*/ |
public void onInventoryItemUnselected(String ordre) { |
entryPanel.setOrdre(null); |
} |
/** |
* Action sur recherche : affichage de la liste des taxons correspondants |
*/ |
127,21 → 180,20 |
public void onLocationSelected(String loc) { |
inventoryItemList.setLocation(loc); |
// inventoryItemList.setDate("all"); |
// inventoryItemList.setStation("all"); |
inventoryItemList.updateCount(); |
// nameAssistant.setValue(null); |
inventoryItemList.displayFilter(); |
dateList.setLocation(loc); |
// dateList.setDate("all"); |
dateList.updateCount(); |
stationList.setLocation(loc); |
// stationList.setStation("all"); |
stationList.updateCount(); |
} |
/** |
* Action sur login |
* @param user |
190,6 → 242,9 |
inventoryItemList.setStation(station); |
inventoryItemList.updateCount(); |
inventoryItemList.displayFilter(); |
// nameAssistant.setValue(null); |
206,6 → 261,9 |
inventoryItemList.setDate(date); |
inventoryItemList.updateCount(); |
inventoryItemList.displayFilter(); |
// nameAssistant.setValue(null); |
212,17 → 270,20 |
} |
/** |
* Action suivant la complétion d'un nom |
* Action suivant la completion d'un nom |
* |
*/ |
public void onNameCompleted(String value) { |
if (infoPopup==null) { |
infoPopup = new InfoPopup(this); |
} |
infoPopup.setImageUrl(value); |
} |
/** |
* Action prealable à l'ajout d'une observation : controle presence champs requis et lancement mise a jour |
* Action prealable a l'ajout d'une observation : controle presence champs requis et lancement mise a jour |
* |
*/ |
236,7 → 297,7 |
/** |
* Action prealable à la modification d'une observation : controle presence champs requis et lancement mise a jour |
* Action prealable a la modification d'une observation : controle presence champs requis et lancement mise a jour |
* |
*/ |
429,7 → 490,7 |
/** |
* Recherche distante et asynchrone de l'utilisateur connecté, en retour lancement methode initialisation |
* Recherche distante et asynchrone de l'utilisateur connecte, en retour lancement methode initialisation |
* de l'appellant Cel. (initAsync) |
* |
*/ |
444,8 → 505,8 |
JSONValue jsonValue = JSONParser.parse(str); |
JSONArray jsonArray; |
if ((jsonArray = jsonValue.isArray()) != null) { |
user = ((JSONString) jsonArray.get(0)).stringValue(); |
connected = ((JSONBoolean) jsonArray.get(1)).booleanValue(); |
user = ((JSONString) jsonArray.get(0)).stringValue(); // Identifiant utilisateur ou identifiant de session si non connecte |
connected = ((JSONBoolean) jsonArray.get(1)).booleanValue(); // Drapeau leve si utilisateur identifie |
} |
cel.initAsync(); |
} |
480,7 → 541,7 |
/** |
* Accesseur Utilisateur |
* @return utilisateur connecté ou identifiant de session |
* @return utilisateur connecte ou identifiant de session |
*/ |
public String getUser() { |
530,6 → 591,9 |
} |
public InfoPopup getInfoPopup() { |
if (infoPopup==null) { |
infoPopup = new InfoPopup(this); |
} |
return infoPopup; |
} |
/trunk/src/org/tela_botanica/client/LocationList.java |
---|
147,9 → 147,8 |
private NavBar navBar=null; |
private int count = 0; |
private int count = 65000; |
// Tous selectionné |
private int selectedRow = -1; |
/trunk/src/org/tela_botanica/client/InventoryItemList.java |
---|
1,23 → 1,52 |
/** |
David Delon david.delon@clapas.net 2007 |
*/ |
/* |
* Copyright 2006 Google Inc. |
* InventoryItemList.java (Composite de Panel) |
* |
* Licensed under the Apache License, Version 2.0 (the "License"); you may not |
* use this file except in compliance with the License. You may obtain a copy of |
* the License at |
* Cas d'utilisation : |
* |
* http://www.apache.org/licenses/LICENSE-2.0 |
* Affichage de releve |
* |
* Unless required by applicable law or agreed to in writing, software |
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
* License for the specific language governing permissions and limitations under |
* the License. |
* 1 : Recherche du nombre de releves associe au navigateur ou a l'utilisateur est connecte, en fonction des criteres de selection |
* 2 : Recherche des releves correspondant au critere precedent |
* 3 : Affichage des releves avec positionnement sur le dernier releve |
* |
* Selection de releve |
* |
* 1 : L'utilisateur selectionne un releve : lancement de l'affichage detaille pour le releve selectionne |
* |
* |
* Pagination : |
* |
* 1 : Avancement ou recul d'une page |
* |
* |
* C(R)UD Element d'inventaire : (TODO : creer un nouvel objet pour cela) |
* |
* 1 : Ajoute d'un element |
* 2 : Modification d'un element |
* 3 : Suppression d'un element |
*/ |
/* Actions declenchees : |
* |
* onInventoryItemSelected(numero d'ordre de la ligne selectionne) : selection d'une ligne |
* onInventoryItemUnselected(numero d'ordre de la ligne selectionne) : deselection d'une ligne |
* onInventoryUpdated(location) : action suite a la modification, suppression, creation d'un element d'inventaire |
* |
*/ |
package org.tela_botanica.client; |
import java.util.Iterator; |
import java.util.Vector; |
import com.google.gwt.http.client.URL; |
import com.google.gwt.json.client.JSONArray; |
import com.google.gwt.json.client.JSONNumber; |
import com.google.gwt.json.client.JSONParser; |
34,7 → 63,6 |
import com.google.gwt.user.client.ui.SourcesTableEvents; |
import com.google.gwt.user.client.ui.TableListener; |
import com.google.gwt.user.client.ui.VerticalPanel; |
import com.google.gwt.user.client.ui.DockPanel; |
import com.google.gwt.user.client.ui.Button; |
import com.google.gwt.user.client.ui.CheckBox; |
import com.google.gwt.user.client.ui.Widget; |
42,30 → 70,18 |
import com.google.gwt.user.client.ui.HasHorizontalAlignment; |
import com.google.gwt.user.client.ui.HasVerticalAlignment; |
/* |
* Le retour de getUser appelle updateCount qui appelle update pour veiller à une |
* initialisation correcte |
* |
*/ |
public class InventoryItemList extends Composite implements |
AutoCompleteAsyncTextBoxListener { |
public class InventoryItemList extends Composite |
{ |
// Barre de navigation |
// 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); |
public final Button gotoPrev = new Button("<", this); |
public final Button gotoEnd = new Button(">>", this); |
public final HTML status = new HTML(); |
72,37 → 88,28 |
public NavBar() { |
initWidget(bar); |
HorizontalPanel bar = new HorizontalPanel(); |
bar.setStyleName("navbar"); |
status.setStyleName("status"); |
HorizontalPanel buttons = new HorizontalPanel(); |
buttons.add(status); |
buttons.setCellHorizontalAlignment(status, |
HasHorizontalAlignment.ALIGN_RIGHT); |
buttons.setCellVerticalAlignment(status, |
HasVerticalAlignment.ALIGN_MIDDLE); |
buttons.setCellWidth(status, "100%"); |
bar.add(status); |
bar.setCellHorizontalAlignment(status, HasHorizontalAlignment.ALIGN_RIGHT); |
bar.setCellVerticalAlignment(status, HasVerticalAlignment.ALIGN_MIDDLE); |
bar.setCellWidth(status, "100%"); |
bar.add(gotoFirst); |
bar.add(gotoPrev); |
bar.add(gotoNext); |
bar.add(gotoEnd); |
buttons.add(gotoFirst); |
buttons.add(gotoPrev); |
buttons.add(gotoNext); |
buttons.add(gotoEnd); |
bar.add(buttons, DockPanel.EAST); |
bar.setCellHorizontalAlignment(buttons, DockPanel.ALIGN_RIGHT); |
initWidget(bar); |
bar.setCellHorizontalAlignment(buttons, DockPanel.ALIGN_LEFT); |
bar.setVerticalAlignment(DockPanel.ALIGN_MIDDLE); |
} |
public void onClick(Widget sender) { |
if (sender == gotoNext) { |
// Move forward a page. |
130,54 → 137,52 |
} |
private void setStatusText(String text) { |
navBar.status.setText(text); |
} |
// Fin Barre de navigation |
private static final int VISIBLE_TAXON_COUNT = 15; |
// Conteneur (header et table sont dans panel) |
private Grid header = new Grid(1, 3); |
private FlexTable table = new FlexTable(); |
private VerticalPanel panel = new VerticalPanel(); |
private int startIndex = 0; |
// Services |
private String serviceBaseUrl = null; |
private int count = 65000; |
private String user; |
private Mediator mediator = null; |
// Navigation |
private int startIndex = 0; |
private int count = 0; |
private static final int VISIBLE_TAXON_COUNT = 15; |
private NavBar navBar=null; |
private int selectedRow = -1; |
private Mediator mediator = null; |
// Filtre par defaut : |
private int selectedRow = -1; |
private String location = "all"; |
private String date = "all"; |
private String search = "all"; |
private String station = "all"; |
public InventoryItemList(Mediator med) { |
// Traitement contexte utilisateur et service |
mediator=med; |
mediator.registerInventoryItemList(this); |
user=mediator.getUser(); |
serviceBaseUrl = mediator.getServiceBaseUrl(); |
// Barre navigation integree au header |
navBar = new NavBar(); |
// Information complementaire : un tableau associe au retour de |
// l'assistant de saisie |
// Mise en forme du header |
header.setCellSpacing(0); |
188,7 → 193,7 |
header.setWidget(0, 2, navBar); |
// Mise en forme de la table. |
// Mise en forme de la table (contenu) |
table.setCellSpacing(0); |
table.setBorderWidth(0); |
196,54 → 201,55 |
table.setWidth("100%"); |
// Mise en forme barre navigation |
navBar.setWidth("100%"); |
table.setStyleName("inventoryItem-List"); |
//panel.add(navBar); |
panel.add(header); |
panel.add(table); |
// Hook up events. |
table.addTableListener(new TableListener () { |
public void onCellClicked(SourcesTableEvents sender, int row, int cell) { |
if ((table.getWidget(row, 0)!=null) && (cell>0)){ |
if (row!=selectedRow) { |
selectRow(row); |
// Numero d'ordre |
mediator.onInventoryItemSelected(table.getText(row, 5)); |
} |
// Deselection |
else { |
styleRow(row, false); |
selectedRow=-1; |
// Numero d'ordre |
mediator.onInventoryItemUnselected(table.getText(row, 5)); |
} |
} |
} |
}); |
//updateCount(); |
// update() |
initWidget(panel); |
} |
/** |
* Gestion affichage selection/deselection d'un element d'inventaire |
* |
*/ |
private void selectRow(int row) { |
styleRow(selectedRow, false); |
styleRow(row, true); |
selectedRow = row; |
} |
private void styleRow(int row, boolean selected) { |
if (row != -1) { |
if (selected) |
256,48 → 262,11 |
} |
/** |
* Action lancee par la completion d'un nom dans l'assistant de saisie |
* Recherche d'information complémentaires .... |
* Lancement de la mise a jour d'une ligne d'inventaire (appele par Mediator.onModifyInventoryItem()) |
* |
* @return void |
*/ |
public void onComplete(ResponseTextHandler sender, String str, String value) { |
if (sender instanceof NameAssistant) { |
mediator.onNameCompleted(value); |
} |
} |
/** |
* Action lancee par la selection d'un nom dans l'assistant de saisie. Lance |
* la recherche d'informations complémentaires (famille, numero |
* nomenclaturaux etc) et met a jour l'inventaire (addelement()) |
* |
* @return void |
*/ |
public void onValidate(SourcesAutoCompleteAsyncTextBoxEvents sender, |
String str, String value) { |
if (mediator.getEntryPanel().getOrdre()==null) { |
mediator.onAddInventoryItem(); |
} |
else { |
mediator.onModifyInventoryItem(mediator.getEntryPanel().getOrdre()); |
mediator.getEntryPanel().setOrdre(null); |
} |
} |
// Action sur modification d'un element |
public void updateElement() { |
307,6 → 276,8 |
setStatusDisabled(); |
// Modification d'un nom faisant parti du referentiel : recherche du nom valide correspondant |
if (inventoryItem.getNomenclaturalNumber() !=null) { |
HTTPRequest.asyncGet(serviceBaseUrl + "/NameValid/" + inventoryItem.getNomenclaturalNumber(), |
318,8 → 289,7 |
JSONArray jsonArray; |
if ((jsonArray = jsonValue.isArray()) != null) { |
// Nom retenu, Num Nomen nom retenu, Num Taxon, |
// Famille |
// Nom retenu, Num Nomen nom retenu, Num Taxon, Famille |
updateElement(inventoryItem.getOrdre(),inventoryItem.getName(), inventoryItem.getNomenclaturalNumber(), |
((JSONString) jsonArray.get(0)) |
.stringValue(), |
335,7 → 305,7 |
}); |
} |
// Saisie libre |
// Modification d'un nom ne faisant pas parti du referentiel (saisie libre) |
else { |
updateElement(inventoryItem.getOrdre(),inventoryItem.getName(), " ", " ", " ", " ", " ",inventoryItem.getLocation(),inventoryItem.getLocation_id(),inventoryItem.getDate(),inventoryItem.getComplementlocation(),inventoryItem.getComment()); |
} |
342,15 → 312,18 |
} |
else { |
// TODO : message d'erreur |
return; |
} |
} |
/** |
* Lancement de la creation d'une ligne d'inventaire (appele par Mediator.onAddInventoryItem()) |
* |
*/ |
// Action sur ajout d'un element |
public void addelement() { |
360,20 → 333,8 |
setStatusDisabled(); |
// On met a jour rapidement l'affichage puis on lance la requete .... |
// Creation d'un nom faisant parti du referentiel : recherche du nom valide correspondant |
/* int row = table.insertRow(table.getRowCount()); |
// Case a cocher |
table.setWidget(row, 0, new CheckBox()); |
// Nom saisi |
table.setText(row, 1, nameText); |
table.getFlexCellFormatter().setWidth(row, 0, "2%"); |
table.getFlexCellFormatter() |
.setWidth(row, 1, "31%");*/ |
// Recherche complement d'information |
if (inventoryItem.getNomenclaturalNumber() !=null) { |
HTTPRequest.asyncGet(serviceBaseUrl + "/NameValid/" + inventoryItem.getNomenclaturalNumber(), |
409,12 → 370,15 |
} |
else { |
// TODO : message d'erreur |
return; |
} |
} |
/** |
* Ajoute un element à l'inventaire |
* Ajoute effectif d'un element a l'inventaire (appel interne) |
* |
* @param nom_sel : |
* nom selectionne |
449,7 → 413,6 |
location="000null"; |
} |
mediator.onInventoryUpdated(location); |
updateCount(); |
} |
}); |
} |
457,7 → 420,7 |
/** |
* Modifie un element de l'inventaire |
* Modification effective d'un element de l'inventaire (appel interne) |
* |
* @param ordre : numero d'ordre |
* @param nom_sel : |
488,30 → 451,28 |
public void onCompletion(String str) { |
mediator.onInventoryUpdated(location); |
update(); |
} |
}); |
} |
/** |
* Transmission de releve à Tela |
* Suppression effective d'un element lde l'inventaire, a partir de son numero d'ordre |
* |
*/ |
public void deleteElement() { |
public void transmitElement() { |
setStatusDisabled(); |
Vector parseChecked = new Vector(); |
// TODO : optimiser |
// Lifo ... |
for (int i = table.getRowCount() - 1; i >= 0; i--) { |
if (table.getWidget(i, 0)!=null) { |
if (((CheckBox) table.getWidget(i, 0)).isChecked()) { |
// Numero ordre |
parseChecked.add(table.getText(i, 5)); |
count--; |
} |
} |
} |
520,15 → 481,14 |
ids.append((String)it.next()); |
if (it.hasNext()) ids.append(","); |
} |
if (ids.length()>0) { |
HTTPRequest.asyncPost(serviceBaseUrl + "/InventoryTransmit/" + user |
+ "/" + ids.toString(), "transmission=1", |
HTTPRequest.asyncPost(serviceBaseUrl + "/Inventory/" + user |
+ "/" + ids.toString(), "action=DELETE", |
new ResponseTextHandler() { |
public void onCompletion(String str) { |
update(); |
mediator.onInventoryUpdated(location); |
} |
}); |
} |
535,60 → 495,62 |
setStatusEnabled(); |
} |
/** |
* Suppression d'un element lde l'inventaire, a partir de son numero d'ordre |
* |
* Transmission de releve a Tela (TODO : a appeler par Mediator) |
*/ |
public void deleteElement() { |
public void transmitElement() { |
setStatusDisabled(); |
Vector parseChecked = new Vector(); |
// TODO : optimiser |
// Lifo ... |
for (int i = table.getRowCount() - 1; i >= 0; i--) { |
if (table.getWidget(i, 0)!=null) { |
if (((CheckBox) table.getWidget(i, 0)).isChecked()) { |
// Numero ordre |
parseChecked.add(table.getText(i, 5)); |
count--; |
} |
} |
} |
StringBuffer ids=new StringBuffer(); |
for (Iterator it = parseChecked.iterator(); it.hasNext();) { |
ids.append((String)it.next()); |
if (it.hasNext()) ids.append(","); |
} |
if (ids.length()>0) { |
HTTPRequest.asyncPost(serviceBaseUrl + "/Inventory/" + user |
+ "/" + ids.toString(), "action=DELETE", |
HTTPRequest.asyncPost(serviceBaseUrl + "/InventoryTransmit/" + user |
+ "/" + ids.toString(), "transmission=1", |
new ResponseTextHandler() { |
public void onCompletion(String str) { |
mediator.onInventoryUpdated("all"); |
updateCount(); |
update(); // Pour affichage logo |
} |
}); |
} |
setStatusEnabled(); |
} |
/** |
* Selection de l'ensemble des elements affichés |
* Selection/Deselection de l'ensemble des elements affiches |
* |
*/ |
public void selectAll() { |
// TODO : optimiser ... |
for (int i = table.getRowCount() - 1; i >= 0; i--) { |
if (table.getWidget(i, 0)!=null) |
((CheckBox) table.getWidget(i, 0)).setChecked(true); |
597,7 → 559,6 |
public void deselectAll() { |
// TODO : optimiser ... |
for (int i = table.getRowCount() - 1; i >= 0; i--) { |
if (table.getWidget(i, 0)!=null) |
((CheckBox) table.getWidget(i, 0)).setChecked(false); |
610,16 → 571,20 |
* Recherche nombre d'enregistrement pour l'utilisateur et la localite en cours |
* |
*/ |
public void updateCount () { |
setStatusDisabled(); |
// Transformation de la date selectionne vers date time stamp |
String adate="all"; |
if (date.compareTo("all")!=0) { |
adate=date.substring(6,10)+"-"+date.substring(3,5)+"-"+date.substring(0,2)+" 00:00:00"; |
} |
HTTPRequest.asyncGet(serviceBaseUrl + "/InventoryItemList/" + user + "/" + location + "/" + adate + "/" + search + "/" + station, |
HTTPRequest.asyncGet(serviceBaseUrl + "/InventoryItemList/" + user + "/" + URL.encodeComponent(location) + "/" + adate + "/" + URL.encodeComponent(search) + "/" + URL.encodeComponent(station), |
new ResponseTextHandler() { |
public void onCompletion(String str) { |
628,14 → 593,7 |
JSONNumber jsonNumber; |
if ((jsonNumber = jsonValue.isNumber()) != null) { |
count = (int) jsonNumber.getValue(); |
/* |
if (count==0) { |
location="all"; |
} |
*/ |
if (location.compareTo("")==0) |
location="000null"; |
// mediator.onInventoryItemUpdate(location); |
// if (location.compareTo("")==0) location="000null"; |
gotoEnd(); // Derniere page |
update(); |
} |
644,6 → 602,7 |
} |
// Utilitaire affichage |
private String subLeft(String text, int length) { |
return (text.length() < length) ? text : text.substring(0, length)+ " ..."; |
650,28 → 609,21 |
} |
/** |
* Mise a jour de l'affichage, à partir des données d'inventaire deja |
* Mise a jour de l'affichage, a partir des donnaes d'inventaire deja |
* saisies. La valeur de this.startIndex permet de determiner quelles |
* données seront affichées |
* donnaes seront affichees |
* |
* @param deep : force une mise a jour totale |
*/ |
public void update() { |
// Mise a jour boutton export feuille de calcul |
mediator.getActionPanel().getExportButton().setHTML("<a href=\""+mediator.getServiceBaseUrl()+"/InventoryExport/" |
+ user + "/" |
+ location + "/" |
+ station + "/" |
+ search + "/" |
+ date + |
"\">"+"Export tableur</a>"); |
// table.setBorderWidth(1); // Debug |
// table.setBorderWidth(1); |
// Ligne d'information |
setStatusDisabled(); |
String adate="all"; |
679,54 → 631,7 |
adate=date.substring(6,10)+"-"+date.substring(3,5)+"-"+date.substring(0,2)+" 00:00:00"; |
} |
String com; |
if (location.compareTo("all")==0) { |
com="Toutes communes"; |
} |
else { |
if (location.compareTo("000null")==0) { |
com="Communes non renseignées"; |
} |
else { |
com="Commune de "+location; |
} |
} |
String dat; |
if (date.compareTo("all")==0) { |
dat=", toutes périodes"; |
} |
else { |
if (date.compareTo("00/00/0000")==0) { |
dat=", périodes non renseignées"; |
} |
else { |
dat=", le "+ date; |
} |
} |
String stat; |
if (station.compareTo("all")==0) { |
stat=", toutes stations"; |
} |
else { |
if (station.compareTo("000null")==0) { |
stat=", stations non renseignées"; |
} |
else { |
stat=", station "+ station; |
} |
} |
header.setHTML(0, 0, com + dat + stat ); |
HTTPRequest.asyncGet(serviceBaseUrl + "/InventoryItemList/" + user + "/" + location +"/" + adate + "/" + search + "/" + station + "/" |
HTTPRequest.asyncGet(serviceBaseUrl + "/InventoryItemList/" + user + "/" + URL.encodeComponent(location) +"/" + adate + "/" + search + "/" + URL.encodeComponent(station) + "/" |
+ startIndex + "/" + VISIBLE_TAXON_COUNT, |
new ResponseTextHandler() { |
737,17 → 642,17 |
JSONArray jsonArray; |
JSONArray jsonArrayNested; |
int row=0; |
int i=0; |
if ((jsonArray = jsonValue.isArray()) != null) { |
StringBuffer left=new StringBuffer(); |
StringBuffer center=new StringBuffer(); |
StringBuffer right=new StringBuffer(); |
int arraySize = jsonArray.size(); |
int row=0; |
int i=0; |
if ((jsonArray = jsonValue.isArray()) != null) { |
int arraySize = jsonArray.size(); |
for (i = 0; i < arraySize; ++i) { |
if ((jsonArrayNested = jsonArray.get(i).isArray()) != null) { |
if (i>=table.getRowCount()) { |
888,26 → 793,10 |
String aordre=((JSONString) jsonArrayNested.get(7)).stringValue(); |
// Numero d'ordre (caché) |
// Numero d'ordre (cache) |
table.setText(row, 5, aordre); |
/* |
if (add){ |
if (i ==(arraySize -1)) { |
selectRow(row); |
mediator.getEntryPanel().setOrdre(aordre); |
} |
} |
else { |
if ((mediator.getEntryPanel().getOrdre()!=null) && (mediator.getEntryPanel().getOrdre().compareTo(aordre)==0)) { |
selectRow(row); |
} |
} |
*/ |
table.getCellFormatter().setVisible(row, 5, false); |
940,7 → 829,7 |
/** |
* Affichage message d'attente et désactivation navigation |
* Affichage message d'attente et desactivation navigation |
* |
* @param |
* @return void |
953,7 → 842,7 |
navBar.gotoNext.setEnabled(false); |
navBar.gotoEnd.setEnabled(false); |
setStatusText("Patientez ..."); |
navBar.status.setText("Patientez ..."); |
} |
/** |
976,31 → 865,31 |
// page |
navBar.gotoNext.setEnabled(true); |
navBar.gotoEnd.setEnabled(true); |
setStatusText((startIndex + 1) + " - " |
navBar.status.setText((startIndex + 1) + " - " |
+ (startIndex + VISIBLE_TAXON_COUNT) + " sur " + count ); |
} else { // Derniere page |
setStatusText((startIndex + 1) + " - " + count + " sur " + count ); |
navBar.status.setText((startIndex + 1) + " - " + count + " sur " + count ); |
} |
} else { // Premiere page |
if (count > VISIBLE_TAXON_COUNT) { // Des pages derrieres |
navBar.gotoNext.setEnabled(true); |
navBar.gotoEnd.setEnabled(true); |
setStatusText((startIndex + 1) + " - " |
navBar.status.setText((startIndex + 1) + " - " |
+ (startIndex + VISIBLE_TAXON_COUNT) + " sur " + count); |
} else { |
setStatusText((startIndex + 1) + " - " + count + " sur " + count); |
navBar.status.setText((startIndex + 1) + " - " + count + " sur " + count); |
} |
} |
} |
else { // Pas d'inventaire, pas de navigation |
setStatusText("0 - 0 sur 0"); |
navBar.status.setText("0 - 0 sur 0"); |
} |
} |
/* |
* Positionnement index de parcours (this.startIndex) pour affichage de la |
* dernière page |
* derniere page |
* |
* @param |
* @return void |
1026,7 → 915,6 |
} |
/* |
* Localite en cours |
* |
1038,22 → 926,136 |
/* |
* Station en cours |
* |
*/ |
public void setStation(String station) { |
this.station = station; |
} |
/* |
* Date en cours |
* |
*/ |
public void setDate(String date) { |
this.date = date; |
} |
/* |
* Utilisateur en cours |
* |
*/ |
public void setUser(String user) { |
this.user = user; |
} |
public void setStation(String station) { |
this.station = station; |
public String getDate() { |
return date; |
} |
public String getLocation() { |
return location; |
} |
public String getSearch() { |
return search; |
} |
public String getStation() { |
return station; |
} |
public Grid getHeader() { |
return header; |
} |
public void displayFilter() { |
// Mise a jour boutton export feuille de calcul |
mediator.getActionPanel().getExportButton().setHTML("<a href=\""+mediator.getServiceBaseUrl()+"/InventoryExport/" |
+ user + "/" |
+ URL.encodeComponent(location) + "/" |
+ URL.encodeComponent(station)+ "/" |
+ URL.encodeComponent(search) + "/" |
+ date + |
"\">"+"Export tableur</a>"); |
// Mise a jour ligne de selection |
String com; |
if (location.compareTo("all")==0) { |
com="Toutes communes"; |
} |
else { |
if (location.compareTo("000null")==0) { |
com="Communes non renseignées"; |
} |
else { |
com="Commune de "+location; |
} |
} |
String dat; |
if (date.compareTo("all")==0) { |
dat=", toutes périodes"; |
} |
else { |
if (date.compareTo("00/00/0000")==0) { |
dat=", périodes non renseignées"; |
} |
else { |
dat=", le "+ date; |
} |
} |
String stat; |
if (station.compareTo("all")==0) { |
stat=", toutes stations"; |
} |
else { |
if (station.compareTo("000null")==0) { |
stat=", stations non renseignées"; |
} |
else { |
stat=", station "+ station; |
} |
} |
header.setHTML(0, 0, com + dat + stat ); |
} |
} |
/* +--Fin du code ---------------------------------------------------------------------------------------+ |
* $Log$ |
*/ |
/trunk/src/org/tela_botanica/client/DateList.java |
---|
1,21 → 1,21 |
/** |
David Delon david.delon@clapas.net 2007 |
*/ |
/* |
* Copyright 2006 Google Inc. |
* DateList.java : filtrage des releves par date d'observation |
* |
* Licensed under the Apache License, Version 2.0 (the "License"); you may not |
* use this file except in compliance with the License. You may obtain a copy of |
* the License at |
* |
* http://www.apache.org/licenses/LICENSE-2.0 |
* |
* Unless required by applicable law or agreed to in writing, software |
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
* License for the specific language governing permissions and limitations under |
* the License. |
* 1: Le programme initialise les filtres communes, lieu-dit et dates) |
*/ |
package org.tela_botanica.client; |
import com.google.gwt.http.client.URL; |
import com.google.gwt.json.client.JSONArray; |
import com.google.gwt.json.client.JSONNumber; |
import com.google.gwt.json.client.JSONParser; |
26,7 → 26,6 |
import com.google.gwt.user.client.ui.Button; |
import com.google.gwt.user.client.ui.ClickListener; |
import com.google.gwt.user.client.ui.Composite; |
import com.google.gwt.user.client.ui.DockPanel; |
import com.google.gwt.user.client.ui.FlexTable; |
import com.google.gwt.user.client.ui.Grid; |
import com.google.gwt.user.client.ui.HTML; |
44,58 → 43,42 |
public class DateList extends Composite { |
// Debut Barre de navigation |
// 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); |
public final Button gotoPrev = new Button("<", this); |
public final Button gotoEnd = new Button(">>", this); |
public final HTML status = new HTML(); |
public NavBar() { |
initWidget(bar); |
bar.setStyleName("navbar"); |
status.setStyleName("status"); |
status.setWordWrap(false); |
HorizontalPanel buttons = new HorizontalPanel(); |
buttons.add(status); |
buttons.setCellHorizontalAlignment(status, |
HasHorizontalAlignment.ALIGN_RIGHT); |
buttons.setCellVerticalAlignment(status, |
HasVerticalAlignment.ALIGN_MIDDLE); |
buttons.setCellWidth(status, "100%"); |
HorizontalPanel bar = new HorizontalPanel(); |
bar.setStyleName("navbar"); |
status.setStyleName("status"); |
buttons.add(gotoFirst); |
buttons.add(gotoPrev); |
buttons.add(gotoNext); |
buttons.add(gotoEnd); |
bar.add(buttons, DockPanel.EAST); |
bar.setCellHorizontalAlignment(buttons, DockPanel.ALIGN_RIGHT); |
bar.add(status); |
bar.setCellHorizontalAlignment(status, HasHorizontalAlignment.ALIGN_RIGHT); |
bar.setCellVerticalAlignment(status, HasVerticalAlignment.ALIGN_MIDDLE); |
bar.setCellWidth(status, "100%"); |
bar.setCellHorizontalAlignment(buttons, DockPanel.ALIGN_LEFT); |
bar.add(gotoFirst); |
bar.add(gotoPrev); |
bar.add(gotoNext); |
bar.add(gotoEnd); |
bar.setVerticalAlignment(DockPanel.ALIGN_MIDDLE); |
initWidget(bar); |
} |
} |
public void onClick(Widget sender) { |
if (sender == gotoNext) { |
// Move forward a page. |
123,6 → 106,7 |
} |
// Fin Barre de navigation |
private static final int VISIBLE_DATE_COUNT = 10; |
150,9 → 134,9 |
private NavBar navBar=null; |
private int count = 65000; |
private int count = 0; |
// Tous selectionné |
// Tous selectionne |
private int selectedRow = -1; |
private Mediator mediator = null; |
187,7 → 171,7 |
// header.getCellFormatter().setWidth(0, 0, "100%"); |
// Mise en forme de l'entree "Toutes localités" |
// Mise en forme de l'entree "Toutes localites" |
selector.setCellSpacing(0); |
selector.setCellPadding(0); |
224,7 → 208,7 |
outer.add(header); |
inner.add(selector); // Toutes localités |
inner.add(selector); // Toutes localit�s |
inner.add(table); |
inner.setStyleName("date-List"); |
inner.setWidth("100%"); |
255,9 → 239,6 |
selector.getRowFormatter().addStyleName(0, "date-SelectedRow"); |
//updateCount(); |
// update() |
initWidget(outer); |
274,7 → 255,7 |
setStatusDisabled(); |
// HTTPRequest.asyncGet(serviceBaseUrl + "/InventoryDateList/" + user + "/" + location + "/"+ station, |
HTTPRequest.asyncGet(serviceBaseUrl + "/InventoryDateList/" + user + "/" + location , |
HTTPRequest.asyncGet(serviceBaseUrl + "/InventoryDateList/" + user + "/" + URL.encodeComponent(location) , |
new ResponseTextHandler() { |
public void onCompletion(String str) { |
315,9 → 296,9 |
/** |
* |
* Mise a jour de l'affichage, à partir des données d'inventaire deja |
* Mise a jour de l'affichage, a partir des donnees d'inventaire deja |
* saisies. La valeur de this.startIndex permet de determiner quelles |
* données seront affichées |
* donnees seront affichees |
* |
*/ |
327,7 → 308,7 |
setStatusDisabled(); |
// HTTPRequest.asyncGet(serviceBaseUrl + "/InventoryDateList/" + user + "/" + location + "/" + station + "/" |
HTTPRequest.asyncGet(serviceBaseUrl + "/InventoryDateList/" + user + "/" + location + "/" |
HTTPRequest.asyncGet(serviceBaseUrl + "/InventoryDateList/" + user + "/" + URL.encodeComponent(location) + "/" |
+ startIndex + "/" + VISIBLE_DATE_COUNT, |
new ResponseTextHandler() { |
405,7 → 386,7 |
/* |
* Positionnement index de parcours (this.startIndex) pour affichage de la |
* dernière page |
* derni�re page |
* |
* @param |
* @return void |
423,7 → 404,7 |
/** |
* Affichage message d'attente et désactivation navigation |
* Affichage message d'attente et d�sactivation navigation |
* |
* @param |
* @return void |
436,7 → 417,7 |
navBar.gotoNext.setEnabled(false); |
navBar.gotoEnd.setEnabled(false); |
setStatusText("Patientez ..."); |
navBar.status.setText("Patientez ..."); |
} |
/** |
459,35 → 440,31 |
// page |
navBar.gotoNext.setEnabled(true); |
navBar.gotoEnd.setEnabled(true); |
setStatusText((startIndex + 1) + " - " |
navBar.status.setText((startIndex + 1) + " - " |
+ (startIndex + VISIBLE_DATE_COUNT) + " sur " + count ); |
} else { // Derniere page |
setStatusText((startIndex + 1) + " - " + count + " sur " + count ); |
navBar.status.setText((startIndex + 1) + " - " + count + " sur " + count ); |
} |
} else { // Premiere page |
if (count > VISIBLE_DATE_COUNT) { // Des pages derrieres |
navBar.gotoNext.setEnabled(true); |
navBar.gotoEnd.setEnabled(true); |
setStatusText((startIndex + 1) + " - " |
navBar.status.setText((startIndex + 1) + " - " |
+ (startIndex + VISIBLE_DATE_COUNT) + " sur " + count); |
} else { |
setStatusText((startIndex + 1) + " - " + count + " sur " + count); |
navBar.status.setText((startIndex + 1) + " - " + count + " sur " + count); |
} |
} |
} |
else { // Pas d'inventaire, pas de navigation |
setStatusText("0 - 0 sur 0"); |
navBar.status.setText("0 - 0 sur 0"); |
} |
} |
private void setStatusText(String text) { |
navBar.status.setText(text); |
} |
public void setUser(String user) { |
this.user = user; |
} |
500,3 → 477,8 |
} |
/* +--Fin du code ---------------------------------------------------------------------------------------+ |
* $Log$ |
* |
*/ |
/trunk/src/org/tela_botanica/client/NameAssistant.java |
---|
34,7 → 34,6 |
mediator.registerNameAssistant(this); |
// autoCompletebox.setFocus(true); |
autoCompletebox.setSearchUrl(mediator.getServiceBaseUrl()+"/NameSearch/"); |
panel.add(autoCompletebox); |
41,7 → 40,7 |
autoCompletebox.setWidth("100%"); |
initWidget(panel); |
autoCompletebox.addAutoCompleteAsyncTextBoxListener(mediator.getInventoryItemList()); |
autoCompletebox.addAutoCompleteAsyncTextBoxListener(mediator); |
} |
/trunk/src/org/tela_botanica/client/LeftPanel.java |
---|
1,20 → 1,19 |
/** |
David Delon david.delon@clapas.net 2007 |
*/ |
/* |
* Copyright 2006 Google Inc. |
* LeftPanel.java : filtrage des releves (par communes, lieu-dit, dates ....) |
* |
* Licensed under the Apache License, Version 2.0 (the "License"); you may not |
* use this file except in compliance with the License. You may obtain a copy of |
* the License at |
* |
* http://www.apache.org/licenses/LICENSE-2.0 |
* |
* Unless required by applicable law or agreed to in writing, software |
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
* License for the specific language governing permissions and limitations under |
* the License. |
* 1: Le programme initialise les filtres communes, lieu-dit et dates) |
*/ |
package org.tela_botanica.client; |
import com.google.gwt.user.client.ui.Composite; |
import com.google.gwt.user.client.ui.StackPanel; |
46,7 → 45,6 |
StackPanel outer = new StackPanel(); |
// Create the groups within the stack panel. |
outer.add(locationList, "<b>Localités</b>", true); |
outer.add(stationList,"<b>Stations</b>",true); |
61,3 → 59,8 |
} |
/* +--Fin du code ---------------------------------------------------------------------------------------+ |
* $Log$ |
* |
*/ |
/trunk/src/org/tela_botanica/client/StationList.java |
---|
16,6 → 16,7 |
package org.tela_botanica.client; |
import com.google.gwt.http.client.URL; |
import com.google.gwt.json.client.JSONArray; |
import com.google.gwt.json.client.JSONNumber; |
import com.google.gwt.json.client.JSONParser; |
26,7 → 27,6 |
import com.google.gwt.user.client.ui.Button; |
import com.google.gwt.user.client.ui.ClickListener; |
import com.google.gwt.user.client.ui.Composite; |
import com.google.gwt.user.client.ui.DockPanel; |
import com.google.gwt.user.client.ui.FlexTable; |
import com.google.gwt.user.client.ui.Grid; |
import com.google.gwt.user.client.ui.HTML; |
44,58 → 44,42 |
public class StationList extends Composite { |
// Debut Barre de navigation |
// 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); |
public final Button gotoPrev = new Button("<", this); |
public final Button gotoEnd = new Button(">>", this); |
public final HTML status = new HTML(); |
public NavBar() { |
initWidget(bar); |
bar.setStyleName("navbar"); |
status.setStyleName("status"); |
status.setWordWrap(false); |
HorizontalPanel buttons = new HorizontalPanel(); |
buttons.add(status); |
buttons.setCellHorizontalAlignment(status, |
HasHorizontalAlignment.ALIGN_RIGHT); |
buttons.setCellVerticalAlignment(status, |
HasVerticalAlignment.ALIGN_MIDDLE); |
buttons.setCellWidth(status, "100%"); |
HorizontalPanel bar = new HorizontalPanel(); |
bar.setStyleName("navbar"); |
status.setStyleName("status"); |
buttons.add(gotoFirst); |
buttons.add(gotoPrev); |
buttons.add(gotoNext); |
buttons.add(gotoEnd); |
bar.add(buttons, DockPanel.EAST); |
bar.setCellHorizontalAlignment(buttons, DockPanel.ALIGN_RIGHT); |
bar.add(status); |
bar.setCellHorizontalAlignment(status, HasHorizontalAlignment.ALIGN_RIGHT); |
bar.setCellVerticalAlignment(status, HasVerticalAlignment.ALIGN_MIDDLE); |
bar.setCellWidth(status, "100%"); |
bar.setCellHorizontalAlignment(buttons, DockPanel.ALIGN_LEFT); |
bar.add(gotoFirst); |
bar.add(gotoPrev); |
bar.add(gotoNext); |
bar.add(gotoEnd); |
bar.setVerticalAlignment(DockPanel.ALIGN_MIDDLE); |
initWidget(bar); |
} |
} |
public void onClick(Widget sender) { |
if (sender == gotoNext) { |
// Move forward a page. |
123,6 → 107,8 |
} |
// Fin Barre de navigation |
private static final int VISIBLE_STATION_COUNT = 10; |
private static final String VALUE_UNKNOWN = "Inconnues"; |
260,7 → 246,7 |
setStatusDisabled(); |
HTTPRequest.asyncGet(serviceBaseUrl + "/InventoryStationList/" + user + "/" + location , |
HTTPRequest.asyncGet(serviceBaseUrl + "/InventoryStationList/" + user + "/" + URL.encodeComponent(location) , |
new ResponseTextHandler() { |
public void onCompletion(String str) { |
312,7 → 298,7 |
setStatusDisabled(); |
HTTPRequest.asyncGet(serviceBaseUrl + "/InventoryStationList/" + user + "/" + location + "/" |
HTTPRequest.asyncGet(serviceBaseUrl + "/InventoryStationList/" + user + "/" + URL.encodeComponent(location) + "/" |
+ startIndex + "/" + VISIBLE_STATION_COUNT, |
new ResponseTextHandler() { |
421,7 → 407,7 |
navBar.gotoNext.setEnabled(false); |
navBar.gotoEnd.setEnabled(false); |
setStatusText("Patientez ..."); |
navBar.status.setText("Patientez ..."); |
} |
/** |
444,41 → 430,35 |
// page |
navBar.gotoNext.setEnabled(true); |
navBar.gotoEnd.setEnabled(true); |
setStatusText((startIndex + 1) + " - " |
navBar.status.setText((startIndex + 1) + " - " |
+ (startIndex + VISIBLE_STATION_COUNT) + " sur " + count ); |
} else { // Derniere page |
setStatusText((startIndex + 1) + " - " + count + " sur " + count ); |
navBar.status.setText((startIndex + 1) + " - " + count + " sur " + count ); |
} |
} else { // Premiere page |
if (count > VISIBLE_STATION_COUNT) { // Des pages derrieres |
navBar.gotoNext.setEnabled(true); |
navBar.gotoEnd.setEnabled(true); |
setStatusText((startIndex + 1) + " - " |
navBar.status.setText((startIndex + 1) + " - " |
+ (startIndex + VISIBLE_STATION_COUNT) + " sur " + count); |
} else { |
setStatusText((startIndex + 1) + " - " + count + " sur " + count); |
navBar.status.setText((startIndex + 1) + " - " + count + " sur " + count); |
} |
} |
} |
else { // Pas d'inventaire, pas de navigation |
setStatusText("0 - 0 sur 0"); |
navBar.status.setText("0 - 0 sur 0"); |
} |
} |
private void setStatusText(String text) { |
navBar.status.setText(text); |
} |
public void setUser(String user) { |
this.user = user; |
} |
public void setStation(String station) { |
this.station = station; |
} |
/trunk/src/org/tela_botanica/client/AutoCompleteAsyncTextBox.java |
---|
23,6 → 23,7 |
// TODO : traiter latence (augmenter en fonction rapidité saisie + texte vide) |
// TODO : traitement espace apres l'espece (%20) |
import com.google.gwt.http.client.URL; |
import com.google.gwt.user.client.HTTPRequest; |
import com.google.gwt.user.client.ResponseTextHandler; |
import com.google.gwt.user.client.ui.KeyboardListener; |
108,6 → 109,7 |
* Here we fetch the URL and call the handler |
*/ |
String rematch=match.replaceAll(" ","/"); |
rematch=rematch.replaceAll("%",""); |
/trunk/src/org/tela_botanica/client/CalendarWidget.java |
---|
1,6 → 1,7 |
package org.tela_botanica.client; |
import java.util.Date; |
import com.google.gwt.user.client.DOM; |
import com.google.gwt.user.client.Element; |
import com.google.gwt.user.client.ui.Button; |
/trunk/src/org/tela_botanica/client/InfoPopup.java |
---|
22,8 → 22,11 |
import com.google.gwt.json.client.JSONValue; |
import com.google.gwt.user.client.HTTPRequest; |
import com.google.gwt.user.client.ResponseTextHandler; |
import com.google.gwt.user.client.Window; |
import com.google.gwt.user.client.ui.HorizontalPanel; |
import com.google.gwt.user.client.ui.Image; |
import com.google.gwt.user.client.ui.PopupPanel; |
import com.google.gwt.user.client.ui.VerticalPanel; |
/** |
* Composite permet de wrapper des Widget pour creer un nouveau Widget cf methode initWidget() |
32,7 → 35,8 |
public class InfoPopup extends PopupPanel { |
private Mediator mediator=null; |
private Image image = new Image(); |
private Image imageTop = new Image(); |
private Image imageBottom = new Image(); |
public InfoPopup(final Mediator med) { |
40,31 → 44,40 |
mediator=med; |
imageBottom.setPixelSize(150,150); |
imageTop.setPixelSize(150,150); |
mediator.registerInfoPopup(this); |
// HorizontalPanel panel = new HorizontalPanel(); |
VerticalPanel panel = new VerticalPanel(); |
panel.add(imageTop); |
panel.add(imageBottom); |
add(image); |
add(panel); |
} |
public void setImage(String url) { |
if (url.compareTo("null")!=0) { |
setPopupPosition(mediator.getLeftPanel().getAbsoluteLeft()+10, mediator.getLeftPanel().getAbsoluteTop() + (mediator.getLeftPanel().getOffsetHeight()/2)); |
show(); |
image.setUrl(url); |
public void setImageUrl(String value) { |
HTTPRequest.asyncGet(mediator.getServiceBaseUrl() + "/NameImage/" + value, |
new ResponseTextHandler() { |
public void onCompletion(String strcomplete) { |
JSONValue jsonValue = JSONParser.parse(strcomplete); |
JSONArray jsonArray; |
if ((jsonArray = jsonValue.isArray()) != null) { |
// Url Image |
setImageTop(((JSONString) jsonArray.get(0)).stringValue()); |
} |
else { |
hide(); |
} |
} |
}); |
public void setImageUrl(String value) { |
HTTPRequest.asyncGet(mediator.getServiceBaseUrl() + "/NameImage/" + value, |
HTTPRequest.asyncGet(mediator.getServiceBaseUrl() + "/NameMap/" + value, |
new ResponseTextHandler() { |
public void onCompletion(String strcomplete) { |
74,7 → 87,7 |
if ((jsonArray = jsonValue.isArray()) != null) { |
// Url Image |
setImage(((JSONString) jsonArray.get(0)).stringValue()); |
setImageBottom(((JSONString) jsonArray.get(0)).stringValue()); |
} |
} |
81,4 → 94,34 |
}); |
} |
public void setImageTop(String url) { |
if (url.compareTo("null")!=0) { |
// setPopupPosition(3*(Window.getClientWidth()/4), mediator.getInventoryItemList().getAbsoluteTop()+50); |
setPopupPosition(mediator.getLeftPanel().getAbsoluteLeft()+10, mediator.getLeftPanel().getAbsoluteTop() + (mediator.getLeftPanel().getOffsetHeight()/2)); |
show(); |
imageTop.setUrl(url); |
} |
else { |
hide(); |
} |
} |
public void setImageBottom(String url) { |
if (url.compareTo("null")!=0) { |
// setPopupPosition(3*(Window.getClientWidth()/4), mediator.getInventoryItemList().getAbsoluteTop()+50); |
setPopupPosition(mediator.getLeftPanel().getAbsoluteLeft()+10, mediator.getLeftPanel().getAbsoluteTop() + (mediator.getLeftPanel().getOffsetHeight()/2)); |
show(); |
imageBottom.setUrl(url); |
} |
else { |
hide(); |
} |
} |
} |
/trunk/src/org/tela_botanica/client/EntryPanel.java |
---|
1,32 → 1,6 |
/** |
David Delon david.delon@clapas.net 2007 |
Ce logiciel est régi par la licence CeCILL soumise au droit français et |
respectant les principes de diffusion des logiciels libres. Vous pouvez |
utiliser, modifier et/ou redistribuer ce programme sous les conditions |
de la licence CeCILL telle que diffusée par le CEA, le CNRS et l'INRIA |
sur le site "http://www.cecill.info". |
En contrepartie de l'accessibilité au code source et des droits de copie, |
de modification et de redistribution accordés par cette licence, il n'est |
offert aux utilisateurs qu'une garantie limitée. Pour les mêmes raisons, |
seule une responsabilité restreinte pèse sur l'auteur du programme, le |
titulaire des droits patrimoniaux et les concédants successifs. |
A cet égard l'attention de l'utilisateur est attirée sur les risques |
associés au chargement, à l'utilisation, à la modification et/ou au |
développement et à la reproduction du logiciel par l'utilisateur étant |
donné sa spécificité de logiciel libre, qui peut le rendre complexe à |
manipuler et qui le réserve donc à des développeurs et des professionnels |
avertis possédant des connaissances informatiques approfondies. Les |
utilisateurs sont donc invités à charger et tester l'adéquation du |
logiciel à leurs besoins dans des conditions permettant d'assurer la |
sécurité de leurs systèmes et ou de leurs données et, plus généralement, |
à l'utiliser et l'exploiter dans les mêmes conditions de sécurité. |
Le fait que vous puissiez accéder à cet en-tête signifie que vous avez |
pris connaissance de la licence CeCILL, et que vous en avez accepté les |
termes. |
*/ |
/* |
365,7 → 339,7 |
} |
/* |
* Numero d'ordre du relevé affiché |
* Numero d'ordre du relev� affich� |
* |
*/ |
375,7 → 349,7 |
/* |
* Numero d'ordre du relevé affiché |
* Numero d'ordre du relev� affich� |
* |
*/ |
386,7 → 360,7 |
/** |
* Mise a jour de l'affichage a partir de données deja saisie |
* Mise a jour de l'affichage a partir de donn�es deja saisie |
* |
*/ |
476,6 → 450,9 |
/* +--Fin du code ---------------------------------------------------------------------------------------+ |
* $Log$ |
* Revision 1.6 2007-06-06 13:29:30 ddelon |
* v0.09 |
* |
* Revision 1.5 2007-05-22 14:27:08 ddelon |
* reglage modification |
* |
/trunk/src/org/tela_botanica/client/TopPanel.java |
---|
1,17 → 1,16 |
/** |
David Delon david.delon@clapas.net 2007 |
*/ |
/* |
* Copyright 2006 Google Inc. |
* TopPanel.java : affichage information portant sur le statut de la connexion utilisateur |
* |
* Licensed under the Apache License, Version 2.0 (the "License"); you may not |
* use this file except in compliance with the License. You may obtain a copy of |
* the License at |
* |
* http://www.apache.org/licenses/LICENSE-2.0 |
* |
* Unless required by applicable law or agreed to in writing, software |
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
* License for the specific language governing permissions and limitations under |
* the License. |
* 1: Le programme affiche le statut connecte si l'utilisateur s'est connecte precedemment, sinon s'affiche le statut deconnecte |
* 2: Le programme arme les actions liees a la connection ou a la deconnection |
* - Connection : affichage de la boite de connexion |
* - Deconnexion : appel du service de deconnexion, et appel de la re-initialisation de l'affichage pour le nouvel identifiant utilisateur obtenu (identifiant de session) |
*/ |
package org.tela_botanica.client; |
30,11 → 29,7 |
import com.google.gwt.user.client.ui.Label; |
import com.google.gwt.user.client.ui.Widget; |
/** |
* Composite permet de wrapper des Widget pour creer un nouveau Widget cf methode initWidget() |
*/ |
public class TopPanel extends Composite { |
76,10 → 71,14 |
inner.setSpacing(3); |
outer.add(inner); |
signLabel.addClickListener( |
new ClickListener() { |
public void onClick(Widget sender) { |
// Non connecte ? Lien vers boite de connection |
if (!mediator.getConnected()) { |
LoginDialog loginDialog = new LoginDialog(med); |
92,6 → 91,7 |
else { |
// Deja Connecte : lancement deconnexion sur selection de l'action |
HTTPRequest.asyncGet(serviceBaseUrl + "/User/" + user , |
new ResponseTextHandler() { |
100,11 → 100,11 |
JSONValue jsonValue = JSONParser.parse(str); |
JSONArray jsonArray; |
if ((jsonArray = jsonValue.isArray()) != null) { |
user = ((JSONString) jsonArray.get(0)).stringValue(); |
user = ((JSONString) jsonArray.get(0)).stringValue(); // Identifiant utilisateur : identifant de session |
mediator.setConnected(((JSONBoolean) jsonArray.get(1)).booleanValue()); |
} |
if (!mediator.getConnected()) { |
if (!mediator.getConnected()) { // La deconnexion a ete accepte : |
mediator.onLogoff(user); |
} |
} |
129,3 → 129,9 |
} |
/* +--Fin du code ---------------------------------------------------------------------------------------+ |
* $Log$ |
* |
*/ |
/trunk/src/org/tela_botanica/client/LoginDialog.java |
---|
1,32 → 1,7 |
/** |
David Delon david.delon@clapas.net 2007 |
Ce logiciel est régi par la licence CeCILL soumise au droit français et |
respectant les principes de diffusion des logiciels libres. Vous pouvez |
utiliser, modifier et/ou redistribuer ce programme sous les conditions |
de la licence CeCILL telle que diffusée par le CEA, le CNRS et l'INRIA |
sur le site "http://www.cecill.info". |
En contrepartie de l'accessibilité au code source et des droits de copie, |
de modification et de redistribution accordés par cette licence, il n'est |
offert aux utilisateurs qu'une garantie limitée. Pour les mêmes raisons, |
seule une responsabilité restreinte pèse sur l'auteur du programme, le |
titulaire des droits patrimoniaux et les concédants successifs. |
A cet égard l'attention de l'utilisateur est attirée sur les risques |
associés au chargement, à l'utilisation, à la modification et/ou au |
développement et à la reproduction du logiciel par l'utilisateur étant |
donné sa spécificité de logiciel libre, qui peut le rendre complexe à |
manipuler et qui le réserve donc à des développeurs et des professionnels |
avertis possédant des connaissances informatiques approfondies. Les |
utilisateurs sont donc invités à charger et tester l'adéquation du |
logiciel à leurs besoins dans des conditions permettant d'assurer la |
sécurité de leurs systèmes et ou de leurs données et, plus généralement, |
à l'utiliser et l'exploiter dans les mêmes conditions de sécurité. |
Le fait que vous puissiez accéder à cet en-tête signifie que vous avez |
pris connaissance de la licence CeCILL, et que vous en avez accepté les |
termes. |
*/ |
/* |
36,10 → 11,10 |
* Dialogue de validation de l'identification utilisateur |
* |
* 1 : L'utilisateur saisit son identifiant (e-mail) et son mot de passe |
* 2 : Le dialogue contrôle auprès du système distant la validité des informations saisies |
* 3 : Le dialogue transmet au système local les informations d'identification |
* 2 : Le dialogue controle aupres du systeme distant la validite des informations saisies |
* 3 : Le dialogue transmet au systeme local les informations d'identification |
* 3a : Le dialogue informe l'utilisateur que les elements d'identification ne sont pas valide : retour au point 1, ou passe au point 4. |
* 4 : Clôture du dialogue |
* 4 : Cloture du dialogue |
* 5 : Appel du dialogue d'importation |
*/ |
168,7 → 143,7 |
/** |
* Appel du service d'identification et positionnement de l'état de connection en fonction du résultat. |
* Appel du service d'identification et positionnement de l'etat de connection en fonction du resultat. |
* |
* @param login : identifiant saisi |
* @param password : mot de passe saisi |
232,6 → 207,9 |
/* +--Fin du code ---------------------------------------------------------------------------------------+ |
* $Log$ |
* Revision 1.9 2007-05-21 21:03:44 ddelon |
* nettoyage de code |
* |
* Revision 1.8 2007-05-21 18:14:06 ddelon |
* Gestion importation releve locaux |
* |
/trunk/src/org/tela_botanica/client/ImportDialog.java |
---|
2,32 → 2,6 |
David Delon david.delon@clapas.net 2007 |
Ce logiciel est régi par la licence CeCILL soumise au droit français et |
respectant les principes de diffusion des logiciels libres. Vous pouvez |
utiliser, modifier et/ou redistribuer ce programme sous les conditions |
de la licence CeCILL telle que diffusée par le CEA, le CNRS et l'INRIA |
sur le site "http://www.cecill.info". |
En contrepartie de l'accessibilité au code source et des droits de copie, |
de modification et de redistribution accordés par cette licence, il n'est |
offert aux utilisateurs qu'une garantie limitée. Pour les mêmes raisons, |
seule une responsabilité restreinte pèse sur l'auteur du programme, le |
titulaire des droits patrimoniaux et les concédants successifs. |
A cet égard l'attention de l'utilisateur est attirée sur les risques |
associés au chargement, à l'utilisation, à la modification et/ou au |
développement et à la reproduction du logiciel par l'utilisateur étant |
donné sa spécificité de logiciel libre, qui peut le rendre complexe à |
manipuler et qui le réserve donc à des développeurs et des professionnels |
avertis possédant des connaissances informatiques approfondies. Les |
utilisateurs sont donc invités à charger et tester l'adéquation du |
logiciel à leurs besoins dans des conditions permettant d'assurer la |
sécurité de leurs systèmes et ou de leurs données et, plus généralement, |
à l'utiliser et l'exploiter dans les mêmes conditions de sécurité. |
Le fait que vous puissiez accéder à cet en-tête signifie que vous avez |
pris connaissance de la licence CeCILL, et que vous en avez accepté les |
termes. |
*/ |
/* |
34,12 → 8,12 |
* ImportDialog.java (DialogBox) |
* |
* Cas d'utilisation : |
* Dialogue d'importation des données temporaires non liées à un utilisateur. |
* Dialogue d'importation des donnees temporaires non liees a un utilisateur. |
* |
* 1 : Le dialogue propose à l'utilisateur d'importer des releves saisie avant identification |
* 2 : Le dialogue transmet au système distant la demande d'importation |
* 3 : Le dialogue transmet au système local les informations d'identification |
* 4 : Clôture du dialogue |
* 1 : Le dialogue propose a l'utilisateur d'importer des releves saisie avant identification |
* 2 : Le dialogue transmet au systeme distant la demande d'importation |
* 3 : Le dialogue transmet au systeme local les informations d'identification |
* 4 : Cloture du dialogue |
*/ |
package org.tela_botanica.client; |
72,7 → 46,7 |
Grid inner = new Grid(2,2); |
/* |
* Voulez-vous importer vos relevés en cours ? |
* Voulez-vous importer vos relev�s en cours ? |
* Bouton_Ok Bouton_Annuler |
*/ |
116,7 → 90,7 |
/** |
* Appel du service d'identification et positionnement de l'état de connection en fonction du résultat. |
* Appel du service d'identification et positionnement de l'�tat de connection en fonction du r�sultat. |
* |
* @param login : identifiant saisi |
* @param password : mot de passe saisi |
160,6 → 134,9 |
/* +--Fin du code ---------------------------------------------------------------------------------------+ |
* $Log$ |
* Revision 1.2 2007-06-06 13:29:30 ddelon |
* v0.09 |
* |
* Revision 1.1 2007-05-21 18:14:06 ddelon |
* Gestion importation releve locaux |
* |