Subversion Repositories eFlore/Applications.del

Rev

Rev 500 | Rev 822 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

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