Subversion Repositories eFlore/Applications.del

Rev

Rev 263 | Rev 335 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

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