Subversion Repositories eFlore/Applications.del

Rev

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

package org.tela_botanica.del.client.modeles;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.google.gwt.user.client.Window;

public class Image {

        private String idImage;
        private Observation observation;
        private String url;
        private String urlFormat;
        private String miniature;

        public String getUrl() {
                return url;
        }

        public String getMiniature() {
                return miniature;
        }

        public String getUrlFormat(String format) {
                return urlFormat.replaceAll("%s%", format);
        }

        public void setUrlFormat(String urlFormat) {
                this.urlFormat = urlFormat;
        }

        public void setUrl(String url) {
                this.url = url;
        }

        public void setMiniature(String url) {
                miniature = url;
        }

        public String getIdImage() {
                return idImage;
        }

        public void setIdImage(String idImage) {
                this.idImage = idImage;
        }

        // Impossible d'utiliser le type générique Map ici, pourquoi ? je ne sais pas !
        private HashMap<String, HashMap<String, VoteProtocole>> votesProtocoles = new HashMap<String, HashMap<String, VoteProtocole>>();

        public void ajouterVoteProtocole(VoteProtocole voteProcotole) {
                getVotesProtocoles(voteProcotole.getIdProtocole()).put(voteProcotole.getContributeur(), voteProcotole);
        }
        
        public HashMap<String, VoteProtocole> getVotesProtocoles(String id_protocole) {
                if(!votesProtocoles.containsKey(""+id_protocole) || votesProtocoles.get(""+id_protocole) == null) {
                        votesProtocoles.put(""+id_protocole, new HashMap<String, VoteProtocole>());
                }
                return votesProtocoles.get(id_protocole+"");
        }
        
        public HashMap<String, VoteProtocole> getVotesProtocoles(int id_protocole) {    
                return getVotesProtocoles(id_protocole+"");
        }
        
        public HashMap<String, HashMap<String, VoteProtocole>> getListeVotesProtocoles() {
                return votesProtocoles;
        }
        
        public void setVoteProtocoles(HashMap<String, HashMap<String, VoteProtocole>> voteProtocoles) {
                this.votesProtocoles = voteProtocoles;
        }

        public void setVoteProtocoles(String id_protocole, HashMap<String, VoteProtocole> voteProtocoles) {
                this.votesProtocoles.put(id_protocole, voteProtocoles);
        }

        public Observation getObservation() {
                return observation;
        }

        public void setObservation(Observation observation) {
                this.observation = observation;
        }

}