Subversion Repositories eFlore/Applications.del

Rev

Rev 263 | Rev 335 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 263 Rev 311
1
package org.tela_botanica.del.client.cache;
1
package org.tela_botanica.del.client.cache;
2
 
2
 
3
import java.util.List;
3
import java.util.List;
4
 
4
 
5
import org.tela_botanica.del.client.modeles.Image;
5
import org.tela_botanica.del.client.modeles.Image;
6
import org.tela_botanica.del.client.modeles.Observation;
6
import org.tela_botanica.del.client.modeles.Observation;
7
import org.tela_botanica.del.client.modeles.Protocole;
7
import org.tela_botanica.del.client.modeles.Protocole;
8
 
8
 
9
public class CacheClient {
9
public class CacheClient {
10
 
10
 
11
	private Observation observationCourante;
11
	private Observation observationCourante;
12
	private Image imageCourante;
12
	private Image imageCourante;
13
	private String taxonPourRechercheEflore;
13
	private String taxonPourRechercheEflore;
14
	private Protocole protocoleCourant;
14
	private Protocole protocoleCourant;
15
	private List<Image> images;
15
	private List<Image> images;
16
	private int numPageRechercheImage = 0;
16
	private int numPageRechercheImage = 0;
-
 
17
	
-
 
18
	private int pasPagination = 10;
17
	private int paginationPasRechercheImage = 10;
19
	private int pageCouranteRecherche = 0;
-
 
20
	private String especeRecherche = "";
-
 
21
	
18
	private static CacheClient instance;
22
	private static CacheClient instance;
19
 
23
 
20
	private CacheClient() {
24
	private CacheClient() {
21
		instance = this;
25
		instance = this;
22
	}
26
	}
23
 
27
 
24
	public Observation getObservationCourante() {
28
	public Observation getObservationCourante() {
25
		return observationCourante;
29
		return observationCourante;
26
	}
30
	}
27
 
31
 
28
	public void setObservationCourante(Observation observationCourante) {
32
	public void setObservationCourante(Observation observationCourante) {
29
		this.observationCourante = observationCourante;
33
		this.observationCourante = observationCourante;
30
	}
34
	}
31
 
35
 
32
	public static CacheClient getInstance() {
36
	public static CacheClient getInstance() {
33
		if (instance == null) {
37
		if (instance == null) {
34
			instance = new CacheClient();
38
			instance = new CacheClient();
35
		}
39
		}
36
		return instance;
40
		return instance;
37
	}
41
	}
38
 
42
 
39
	public String getTaxonPourRechercheEflore() {
43
	public String getTaxonPourRechercheEflore() {
40
		return taxonPourRechercheEflore;
44
		return taxonPourRechercheEflore;
41
	}
45
	}
42
 
46
 
43
	public void setTaxonPourRechercheEflore(String taxonPourRechercheEflore) {
47
	public void setTaxonPourRechercheEflore(String taxonPourRechercheEflore) {
44
		this.taxonPourRechercheEflore = taxonPourRechercheEflore;
48
		this.taxonPourRechercheEflore = taxonPourRechercheEflore;
45
	}
49
	}
46
 
50
 
47
	public int getNumPageRechercheImage() {
51
	public int getNumPageRechercheImage() {
48
		return numPageRechercheImage;
52
		return numPageRechercheImage;
49
	}
53
	}
-
 
54
 
-
 
55
	//Pour la recherche  : 
-
 
56
	public int getPasPagination() {
-
 
57
		return pasPagination;
-
 
58
	}
50
 
59
	
51
	public void setNumPageRechercheImage(int numPageRechercheImage) {
60
	public void setPasPagination(int pasPagination) {
52
		this.numPageRechercheImage = numPageRechercheImage;
61
		this.pasPagination = pasPagination;
53
	}
62
	}
54
 
63
	
55
	public int getPaginationPasRechercheImage() {
64
	public String getEspeceRecherche() {
-
 
65
		return especeRecherche;
-
 
66
	}
-
 
67
	
-
 
68
	public void setEspeceRecherche(String especeRecherche) {
56
		return paginationPasRechercheImage;
69
		this.especeRecherche = especeRecherche;
57
	}
70
	}
58
 
71
	
59
	public void setPaginationPasRerchercheImage(int paginationPas) {
72
	public void setPageCouranteRecherche(int pageCouranteRecherche) {
-
 
73
		this.pageCouranteRecherche = pageCouranteRecherche;
-
 
74
	}
-
 
75
	
-
 
76
	public int getPageCouranteRecherche() {
60
		this.paginationPasRechercheImage = paginationPas;
77
		return this.pageCouranteRecherche;
61
	}
78
	}
62
 
79
 
63
	public List<Image> getImages() {
80
	public List<Image> getImages() {
64
		return images;
81
		return images;
65
	}
82
	}
66
 
83
 
67
	public List<Image> getSousListeImages(int premiere, int derniere) {
84
	public List<Image> getSousListeImages(int premiere, int derniere) {
68
		if (derniere > images.size() - 1) {
85
		if (derniere > images.size() - 1) {
69
			derniere = images.size() - 1;
86
			derniere = images.size() - 1;
70
		}
87
		}
71
		return images.subList(premiere, derniere);
88
		return images.subList(premiere, derniere);
72
	}
89
	}
73
 
90
 
74
	public void setImages(List<Image> images) {
91
	public void setImages(List<Image> images) {
75
		this.images = images;
92
		this.images = images;
76
	}
93
	}
77
 
94
 
78
	public Image getImageCourante() {
95
	public Image getImageCourante() {
79
		return imageCourante;
96
		return imageCourante;
80
	}
97
	}
81
 
98
 
82
	public void setImageCourante(Image imageCourante) {
99
	public void setImageCourante(Image imageCourante) {
83
		this.imageCourante = imageCourante;
100
		this.imageCourante = imageCourante;
84
	}
101
	}
85
 
102
 
86
	public Protocole getProtocoleCourant() {
103
	public Protocole getProtocoleCourant() {
87
		return protocoleCourant;
104
		return protocoleCourant;
88
	}
105
	}
89
 
106
 
90
	public void setProtocoleCourant(Protocole protocoleCourant) {
107
	public void setProtocoleCourant(Protocole protocoleCourant) {
91
		this.protocoleCourant = protocoleCourant;
108
		this.protocoleCourant = protocoleCourant;
92
	}
109
	}
93
 
110
 
94
}
111
}