Subversion Repositories eFlore/Applications.del

Rev

Rev 537 | Rev 814 | 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 org.tela_botanica.del.client.modeles.Image;
335 benjamin 4
import org.tela_botanica.del.client.modeles.InformationsRecherche;
9 benjamin 5
import org.tela_botanica.del.client.modeles.Observation;
178 benjamin 6
import org.tela_botanica.del.client.modeles.Protocole;
537 gduche 7
import org.tela_botanica.del.client.modeles.Utilisateur;
8
import com.google.gwt.user.client.Window;
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 int numPageRechercheImage = 0;
349 aurelien 17
	private int nbTotalImagesRecherchees = 0;
335 benjamin 18
 
579 gduche 19
	private int pasPagination = 12;
445 benjamin 20
	private int pageCouranteRechercheImage = 1;
21
	private int pageCouranteRechercheObservations = 1;
335 benjamin 22
	private InformationsRecherche informationsRechercheImage;
23
	private InformationsRecherche informationsRechercheObservation;
537 gduche 24
	private Utilisateur utilisateur;
335 benjamin 25
 
14 benjamin 26
	private static CacheClient instance;
9 benjamin 27
 
14 benjamin 28
	private CacheClient() {
9 benjamin 29
		instance = this;
30
	}
31
 
537 gduche 32
	public Utilisateur getUtilisateur() {
33
		if (this.utilisateur == null) {
34
			this.utilisateur = new Utilisateur(null);
35
		}
36
		return this.utilisateur;
37
	}
38
 
39
	public void setUtilisateur(Utilisateur utilisateur) {
40
		this.utilisateur = utilisateur;
41
	}
42
 
230 gduche 43
	public Observation getObservationCourante() {
44
		return observationCourante;
9 benjamin 45
	}
46
 
230 gduche 47
	public void setObservationCourante(Observation observationCourante) {
48
		this.observationCourante = observationCourante;
9 benjamin 49
	}
50
 
14 benjamin 51
	public static CacheClient getInstance() {
9 benjamin 52
		if (instance == null) {
14 benjamin 53
			instance = new CacheClient();
9 benjamin 54
		}
55
		return instance;
56
	}
57
 
73 benjamin 58
	public String getTaxonPourRechercheEflore() {
59
		return taxonPourRechercheEflore;
60
	}
61
 
62
	public void setTaxonPourRechercheEflore(String taxonPourRechercheEflore) {
63
		this.taxonPourRechercheEflore = taxonPourRechercheEflore;
64
	}
65
 
147 benjamin 66
	public int getNumPageRechercheImage() {
67
		return numPageRechercheImage;
68
	}
69
 
335 benjamin 70
	// Pour la recherche :
311 gduche 71
	public int getPasPagination() {
72
		return pasPagination;
147 benjamin 73
	}
335 benjamin 74
 
311 gduche 75
	public void setPasPagination(int pasPagination) {
76
		this.pasPagination = pasPagination;
147 benjamin 77
	}
335 benjamin 78
 
358 benjamin 79
	public void setPageCouranteRechercheImages(int pageCouranteRecherche) {
80
		this.pageCouranteRechercheImage = pageCouranteRecherche;
311 gduche 81
	}
335 benjamin 82
 
358 benjamin 83
	public int getPageCouranteRechercheImage() {
84
		return this.pageCouranteRechercheImage;
311 gduche 85
	}
147 benjamin 86
 
349 aurelien 87
	public void setNbTotalImagesRecherchees(int nbTotalImagesRecherchees) {
88
		this.nbTotalImagesRecherchees = nbTotalImagesRecherchees;
89
	}
361 benjamin 90
 
349 aurelien 91
	public int getNbTotalImagesRecherchees() {
92
		return this.nbTotalImagesRecherchees;
93
	}
147 benjamin 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
 
335 benjamin 111
	public InformationsRecherche getInformationsRechercheImage() {
467 aurelien 112
		if(informationsRechercheImage == null) {
113
			informationsRechercheImage = new InformationsRecherche();
114
		}
335 benjamin 115
		return informationsRechercheImage;
116
	}
117
 
118
	public InformationsRecherche getInformationsRechercheObservation() {
467 aurelien 119
		if(informationsRechercheObservation == null) {
120
			informationsRechercheObservation = new InformationsRecherche();
121
		}
335 benjamin 122
		return informationsRechercheObservation;
123
	}
124
 
125
	public void setInformationsRechercheImage(InformationsRecherche informationsRechercheImage) {
126
		this.informationsRechercheImage = informationsRechercheImage;
127
	}
128
 
129
	public void setInformationsRechercheObservation(InformationsRecherche informationsRechercheObservation) {
130
		this.informationsRechercheObservation = informationsRechercheObservation;
131
	}
132
 
358 benjamin 133
	public int getPageCouranteRechercheObservations() {
134
		return pageCouranteRechercheObservations;
135
	}
136
 
137
	public void setPageCouranteRechercheObservations(int pageCouranteRechercheObservations) {
138
		this.pageCouranteRechercheObservations = pageCouranteRechercheObservations;
139
	}
140
 
9 benjamin 141
}