Subversion Repositories eFlore/Applications.del

Rev

Rev 311 | Rev 349 | 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;
335 benjamin 18
 
311 gduche 19
	private int pasPagination = 10;
20
	private int pageCouranteRecherche = 0;
335 benjamin 21
	private InformationsRecherche informationsRechercheImage;
22
	private InformationsRecherche informationsRechercheObservation;
23
 
14 benjamin 24
	private static CacheClient instance;
9 benjamin 25
 
14 benjamin 26
	private CacheClient() {
9 benjamin 27
		instance = this;
28
	}
29
 
230 gduche 30
	public Observation getObservationCourante() {
31
		return observationCourante;
9 benjamin 32
	}
33
 
230 gduche 34
	public void setObservationCourante(Observation observationCourante) {
35
		this.observationCourante = observationCourante;
9 benjamin 36
	}
37
 
14 benjamin 38
	public static CacheClient getInstance() {
9 benjamin 39
		if (instance == null) {
14 benjamin 40
			instance = new CacheClient();
9 benjamin 41
		}
42
		return instance;
43
	}
44
 
73 benjamin 45
	public String getTaxonPourRechercheEflore() {
46
		return taxonPourRechercheEflore;
47
	}
48
 
49
	public void setTaxonPourRechercheEflore(String taxonPourRechercheEflore) {
50
		this.taxonPourRechercheEflore = taxonPourRechercheEflore;
51
	}
52
 
147 benjamin 53
	public int getNumPageRechercheImage() {
54
		return numPageRechercheImage;
55
	}
56
 
335 benjamin 57
	// Pour la recherche :
311 gduche 58
	public int getPasPagination() {
59
		return pasPagination;
147 benjamin 60
	}
335 benjamin 61
 
311 gduche 62
	public void setPasPagination(int pasPagination) {
63
		this.pasPagination = pasPagination;
147 benjamin 64
	}
335 benjamin 65
 
311 gduche 66
	public void setPageCouranteRecherche(int pageCouranteRecherche) {
67
		this.pageCouranteRecherche = pageCouranteRecherche;
68
	}
335 benjamin 69
 
311 gduche 70
	public int getPageCouranteRecherche() {
71
		return this.pageCouranteRecherche;
72
	}
147 benjamin 73
 
74
	public List<Image> getImages() {
75
		return images;
76
	}
230 gduche 77
 
224 aurelien 78
	public List<Image> getSousListeImages(int premiere, int derniere) {
230 gduche 79
		if (derniere > images.size() - 1) {
226 aurelien 80
			derniere = images.size() - 1;
81
		}
224 aurelien 82
		return images.subList(premiere, derniere);
83
	}
147 benjamin 84
 
85
	public void setImages(List<Image> images) {
86
		this.images = images;
87
	}
88
 
89
	public Image getImageCourante() {
90
		return imageCourante;
91
	}
92
 
93
	public void setImageCourante(Image imageCourante) {
94
		this.imageCourante = imageCourante;
95
	}
96
 
178 benjamin 97
	public Protocole getProtocoleCourant() {
98
		return protocoleCourant;
99
	}
100
 
101
	public void setProtocoleCourant(Protocole protocoleCourant) {
102
		this.protocoleCourant = protocoleCourant;
103
	}
104
 
335 benjamin 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
	}
120
 
9 benjamin 121
}