Subversion Repositories eFlore/Applications.del

Rev

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

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