Subversion Repositories eFlore/Applications.del

Rev

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