Subversion Repositories eFlore/Archives.cel-v1

Compare Revisions

Ignore whitespace Rev 24 → Rev 25

/trunk/src/org/tela_botanica/client/ImportDialog.java
80,7 → 80,7
// Validation bouton
HTML okButton=new HTML("Ok");
HTML okButton=new HTML("Oui");
okButton.setStyleName("html_button");
okButton.addClickListener(
new ClickListener() {
93,7 → 93,7
// Annulation
HTML cancelButton=new HTML("Annuler");
HTML cancelButton=new HTML("Non");
cancelButton.setStyleName("html_button");
cancelButton.addClickListener(
new ClickListener() {
160,6 → 160,9
 
/* +--Fin du code ---------------------------------------------------------------------------------------+
* $Log$
* Revision 1.1 2007-05-21 18:14:06 ddelon
* Gestion importation releve locaux
*
* Revision 1.7 2007-05-21 11:47:30 ddelon
* meta cvs
*
/trunk/src/org/tela_botanica/client/ActionPanel.java
30,8 → 30,8
 
public class ActionPanel extends Composite {
Mediator mediator=null;
 
private Mediator mediator=null;
private HTML exportButton=null;
 
public ActionPanel(final Mediator med) {
38,6 → 38,8
mediator=med;
mediator.registerActionPanel(this);
HorizontalPanel outer = new HorizontalPanel();
HorizontalPanel buttons = new HorizontalPanel();
buttons.setSpacing(3);
80,12 → 82,13
 
// Export de la totalité
HTML exportButton=new HTML("<a href=\""+mediator.getServiceBaseUrl()+"/InventoryExport/" +mediator.getUser()+"\">"+"Tout&nbsp;exporter</a>");
exportButton=new HTML("<a href=\""+mediator.getServiceBaseUrl()+"/InventoryExport/"
+ mediator.getUser() +
"\">"+"Export&nbsp;tableur</a>");
buttons.add(exportButton);
exportButton.setStyleName("html_button");
 
 
// Selections de l'affichage
HorizontalPanel selections = new HorizontalPanel();
133,4 → 136,9
}
 
 
public HTML getExportButton() {
return exportButton;
}
}
/trunk/src/org/tela_botanica/client/AutoCompleteAsyncTextBoxListenerCollection.java
3,11 → 3,13
import java.util.Iterator;
import java.util.Vector;
 
import com.google.gwt.user.client.ResponseTextHandler;
 
public class AutoCompleteAsyncTextBoxListenerCollection extends Vector {
private static final long serialVersionUID = -2767605614048989439L;
/**
* Fires a cellClicked event to all listeners.
* Fires a Text enter event to all listeners.
*
* @param sender the widget sending the event
* @param text the text sent
18,4 → 20,19
listener.onValidate(sender, text, value);
}
}
/**
* Fires a Text complete event to all listeners.
*
* @param sender the widget sending the event
* @param text the text sent
*/
public void fireTextBoxComplete(ResponseTextHandler sender, String text, String value) {
for (Iterator it = iterator(); it.hasNext();) {
AutoCompleteAsyncTextBoxListener listener = (AutoCompleteAsyncTextBoxListener) it.next();
listener.onComplete(sender, text, value);
}
}
 
}
/trunk/src/org/tela_botanica/client/Cel.java
23,6 → 23,7
private EntryPanel entryPanel = null;
private ActionPanel actionPanel = null;
private SearchPanel searchPanel = null;
private InfoPopup infoPopup = null;
private VerticalPanel rightPanel = null;
private Mediator mediator = null;
46,6 → 47,7
 
centerPanel = new CenterPanel(mediator);
 
topPanel = new TopPanel(mediator);
leftPanel = new LeftPanel(mediator);
55,6 → 57,8
actionPanel = new ActionPanel(mediator);
searchPanel = new SearchPanel(mediator);
rightPanel = new VerticalPanel();
infoPopup = new InfoPopup(mediator);
 
// Information haut de page (nom application, connexion ... etc).
// A regler
100,10 → 104,9
 
mediator.onInit();
RootPanel.get().add(outer);
 
 
// Call the window resized handler to get the initial sizes setup. Doing
// this in a deferred command causes it to occur after all widgets' sizes
// have been computed by the browser.
/trunk/src/org/tela_botanica/client/Mediator.java
27,7 → 27,10
private LocationAssistant locationAssistant=null;
private InventoryItem inventoryItem=null;
private EntryPanel entryPanel=null;
private ActionPanel actionPanel=null;
private TopPanel topPanel=null;
private LeftPanel leftPanel=null;
private InfoPopup infoPopup=null;
private TextBox date = null;
private TextBox complementLocation = null;
124,15 → 127,17
public void onLocationSelected(String loc) {
inventoryItemList.setLocation(loc);
inventoryItemList.setDate("all");
inventoryItemList.setStation("all");
// inventoryItemList.setDate("all");
// inventoryItemList.setStation("all");
inventoryItemList.updateCount();
// nameAssistant.setValue(null);
 
dateList.setLocation(loc);
dateList.setDate("all");
// dateList.setDate("all");
dateList.updateCount();
stationList.setLocation(loc);
stationList.setStation("all");
// stationList.setStation("all");
stationList.updateCount();
}
185,7 → 190,9
 
inventoryItemList.setStation(station);
inventoryItemList.updateCount();
// nameAssistant.setValue(null);
 
 
}
 
 
199,12 → 206,21
 
inventoryItemList.setDate(date);
inventoryItemList.updateCount();
// nameAssistant.setValue(null);
 
 
}
 
/**
* Action suivant la complétion d'un nom
*
*/
 
public void onNameCompleted(String value) {
infoPopup.setImageUrl(value);
}
/**
* Action prealable à l'ajout d'une observation : controle presence champs requis et lancement mise a jour
*
293,6 → 309,18
 
/**
* Declaration InfoPopup
* @param infoPopup
*/
public void registerInfoPopup(InfoPopup infoPopup) {
this.infoPopup=infoPopup;
}
 
 
/**
* Declaration StationList
* @param locationList
*/
365,8 → 393,12
}
 
public void registerActionPanel(ActionPanel actionPanel) {
this.actionPanel=actionPanel;
}
 
 
public void registerTopPanel(TopPanel topPanel) {
this.topPanel=topPanel;
}
384,7 → 416,17
}
 
/* Panneau gauche
*
*/
public void registerLeftPanel(LeftPanel leftPanel) {
this.leftPanel=leftPanel;
}
 
/**
* Recherche distante et asynchrone de l'utilisateur connecté, en retour lancement methode initialisation
483,6 → 525,14
}
 
 
public LeftPanel getLeftPanel() {
return leftPanel;
}
 
public InfoPopup getInfoPopup() {
return infoPopup;
}
 
public void setConnected(boolean connected) {
this.connected=connected;
493,5 → 543,10
return this.connected;
}
 
public ActionPanel getActionPanel() {
return this.actionPanel;
}
 
}
/trunk/src/org/tela_botanica/client/InventoryItemList.java
135,7 → 135,9
}
 
private static final int VISIBLE_TAXON_COUNT = 15;
 
 
private Grid header = new Grid(1, 3);
 
private FlexTable table = new FlexTable();
219,12 → 221,13
 
});
 
//updateCount();
// update()
 
initWidget(panel);
 
 
}
253,6 → 256,22
}
 
 
 
/**
* 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) {
mediator.onNameCompleted(value);
}
 
}
 
/**
265,9 → 284,14
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);
}
 
mediator.onAddInventoryItem();
}
 
635,7 → 659,18
 
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&nbsp;tableur</a>");
 
// table.setBorderWidth(1);
setStatusDisabled();
 
1018,9 → 1053,7
}
 
 
 
 
 
}
/trunk/src/org/tela_botanica/client/LeftPanel.java
28,9 → 28,14
private LocationList locationList = null;
private DateList dateList = null;
private StationList stationList = null;
private Mediator mediator=null;
 
public LeftPanel(Mediator mediator) {
public LeftPanel(Mediator med) {
 
mediator=med;
mediator.registerLeftPanel(this);
dateList = new DateList(mediator);
locationList = new LocationList(mediator);
stationList = new StationList(mediator);
/trunk/src/org/tela_botanica/client/AutoCompleteAsyncTextBox.java
315,10 → 315,15
// add selected item to textbox
protected void complete()
{
if(choices.getItemCount() > 0)
{
this.setText(choices.getItemText(choices.getSelectedIndex()));
currentValue=choices.getValue(choices.getSelectedIndex());
if (autoCompleteAsyncTextBoxListeners!= null) {
autoCompleteAsyncTextBoxListeners.fireTextBoxComplete(responseTextHandler,this.getText(),currentValue);
}
}
 
visible=false;
353,7 → 358,6
this.currentValue=value;
}
 
}
/trunk/src/org/tela_botanica/client/InfoPopup.java
New file
0,0 → 1,84
/*
* Copyright 2006 Google Inc.
*
* 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.
*/
package org.tela_botanica.client;
 
 
import com.google.gwt.json.client.JSONArray;
import com.google.gwt.json.client.JSONParser;
import com.google.gwt.json.client.JSONString;
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.ui.Image;
import com.google.gwt.user.client.ui.PopupPanel;
 
/**
* Composite permet de wrapper des Widget pour creer un nouveau Widget cf methode initWidget()
*/
 
public class InfoPopup extends PopupPanel {
private Mediator mediator=null;
private Image image = new Image();
public InfoPopup(final Mediator med) {
 
super(true);
mediator=med;
mediator.registerInfoPopup(this);
add(image);
 
}
 
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);
}
else {
hide();
}
 
}
 
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
setImage(((JSONString) jsonArray.get(0)).stringValue());
}
}
 
});
}
 
}
/trunk/src/org/tela_botanica/client/EntryPanel.java
86,17 → 86,22
private Button dateSelector = new Button("...");
boolean visible=false;
private Mediator mediator=null;
 
private String user= null;
private String ordre =null;
private CalendarWidget calendar = null; // Lazy instantiation
private PopupPanel choicesPopup = null; // Lazy instantiation
 
public EntryPanel(final Mediator med) {
Grid inner = new Grid(3,4);
 
mediator=med;
user=mediator.getUser();
 
113,7 → 118,6
outer.add(new HTML("<b>Saisir&nbsp;un&nbsp;relev&eacute;&nbsp;:</b>"));
 
Grid inner = new Grid(3,4);
 
for (int i=0; i<3;i++) {
inner.getCellFormatter().setWidth(i, 0, "3%");
120,9 → 124,11
inner.getCellFormatter().setWidth(i, 1, "47%");
inner.getCellFormatter().setWidth(i, 2, "3%");
inner.getCellFormatter().setWidth(i, 3, "47%");
}
}
 
 
 
nameAssistant = new NameAssistant(mediator);
locationAssistant = new LocationAssistant(mediator);
 
277,7 → 283,7
}
);
 
Button validButton = new Button("Valider");
351,7 → 357,6
 
}
 
initWidget(outer);
406,7 → 411,8
String ann=((JSONString) jsonArray .get(3)).stringValue();
if (ann.compareTo("0")!=0) {
nameAssistant.setValue(null);
nameAssistant.setValue(ann);
mediator.getInfoPopup().setImageUrl(ann);
}
else {
nameAssistant.setValue(null);
464,11 → 470,15
public void setUser(String user) {
this.user = user;
}
 
}
 
/* +--Fin du code ---------------------------------------------------------------------------------------+
* $Log$
* Revision 1.5 2007-05-22 14:27:08 ddelon
* reglage modification
*
* Revision 1.4 2007-05-21 21:01:35 ddelon
* Modification comportement boutons
*
/trunk/src/org/tela_botanica/client/AutoCompleteAsyncTextBoxListener.java
1,6 → 1,8
package org.tela_botanica.client;
 
import com.google.gwt.user.client.ResponseTextHandler;
 
 
/**
* Event listener interface for table events.
*/
13,4 → 15,13
* @param text : text selected
*/
void onValidate(SourcesAutoCompleteAsyncTextBoxEvents sender, String text, String value);
/**
* Fired when a AutoCompleteBox is completed (selection)
*
* @param sender the widget sending the event
* @param text : text selected
*/
 
void onComplete(ResponseTextHandler sender, String text, String value);
}