Subversion Repositories eFlore/Applications.del

Rev

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

Rev 226 Rev 230
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.Observation;
6
import org.tela_botanica.del.client.modeles.Observation;
7
import org.tela_botanica.del.client.modeles.Protocole;
7
import org.tela_botanica.del.client.modeles.Protocole;
8
 
8
 
9
public class CacheClient {
9
public class CacheClient {
10
 
10
 
11
	private Observation currentObservation;
-
 
12
	
11
	private Observation observationCourante;
13
	private Image imageCourante;
-
 
14
 
12
	private Image imageCourante;
15
	private String taxonPourRechercheEflore;
-
 
16
	
13
	private String taxonPourRechercheEflore;
17
	private Protocole protocoleCourant;
-
 
18
 
14
	private Protocole protocoleCourant;
19
	private List<Image> images;
-
 
20
 
15
	private List<Image> images;
21
	private int numPageRechercheImage = 0;
-
 
22
 
16
	private int numPageRechercheImage = 0;
23
	private int pasPageRechercheImage = 10;
-
 
24
 
17
	private int pasPageRechercheImage = 10;
25
	private static CacheClient instance;
18
	private static CacheClient instance;
26
 
19
 
27
	private CacheClient() {
20
	private CacheClient() {
28
		instance = this;
21
		instance = this;
29
	}
22
	}
30
 
23
 
31
	public Observation getCurrentObservation() {
24
	public Observation getObservationCourante() {
32
		return currentObservation;
25
		return observationCourante;
33
	}
26
	}
34
 
27
 
35
	public void setCurrentObservation(Observation currentObservation) {
28
	public void setObservationCourante(Observation observationCourante) {
36
		this.currentObservation = currentObservation;
29
		this.observationCourante = observationCourante;
37
	}
30
	}
38
 
31
 
39
	public static CacheClient getInstance() {
32
	public static CacheClient getInstance() {
40
		if (instance == null) {
33
		if (instance == null) {
41
			instance = new CacheClient();
34
			instance = new CacheClient();
42
		}
35
		}
43
		return instance;
36
		return instance;
44
	}
37
	}
45
 
38
 
46
	public String getTaxonPourRechercheEflore() {
39
	public String getTaxonPourRechercheEflore() {
47
		return taxonPourRechercheEflore;
40
		return taxonPourRechercheEflore;
48
	}
41
	}
49
 
42
 
50
	public void setTaxonPourRechercheEflore(String taxonPourRechercheEflore) {
43
	public void setTaxonPourRechercheEflore(String taxonPourRechercheEflore) {
51
		this.taxonPourRechercheEflore = taxonPourRechercheEflore;
44
		this.taxonPourRechercheEflore = taxonPourRechercheEflore;
52
	}
45
	}
53
 
46
 
54
	public int getNumPageRechercheImage() {
47
	public int getNumPageRechercheImage() {
55
		return numPageRechercheImage;
48
		return numPageRechercheImage;
56
	}
49
	}
57
 
50
 
58
	public void setNumPageRechercheImage(int numPageRechercheImage) {
51
	public void setNumPageRechercheImage(int numPageRechercheImage) {
59
		this.numPageRechercheImage = numPageRechercheImage;
52
		this.numPageRechercheImage = numPageRechercheImage;
60
	}
53
	}
61
 
54
 
62
	public int getPasPageRechercheImage() {
55
	public int getPasPageRechercheImage() {
63
		return pasPageRechercheImage;
56
		return pasPageRechercheImage;
64
	}
57
	}
65
 
58
 
66
	public void setPasPageRechercheImage(int pasPageRechercheImage) {
59
	public void setPasPageRechercheImage(int pasPageRechercheImage) {
67
		this.pasPageRechercheImage = pasPageRechercheImage;
60
		this.pasPageRechercheImage = pasPageRechercheImage;
68
	}
61
	}
69
 
62
 
70
	public List<Image> getImages() {
63
	public List<Image> getImages() {
71
		return images;
64
		return images;
72
	}
65
	}
73
	
66
 
74
	public List<Image> getSousListeImages(int premiere, int derniere) {
67
	public List<Image> getSousListeImages(int premiere, int derniere) {
75
		if(derniere > images.size() - 1) {
68
		if (derniere > images.size() - 1) {
76
			derniere = images.size() - 1;
69
			derniere = images.size() - 1;
77
		}
70
		}
78
		return images.subList(premiere, derniere);
71
		return images.subList(premiere, derniere);
79
	}
72
	}
80
 
73
 
81
	public void setImages(List<Image> images) {
74
	public void setImages(List<Image> images) {
82
		this.images = images;
75
		this.images = images;
83
	}
76
	}
84
 
77
 
85
	public Image getImageCourante() {
78
	public Image getImageCourante() {
86
		return imageCourante;
79
		return imageCourante;
87
	}
80
	}
88
 
81
 
89
	public void setImageCourante(Image imageCourante) {
82
	public void setImageCourante(Image imageCourante) {
90
		this.imageCourante = imageCourante;
83
		this.imageCourante = imageCourante;
91
	}
84
	}
92
 
85
 
93
	public Protocole getProtocoleCourant() {
86
	public Protocole getProtocoleCourant() {
94
		return protocoleCourant;
87
		return protocoleCourant;
95
	}
88
	}
96
 
89
 
97
	public void setProtocoleCourant(Protocole protocoleCourant) {
90
	public void setProtocoleCourant(Protocole protocoleCourant) {
98
		this.protocoleCourant = protocoleCourant;
91
		this.protocoleCourant = protocoleCourant;
99
	}
92
	}
100
 
93
 
101
}
94
}