Subversion Repositories eFlore/Archives.cel-v2

Rev

Rev 43 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 43 Rev 48
Line 1... Line 1...
1
package org.tela_botanica.client.modeles;
1
package org.tela_botanica.client.modeles;
Line 2... Line -...
2
 
-
 
3
import org.tela_botanica.client.image.ImageMediateur;
2
 
4
import org.tela_botanica.client.image.ImageModele;
3
import org.tela_botanica.client.image.ImageModele;
Line 5... Line -...
5
import org.tela_botanica.client.interfaces.Rafraichissable;
-
 
6
 
-
 
7
import com.google.gwt.json.client.JSONArray;
4
import org.tela_botanica.client.interfaces.Rafraichissable;
8
import com.google.gwt.json.client.JSONObject;
5
 
9
import com.google.gwt.json.client.JSONParser;
6
import com.google.gwt.json.client.JSONParser;
10
import com.google.gwt.json.client.JSONString;
7
import com.google.gwt.json.client.JSONString;
11
import com.google.gwt.json.client.JSONValue;
8
import com.google.gwt.json.client.JSONValue;
12
import com.google.gwt.user.client.HTTPRequest;
-
 
13
import com.google.gwt.user.client.ResponseTextHandler;
-
 
Line 14... Line 9...
14
import com.google.gwt.user.client.Window;
9
import com.google.gwt.user.client.HTTPRequest;
15
import com.google.gwt.user.client.ui.Image;
10
import com.google.gwt.user.client.ResponseTextHandler;
16
 
11
 
17
/**
12
/**
Line 24... Line 19...
24
	/**
19
	/**
25
	 * Le modèle associé au DAO
20
	 * Le modèle associé au DAO
26
	 */
21
	 */
27
	private ImageModele iModele = null ;
22
	private ImageModele iModele = null ;
Line -... Line 23...
-
 
23
	
-
 
24
	public NombreImageAsynchroneDAO(ImageModele im)
-
 
25
	{
-
 
26
		iModele = im ;
-
 
27
	}
28
	
28
	
29
	/**
29
	/**
30
	 * Setteur pour le modèle
30
	 * Setteur pour le modèle
31
	 * @param im le modèlme à associer
31
	 * @param im le modèlme à associer
32
	 */
32
	 */
Line 75... Line 75...
75
				if(responseValue.isArray() != null)
75
				if(responseValue.isArray() != null)
76
				{
76
				{
77
					// qui contient une valeur : le nombre d'images correspondant au critères
77
					// qui contient une valeur : le nombre d'images correspondant au critères
78
					JSONValue res = responseValue.isArray().get(0) ;
78
					JSONValue res = responseValue.isArray().get(0) ;
79
						JSONString reponseNombre = res.isString() ;
79
						JSONString reponseNombre = res.isString() ;
80
						int maxImages = (int)Integer.parseInt(reponseNombre.stringValue()) ;
80
						int maxImages = Integer.parseInt(reponseNombre.stringValue()) ;
81
						int[] nbImages = {maxImages} ;
81
						int[] nbImages = {maxImages} ;
82
						// on le met dans un tableau d'entiers qu'on tranmset au demandeur de la mise à jour
82
						// on le met dans un tableau d'entiers qu'on tranmset au demandeur de la mise à jour
83
						r.rafraichir(nbImages, true) ;
83
						r.rafraichir(nbImages, true) ;
84
				}
84
				}