Subversion Repositories eFlore/Applications.del

Rev

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

Rev 500 Rev 629
1
package org.tela_botanica.del.client.modeles;
1
package org.tela_botanica.del.client.modeles;
2
 
2
 
3
import java.util.ArrayList;
3
import java.util.ArrayList;
4
import java.util.HashMap;
4
import java.util.HashMap;
5
import java.util.List;
5
import java.util.List;
6
import java.util.Map;
6
import java.util.Map;
7
 
7
 
8
import com.google.gwt.user.client.Window;
8
import com.google.gwt.user.client.Window;
9
 
9
 
10
public class Image {
10
public class Image {
11
 
11
 
12
	private String idImage;
12
	private String idImage;
13
	private Observation observation;
13
	private Observation observation;
14
	private String url;
14
	private String url;
15
	private String urlFormat;
15
	private String urlFormat;
16
	private String miniature;
16
	private String miniature;
17
 
17
 
18
	public String getUrl() {
18
	public String getUrl() {
19
		return url;
19
		return url;
20
	}
20
	}
21
 
21
 
22
	public String getMiniature() {
22
	public String getMiniature() {
23
		return miniature;
23
		return miniature;
24
	}
24
	}
25
 
25
 
26
	public String getUrlFormat(String format) {
26
	public String getUrlFormat(String format) {
27
		return urlFormat.replaceAll("%s%", format);
27
		return urlFormat.replaceAll("%s%", format);
28
	}
28
	}
29
 
29
 
30
	public void setUrlFormat(String urlFormat) {
30
	public void setUrlFormat(String urlFormat) {
31
		this.urlFormat = urlFormat;
31
		this.urlFormat = urlFormat;
32
	}
32
	}
33
 
33
 
34
	public void setUrl(String url) {
34
	public void setUrl(String url) {
35
		this.url = url;
35
		this.url = url;
36
	}
36
	}
37
 
37
 
38
	public void setMiniature(String url) {
38
	public void setMiniature(String url) {
39
		miniature = url;
39
		miniature = url;
40
	}
40
	}
41
 
41
 
42
	public String getIdImage() {
42
	public String getIdImage() {
43
		return idImage;
43
		return idImage;
44
	}
44
	}
45
 
45
 
46
	public void setIdImage(String idImage) {
46
	public void setIdImage(String idImage) {
47
		this.idImage = idImage;
47
		this.idImage = idImage;
48
	}
48
	}
-
 
49
 
49
 
50
	// Impossible d'utiliser le type générique Map ici, pourquoi ? je ne sais pas !
-
 
51
	private HashMap<String, HashMap<String, VoteProtocole>> votesProtocoles = new HashMap<String, HashMap<String, VoteProtocole>>();
-
 
52
 
-
 
53
	public void ajouterVoteProtocole(VoteProtocole voteProcotole) {
-
 
54
		getVotesProtocoles(voteProcotole.getIdProtocole()).put(voteProcotole.getContributeur(), voteProcotole);
50
	private Map<String, List<VoteProtocole>> voteProtocoles = new HashMap<String, List<VoteProtocole>>();
55
	}
51
 
56
	
52
	public List<VoteProtocole> getVoteProtocoles(String id_protocole) {
57
	public HashMap<String, VoteProtocole> getVotesProtocoles(String id_protocole) {
53
		if(!voteProtocoles.containsKey(""+id_protocole) || voteProtocoles.get(""+id_protocole) == null) {
58
		if(!votesProtocoles.containsKey(""+id_protocole) || votesProtocoles.get(""+id_protocole) == null) {
54
			voteProtocoles.put(""+id_protocole, new ArrayList<VoteProtocole>());
59
			votesProtocoles.put(""+id_protocole, new HashMap<String, VoteProtocole>());
-
 
60
		}
-
 
61
		return votesProtocoles.get(id_protocole+"");
-
 
62
	}
-
 
63
	
55
		}
64
	public HashMap<String, VoteProtocole> getVotesProtocoles(int id_protocole) {	
56
		return voteProtocoles.get(id_protocole+"");
65
		return getVotesProtocoles(id_protocole+"");
57
	}
66
	}
58
	
67
	
59
	public List<VoteProtocole> getVotesProtocoles(int id_protocole) {	
68
	public HashMap<String, HashMap<String, VoteProtocole>> getListeVotesProtocoles() {
60
		return getVoteProtocoles(id_protocole+"");
69
		return votesProtocoles;
61
	}
70
	}
62
	
71
	
63
	public void setVoteProtocoles(Map<String, List<VoteProtocole>> voteProtocoles) {
72
	public void setVoteProtocoles(HashMap<String, HashMap<String, VoteProtocole>> voteProtocoles) {
64
		this.voteProtocoles = voteProtocoles;
73
		this.votesProtocoles = voteProtocoles;
65
	}
74
	}
66
 
75
 
67
	public void setVoteProtocoles(String id_protocole, List<VoteProtocole> voteProtocoles) {
76
	public void setVoteProtocoles(String id_protocole, HashMap<String, VoteProtocole> voteProtocoles) {
68
		this.voteProtocoles.put(id_protocole, voteProtocoles);
77
		this.votesProtocoles.put(id_protocole, voteProtocoles);
69
	}
78
	}
70
 
79
 
71
	public Observation getObservation() {
80
	public Observation getObservation() {
72
		return observation;
81
		return observation;
73
	}
82
	}
74
 
83
 
75
	public void setObservation(Observation observation) {
84
	public void setObservation(Observation observation) {
76
		this.observation = observation;
85
		this.observation = observation;
77
	}
86
	}
78
 
87
 
79
}
88
}